![]() |
VR-Forces 4.2 Class Documentation
|
A DtModel is the basic unit of scene composition.
One model corresponds to one renderable object on each display engine. For example, visualizing a tank might involve one model for the tank's geometry, one model for its dust cloud, and another to display its track history. The basic types of models in VR-Forces, and their uses are:
The details required to draw a model, such as geometry, filename, scale, or texture are provided by a DtModelDefinition. A model definition is a set of parameters, whose names and types are defined by a DtSchema. The DtModelDefinitionManager saves and loads model definitions and schemas and maintains settings for model instancing and caching. Model definitions and schemas are distributed, but not by the usual agent mechanism. Instead, the DtDeSharedState distributes them directly.
A DtModel is only the distributed interface of a renderable scene element. It does not directly modify the scene graph of a display engine. Instead, when the model is given a model definition through its setModelDefinition() method, it creates a local DtModelInstance on each display engine, which is then responsible for putting the appropriate nodes in that display engine's scene graph. The attributes of the model instance are determined by the model definition's parameters and schema type.
Model instance types follow the Creator pattern. (For information about the Creator pattern, please see 10.5 - The Creator Pattern.) Each model instance type has a creator registered with the DtModelInstanceFactory, which the model uses to generate its instance. Once created, the instance sets itself up according to the model definition. The setup can either be from scratch, which typically means importing OSG nodes from a file, or if model instancing is enabled, by copying a cached instance from the model definition's local instance cache. When the model is added to a scene object, the instance inserts the appropriate nodes into the scene graph, usually (but not always) under the scene object's position and orientation transform nodes.
[<< Scene Composition] [Home] [Top of Page] [Terrain Structure >>]