![]() |
VR-Forces 4.3.1 Class Documentation
|
Some models need to track consumption of resources, such as fuel or munitions.
Each DtSimComponentNetwork maintains its own set of resources in a DtSimResourceManager. Each component in a DtComponentSystem has a reference to this manager. A component that uses resources must look up the actual resource by name through its resourceManager() member. If no DtComponentSystem has been explicitly configured in an entity’s parameters, the resourceManager() function returns a pointer to the implicitly created base DtComponentSystem’s resource manager.
Once you have a pointer to the resource, you can determine its current level, and modify it as needed. For example, the DtAutomotiveActuatorComponent has a useFuel() member function, which is called in its tick() member function. It decrements the fuel in the entity by a given amount, as follows:
The actual types and amounts of each resource are configured in the object parameter database. (For details, please see 4.10 - The Resource Manager.)
[<< The Aggregate Multiresolution Model] [Home] [Top of Page] [Fire and Detonation Processing >>]