|
VR-Engage
2.2
|
Extends the ground vehicle state repository to provide specialized state management for entities using the Vortex physics engine. Includes support for location and heading change callbacks.
#include <vortexStateRepository.h>
Public Member Functions | |
| DtVortexStateRepository (DtLocalObject *vrfObject, const DtString &name, DtReaderWriterRegistry *parentRegistry=0) | |
| virtual | ~DtVortexStateRepository () override |
| virtual DtString | type () const override |
| virtual void | place (const DtVector &location, const DtReal heading, bool clampToGroundFlag, bool *dataAvailable, bool requireAllData) override |
| virtual void | addLocationChangedCallback (DtLocationCallbackFunction function, void *userData) |
| virtual void | removeLocationChangedCallback (DtLocationCallbackFunction function, void *userData) |
| virtual void | addHeadingChangedCallback (DtHeadingCallbackFunction function, void *userData) |
| virtual void | removeHeadingChangedCallback (DtHeadingCallbackFunction function, void *userData) |
Static Public Member Functions | |
| static DtVrfObjectStateRepository * | creator (const DtString &name, DtLocalObject *vrfObject, DtReaderWriterRegistry *parentRegistry) |
| static DtVortexStateRepository * | asVortexStateRepository (const DtVrfObjectStateRepository *repository) |
Protected Attributes | |
| DtLocationCallbackList | myLocationCallbackList |
| DtHeadingCallbackList | myHeadingCallbackList |
Private Member Functions | |
| DtVortexStateRepository (const DtVortexStateRepository &orig) | |
| const DtVortexStateRepository & | operator= (const DtVortexStateRepository &orig) |
|
private |
Copy constructor (private, not implemented)
References DtVortexStateRepository().
Referenced by asVortexStateRepository(), DtVortexStateRepository(), and operator=().
| DtVortexStateRepository::DtVortexStateRepository | ( | DtLocalObject * | vrfObject, |
| const DtString & | name, | ||
| DtReaderWriterRegistry * | parentRegistry = 0 ) |
Constructor.
Creates a new state repository with the specified parameters.
| vrfObject | The VR-Forces object to associate with |
| name | Name for the repository |
| parentRegistry | Optional parent registry |
|
overridevirtual |
Destructor.
|
private |
Assignment operator (private, not implemented)
References DtVortexStateRepository().
|
overridevirtual |
Gets the type of this repository.
Returns a unique string identifying the type of component, used as key in the state repository factory.
|
static |
Factory method to create new instances.
Returns a newly created instance of this class. To be registered with the state repository factory.
| name | Name for the repository |
| vrfObject | The VR-Forces object to associate with |
| parentRegistry | Optional parent registry |
|
static |
Safe type-checking conversion.
Returns the pointer to the repository if the repository passed in is of type DtVortexStateRepository, nullptr if not.
| repository | Repository to cast |
References DtVortexStateRepository().
|
overridevirtual |
Places the entity at a new location and heading.
Positions the entity at the specified location and heading, then invokes all registered location and heading change callbacks.
| location | The new position vector |
| heading | The new heading in radians |
| clampToGroundFlag | Whether to clamp the entity to ground |
| dataAvailable | Optional pointer to receive data availability status |
| requireAllData | Whether all data must be available |
|
virtual |
Adds a location change callback.
Registers a function to be called when the entity's location changes. The callback will be invoked whenever the place() method is called.
| function | Callback function to add |
| userData | User data to pass to the callback |
|
virtual |
Removes a location change callback.
Unregisters a previously added location change callback.
| function | Callback function to remove |
| userData | User data associated with the callback |
|
virtual |
Adds a heading change callback.
Registers a function to be called when the entity's heading changes. The callback will be invoked whenever the place() method is called.
| function | Callback function to add |
| userData | User data to pass to the callback |
|
virtual |
Removes a heading change callback.
Unregisters a previously added heading change callback.
| function | Callback function to remove |
| userData | User data associated with the callback |
|
protected |
List of location change callbacks.
|
protected |
List of heading change callbacks.