![]() |
VR-Forces Developer's Guide
|
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it to another object.
The DtSceneObject is a container class that 'groups' multiple models into a single scene-object. A scene-object is an association of models that can be manipulated as a single unit. Among other features, the DtSceneObject identifies a single position and attitude within the scene for all models associated with it. As such, models are added to (and removed from) the scene object to be inserted to (and removed from) the scene itself. Once constructed the DtSceneObject can be positioned and oriented within the scene so that any models added to the object will also be positioned and oriented. Make sure to set modelSet before element ID.

Classes | |
| struct | FindModelFunctor |
| struct | ModelConnections |
| struct | ModelRecord |
| struct | ObjectTransform |
Public Types | |
| typedef std::vector < ObjectTransform > | TransformList |
| typedef std::vector< ModelRecord > | ModelList |
Public Member Functions | |
| DtSceneObject (DtDe &de, DtUniqueID id) | |
| virtual | ~DtSceneObject () |
| void | addModel (DtModel *model, int visualizerType) |
| void | removeModel (DtModel *model) |
| void | removeModels () |
| void | setPosition (int vtx, const DtVector &position) |
| void | addPosition (int vtx, const DtVector &position) |
| void | getPosition (int vtx, DtVector &position) const |
| void | setOffset (const DtVector &offset) |
| void | getOffset (DtVector &offset) const |
| void | setOrientation (int vtx, const DtTaitBryan &orientation) |
| void | setPositionAndOrientation (int vtx, const DtVector &position, const DtTaitBryan &orientation) |
| void | setTopographicOrientation (int vtx, const DtTaitBryan &topoOrientation) |
| void | getOrientation (int vtx, DtTaitBryan &orientation) const |
| void | getTopographicOrientation (int vtx, DtTaitBryan &orientation) const |
| DtTaitBryan | getTopographicOrientation (const DtVector &geocLocation, const DtTaitBryan &geocOrientation) const |
| void | getOrientation (int vtx, DtQuat &orientation) const |
| virtual void | transformToSceneObjectCoord (const DtVector &dbCoord, DtVector &soCoord) const |
| virtual void | transformToDatabaseCoord (const DtVector &soCoord, DtVector &dbCoord) const |
| void | setColor (float r, float g, float b, float a) |
| void | setModelSet (DtModelSetId modelSet) |
| DtModelSetId | modelSet () const |
| void | setIsProp (bool isProp) |
| bool | isProp () const |
| void | setIsSupportObject (bool b) |
| bool | isSupportObject () |
| void | setSolid (bool b) |
| bool | isSolid () const |
| DtElementID | elementID () const |
| void | setElementID (DtElementID elementID) |
| DtUniqueID | uniqueId () const |
| const ModelList & | models () const |
| ModelList & | models () |
| const TransformList & | transforms () const |
| virtual void | removePosition (int) |
| void | setBoundingBoxSize (double minX, double maxX, double minY, double maxY, double minZ, double maxZ) |
| const DtVector & | boundingBoxExtents () const |
| void | getBoundingBoxExtents (double &x, double &y, double &z) const |
| const DtVector & | boundingBoxCenter () const |
| void | getBoundingBoxCenter (double &x, double &y, double &z) const |
| double | boundingRadius () const |
| void | setVisible (bool visible) |
| bool | isVisible () const |
| virtual void | setBeingObserved (bool observed) |
| virtual bool | beingObserved () const |
| void | setUpdater (DtSceneObjectUpdater *updater) |
| DtSceneObjectUpdater * | findUpdater () |
| const DtSceneObjectUpdater * | findUpdater () const |
| virtual float | getAndResetMinModelDistance () |
Static Public Member Functions | |
| static void | modelCoordToSceneObjectCoord (const DtVector &modelCoord, DtVector &soCoord) |
Public Attributes | |
Signals | |
| boost::signalslib::signal < void(DtModel *)> | signal_modelAdded |
| boost::signalslib::signal < void(DtModel *)> | signal_modelRemoved |
| boost::signalslib::signal < void(const DtUniqueID &) > | signal_sceneObjectToBeDeleted |
| boost::signalslib::signal < void(DtSceneObject *)> | signal_boundingVolumeChanged |
Protected Types | |
| typedef std::pair< DtModel *, ModelConnections > | ModelConnectionsPair |
| typedef boost::unordered_map < DtModel *, ModelConnections > | ModelConnectionsMap |
Protected Member Functions | |
| void | initializeModel (DtModel *modelInstanceOwner) |
| void | modelChanged (DtModel *model) |
| bool | modelVisibilityRequested (DtModel *model, bool visible) |
| void | resetModelTransforms () |
| void | updateBoundingBoxViaContents () |
| void | calculateBoundingRadius () |
| virtual void | addModelConnections (DtModel *model) |
| virtual void | removeModelConnections (DtModel *model) |
| typedef std::vector<ObjectTransform> makVrv::DtSceneObject::TransformList |
| typedef std::vector<ModelRecord> makVrv::DtSceneObject::ModelList |
|
protected |
|
protected |
| makVrv::DtSceneObject::DtSceneObject | ( | DtDe & | de, |
| DtUniqueID | id | ||
| ) |
CTOR.
|
virtual |
DTOR.
Add a model, and indicate the model's visualizerType. The visualizerType is ignored if the scene object is a prop.
| void makVrv::DtSceneObject::removeModel | ( | DtModel * | model | ) |
Remove a model.
| void makVrv::DtSceneObject::removeModels | ( | ) |
Remove all models.
| void makVrv::DtSceneObject::setPosition | ( | int | vtx, |
| const DtVector & | position | ||
| ) |
Sets the position of the object's specified vertex. If the vtx does not exist, it will be added.
| void makVrv::DtSceneObject::addPosition | ( | int | vtx, |
| const DtVector & | position | ||
| ) |
Add (or insert) a new vtx with the specified position value.
| void makVrv::DtSceneObject::getPosition | ( | int | vtx, |
| DtVector & | position | ||
| ) | const |
Gets the position of the object's specified vertex.
| void makVrv::DtSceneObject::setOffset | ( | const DtVector & | offset | ) |
Set an offset (or origin) The offset will be added to each position when transmitted to the scene object's model(s)
| void makVrv::DtSceneObject::getOffset | ( | DtVector & | offset | ) | const |
Get the offset, if any (may be <0,0,0>)
| void makVrv::DtSceneObject::setOrientation | ( | int | vtx, |
| const DtTaitBryan & | orientation | ||
| ) |
Sets the orientation of the object and all of it's models.
| void makVrv::DtSceneObject::setPositionAndOrientation | ( | int | vtx, |
| const DtVector & | position, | ||
| const DtTaitBryan & | orientation | ||
| ) |
Sets the position and orientation of the object and all of it's models.
| void makVrv::DtSceneObject::setTopographicOrientation | ( | int | vtx, |
| const DtTaitBryan & | topoOrientation | ||
| ) |
Sets the orientation of the object and all of it's models using a.
| void makVrv::DtSceneObject::getOrientation | ( | int | vtx, |
| DtTaitBryan & | orientation | ||
| ) | const |
Gets the orientation of the object and all of it's models.
| void makVrv::DtSceneObject::getTopographicOrientation | ( | int | vtx, |
| DtTaitBryan & | orientation | ||
| ) | const |
Gets the orientation of the object and all of it's models using a.
| DtTaitBryan makVrv::DtSceneObject::getTopographicOrientation | ( | const DtVector & | geocLocation, |
| const DtTaitBryan & | geocOrientation | ||
| ) | const |
Helper to get the value of the topographic orientation for a given position/orientation It is unrelated to the scene object, and probably should be in a helper class somewhere else (since this functionality seems to be repeatedly used many times (e.g. the tickables)
Gets the orientation of the object and all of it's models.
|
virtual |
Transform a database coordinate into a scene object coordinate The scene object coordinate system is a x-front/y-right/z-down system.
|
virtual |
Transform a scene object coordinate into a database coordinate The scene object coordinate system is a x-front/y-right/z-down system.
| void makVrv::DtSceneObject::setColor | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float | a | ||
| ) |
Set the blend color value of the scene object.
| void makVrv::DtSceneObject::setModelSet | ( | DtModelSetId | modelSet | ) |
Set the model set this object uses; ignored if isProp is true Make sure this is set BEFORE element ID, or the element mapper needs to be reset. If this is set after any models have been added to the scene, they have to be removed and readded.
| DtModelSetId makVrv::DtSceneObject::modelSet | ( | ) | const |
Get the model set this object uses.
| void makVrv::DtSceneObject::setIsProp | ( | bool | isProp | ) |
Set if the object is a prop. Objects must either be props OR have a valid model set.
| bool makVrv::DtSceneObject::isProp | ( | ) | const |
Get if the object is a prop.
| void makVrv::DtSceneObject::setIsSupportObject | ( | bool | b | ) |
Is this scene object using the support object flag.
| bool makVrv::DtSceneObject::isSupportObject | ( | ) |
Is this object a support object.
| void makVrv::DtSceneObject::setSolid | ( | bool | b | ) |
Set if the object should be drawn solid.
| bool makVrv::DtSceneObject::isSolid | ( | ) | const |
Is this object drawn solid.
| DtElementID makVrv::DtSceneObject::elementID | ( | ) | const |
get the id of the element that this scene object (partially) represents
| void makVrv::DtSceneObject::setElementID | ( | DtElementID | elementID | ) |
set the id of the element that this scene object (partially) represents Make sure this is set AFTER model set has been set
| DtUniqueID makVrv::DtSceneObject::uniqueId | ( | ) | const |
Get the unique ID of the object.
Referenced by makVrv::DtAttachableUpdater::ObjectAttachedPoint::ObjectAttachedPoint(), and makVrv::DtAttachableUpdater::ObjectAttachedPoint::setSceneObject().
| const ModelList& makVrv::DtSceneObject::models | ( | ) | const |
Get a const list of model instance owners (DtModel*s)
| ModelList& makVrv::DtSceneObject::models | ( | ) |
Get a non-const list of model instance owners (DtModel*s)
| const TransformList& makVrv::DtSceneObject::transforms | ( | ) | const |
Get the list of transforms.
|
virtual |
Remove a transform at the specified index.
| void makVrv::DtSceneObject::setBoundingBoxSize | ( | double | minX, |
| double | maxX, | ||
| double | minY, | ||
| double | maxY, | ||
| double | minZ, | ||
| double | maxZ | ||
| ) |
Explicitly set the bound box size. To use the automatic bounding box size set with all 0's.
| const DtVector& makVrv::DtSceneObject::boundingBoxExtents | ( | ) | const |
Get the bounding box extents of the object.
Get the bounding box extents of the object.
| const DtVector& makVrv::DtSceneObject::boundingBoxCenter | ( | ) | const |
Get the bounding box center of the object.
Get the bounding box center of the object.
| double makVrv::DtSceneObject::boundingRadius | ( | ) | const |
Get the current bounding radius.
| void makVrv::DtSceneObject::setVisible | ( | bool | visible | ) |
Set the visible state of the scene object.
| [in] | visible | is the new visible state; true = visible, false = hidden. |
| bool makVrv::DtSceneObject::isVisible | ( | ) | const |
Get the visible state of the scene object.
| true | if set visible. |
| false | otherwise. |
|
virtual |
Set/get the being observed flag When a scene object is invisible, dead reckoning, calls to set position, etc. are skipped. This effectively disables those optimizations by indicating that the object still needs to updated even if invisible.
|
virtual |
| void makVrv::DtSceneObject::setUpdater | ( | DtSceneObjectUpdater * | updater | ) |
Set the updater for the scene object.
| DtSceneObjectUpdater* makVrv::DtSceneObject::findUpdater | ( | ) |
Get the updater for the scene object, it may be NULL.
| const DtSceneObjectUpdater* makVrv::DtSceneObject::findUpdater | ( | ) | const |
|
virtual |
walks through the model list and returns the closest distance for using in updating.
|
static |
|
protected |
Initialize the specified model.
|
protected |
Register that a model has changed.
Part of an elaborate scheme to allow multiple models within a single scene object where some models may be visible while others.
|
protected |
Push all scene object transforms to all models.
|
protected |
Update the bounding box of this scene object based on the bounding boxes of the models it contains.
|
protected |
Calculate the scene object's bounding radius.
|
protectedvirtual |
Create connections to signals from the specified model.
|
protectedvirtual |
Remove connections to signals from the specified model.
| boost::signalslib::signal<void (DtModel*)> makVrv::DtSceneObject::signal_modelAdded |
Signaled after a model has been added.
| boost::signalslib::signal<void (DtModel*)> makVrv::DtSceneObject::signal_modelRemoved |
Signaled after the model has been removed.
| boost::signalslib::signal< void (const DtUniqueID&) > makVrv::DtSceneObject::signal_sceneObjectToBeDeleted |
Emitted before the scene object is destroyed.
| boost::signalslib::signal<void (DtSceneObject*)> makVrv::DtSceneObject::signal_boundingVolumeChanged |
Emitted after the bounding volume of the object changes.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |