NTRT Simulator
Version: Master
|
#include <tgCompoundRigidSensorInfo.h>
Public Member Functions | |
tgCompoundRigidSensorInfo () | |
~tgCompoundRigidSensorInfo () | |
virtual bool | isThisMySenseable (tgSenseable *pSenseable) |
virtual std::vector< tgSensor * > | createSensorsIfAppropriate (tgSenseable *pSenseable) |
tgCompoundRigidSensorInfo is a sensor info class that creates sensors for compound rigid bodies. It creates a sensor for any tgSenseable object that: (1) is a tgModel with at least two descendants (2) at least two of the descendants, both of which can be cast to tgBaseRigids, have matching "compound_XXXXXX" tags See the implementation of these functions for more details about how many sensors are created. If used properly (e.g. this is the only tgCompoundRigidSensorInfo in the application), there should not be any redundant sensors created.
Definition at line 57 of file tgCompoundRigidSensorInfo.h.
tgCompoundRigidSensorInfo::tgCompoundRigidSensorInfo | ( | ) |
tgSensorInfo has an empty constructor. It does not contain any data.
Nothing to do in this constructor. A sensor info doesn't have any data.
Definition at line 54 of file tgCompoundRigidSensorInfo.cpp.
tgCompoundRigidSensorInfo::~tgCompoundRigidSensorInfo | ( | ) |
Similarly, its destructor should be empty.
Similarly, empty destructor.
Definition at line 61 of file tgCompoundRigidSensorInfo.cpp.
|
virtual |
Similarly, create a sensor if appropriate. This class can make zero or more sensors via this method. An empty list will be returned if there are no available compounds in the passed-in model that are not in the blacklist. Otherwise, it will create an individual sensor for every compound that is not in the blacklist.
[in] | pSenseable | pointer to a senseable object. Sensor will be created for this pSenseable. |
Create a tgCompoundRigidSensor for a tgModel.
(1) Get the compound tags from within this tgModel. (2) Remove any compound tags that are in blacklist. (3) Create sensors for all remaining tags. (4) Blacklist the tags that were just now passed in to the sensor constructor.
Implements tgSensorInfo.
Definition at line 193 of file tgCompoundRigidSensorInfo.cpp.
|
virtual |
From tgSensorInfo, need to implement a check to see if a particular tgSenseable fits the criteria for making a compound rigid body sensor. This returns true iff the passed-in model has at least one compound, and that compound is not in the blacklist.
[in] | pSenseable | a pointer to a tgSenseable object, that this sensor info may or may not be able to create a sensor for. |
This function returns true if pSenseable is a tgModel with: (1) at least two descendants (2) at least two of the descendants, both of which can be cast to tgBaseRigids, have matching "compound_XXXXXX" tags (3) at least one of the tags does NOT exist in the blacklist.
Implements tgSensorInfo.
Definition at line 145 of file tgCompoundRigidSensorInfo.cpp.