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 DtRwEntityTypeList;
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() override;
50 
53  virtual const char* type() const override;
54 
56  virtual void tick() override;
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 DtRwEntityTypeList&, bool hostileOnly, bool detectOwnForce);
74 
76  virtual void setObjectTypesToDetect(const std::vector<std::string>&, bool hostileOnly);
77 
80  virtual void bindLuaFunctions(lua_State* L) override;
81  virtual void bindLuaGlobals(lua_State* L) override;
82 
83 protected:
84 
86  virtual bool createPorts() override;
87 
88  DtSimpleProximitySensorPSR* createPSR();
89 
90  virtual bool init() override;
91  virtual void preFirstTickInit() override;
92 
93 protected:
94 
96 
97  DtSensorContactListOutputPort * myDetectedObjectListPort;
104 
105  std::vector<DtEntityType> myObjectTypesToDetect;
107 
109 
111 };
112 
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
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.
class DtRwEntityTypeList:
Definition: rwEntityTypeList.h:23
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
std::vector< DtEntityType > myObjectTypesToDetect
Outputs: Output Port Name: detected-objects Output Port Description: The list of contacts detected b...
Definition: simpleProximitySensor.h:105
A reader-writer list of DtRwSensorContactInfo elements. Use the DtRwList::add() and remove() methods ...
Definition: sensorContactInfoList.h:35
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
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:96
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
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.
Definition: localObject.h:98

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)