VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simpleProximitySensor.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
8 
10 
11 #pragma once
12 
17 
18 class DtRwObjectTypeList;
22 
26  public DtBindableLuaComponent<DtSimpleProximitySensor>
27 {
28 private:
31 
34 
37 
38 public:
39 
42  DtSimpleProximitySensor(const DtString& name,
43  DtLocalObject* owner,
44  DtSimulationServices* simManager,
45  DtComponentDescriptor* desc = 0,
46  DtReaderWriterRegistry* parentRegistry = 0);
47 
49  virtual ~DtSimpleProximitySensor();
50 
53  virtual const char* type() const;
54 
56  virtual void tick();
57 
61  static DtSimComponent * creator(const DtString& name,
62  DtLocalObject* owner,
63  DtSimulationServices* simManager,
64  DtComponentDescriptor* desc = 0,
65  DtReaderWriterRegistry* parentRegistry = 0);
66 
68  virtual void setDetectionProximity(double);
69  virtual double detectionProximity() const;
70 
73  virtual void senseObjects(const DtRwObjectTypeList&, bool hostileOnly, bool detectOwnForce);
74 
76  virtual void setObjectTypesToDetect(const std::vector<std::string>&, bool hostileOnly);
77 
80  virtual void bindLuaFunctions(lua_State* L);
81  virtual void bindLuaGlobals(lua_State* L);
82 
83 protected:
84 
86  virtual bool createPorts();
87 
88  DtSimpleProximitySensorPSR* createPSR();
89 
90  virtual bool init();
91  virtual void preFirstTickInit();
92 
93 protected:
94 
96 
97  DtSensorContactListOutputPort * myDetectedObjectListPort;
104 
105  std::vector<DtObjectType> myObjectTypesToDetect;
107 
109 
111 };
112 
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
std::vector< DtObjectType > myObjectTypesToDetect
Outputs: Output Port Name: detected-objects Output Port Description: The list of contacts detected b...
Definition: simpleProximitySensor.h:105
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
Definition: sensorContactListIOPort.h:71
virtual void bindLuaFunctions(lua_State *)=0
Override to bind lua functions.
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
Definition: bindableLuaComponent.h:53
A reader-writer list of DtRwSensorContactInfo elements. Use the DtRwList::add() and remove() methods ...
Definition: sensorContactInfoList.h:32
DtSimpleProximitySensorDescriptor; descriptor for the DtSimpleProximitySensor component.
Definition: simpleProximitySensorDescriptor.h:29
DtSimpleProximitySensor senses supplied objects within the given distance. Provides lua bindings for ...
Definition: simpleProximitySensor.h:25
class DtSimpleProximitySensorPSR:
Definition: simpleProximitySensorPSR.h:24
class DtRwObjectTypeList:
Definition: rwObjectTypeList.h:30
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
DtSimComponent & operator=(const DtSimComponent &orig)
assignment operator, not implemented
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:94
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:91
Contains the DtSimComponent class declaration.
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
DtSimpleProximitySensorDescriptor * myDescriptor
Outputs: Output Port Name: detected-objects Output Port Description: The list of contacts detected b...
Definition: simpleProximitySensor.h:110
virtual void bindLuaGlobals(lua_State *)=0
Override to bind lua globals.
DtSimpleProximitySensorPSR * myProcessState
Outputs: Output Port Name: detected-objects Output Port Description: The list of contacts detected b...
Definition: simpleProximitySensor.h:108
DtSensorContactInfoList myContactInfoList
Outputs: Output Port Name: detected-objects Output Port Description: The list of contacts detected b...
Definition: simpleProximitySensor.h:106
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)