![]() |
VR-Forces 4.1 Class Documentation
|
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it to another object. More...
Classes | |
| struct | FindModelFunctor |
| struct | ModelRecord |
| struct | ObjectTransform |
Public Types | |
| typedef std::vector < ObjectTransform > | TransformList |
| typedef std::vector< ModelRecord > | ModelList |
Public Member Functions | |
| DtSceneObject (DtDe &de, DtUniqueID id) | |
| CTOR. | |
| ~DtSceneObject () | |
| DTOR. | |
| void | addModel (DtModel *model, int visualizerType) |
| Add a model, and indicate the model's visualizerType. | |
| void | removeModel (DtModel *model) |
| Remove a model. | |
| void | removeModels () |
| Remove all models. | |
| void | setPosition (int vtx, const DtVector &position) |
| Sets the position of the object's specified vertex. | |
| void | addPosition (int vtx, const DtVector &position) |
| Add (or insert) a new vtx with the specified position value. | |
| void | getPosition (int vtx, DtVector &position) const |
| Gets the position of the object's specified vertex. | |
| void | 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 | getOffset (DtVector &offset) const |
| Get the offset, if any (may be <0,0,0>) | |
| void | setOrientation (int vtx, const DtTaitBryan &orientation) |
| Sets the orientation of the object and all of it's models. | |
| void | getOrientation (int vtx, DtTaitBryan &orientation) const |
| Gets the orientation of the object and all of it's models. | |
| void | getOrientation (int vtx, DtQuat &orientation) const |
| Gets the orientation of the object and all of it's models. | |
| void | setColor (float r, float g, float b, float a) |
| Set the blend color value of the scene object. | |
| void | setModelSet (int modelSet) |
| Set the model set this object uses; ignored if isProp is true. | |
| int | modelSet () const |
| Get the model set this object uses. | |
| void | setIsProp (bool isProp) |
| Set if the object is a prop. | |
| bool | isProp () const |
| Get if the object is a prop. | |
| void | setSolid (bool b) |
| DtElementID | elementID () const |
| get the id of the element that this scene object (partially) represents | |
| void | setElementID (DtElementID elementID) |
| set the id of the element that this scene object (partially) represents | |
| DtUniqueID | uniqueId () const |
| Get the unique ID of the object. | |
| const ModelList & | models () const |
| Get a const list of model instance owners (DtModel*s) | |
| ModelList & | models () |
| Get a non-const list of model instance owners (DtModel*s) | |
| const TransformList & | transforms () const |
| Get the list of transforms. | |
| virtual void | removePosition (int) |
| Remove a transform at the specified index. | |
| void | setBoundingBoxSize (double minX, double maxX, double minY, double maxY, double minZ, double maxZ) |
| Explicitly set the bound box size. | |
| const DtVector & | boundingBoxExtents () const |
| Get the bounding box extents of the object. | |
| void | getBoundingBoxExtents (double &x, double &y, double &z) const |
| Get the bounding box extents of the object. | |
| const DtVector & | boundingBoxCenter () const |
| Get the bounding box center of the object. | |
| void | getBoundingBoxCenter (double &x, double &y, double &z) const |
| Get the bounding box center of the object. | |
| double | boundingRadius () const |
| Get the current bounding radius. | |
| void | setVisible (bool visible) |
| Set the visible state of the scene object. | |
| bool | isVisible () const |
| Get the visible state of the scene object. | |
| void | setUpdater (DtSceneObjectUpdater *updater) |
| Set the updater for the scene object. | |
| DtSceneObjectUpdater * | findUpdater () |
| Get the updater for the scene object, it may be NULL. | |
| const DtSceneObjectUpdater * | findUpdater () const |
Public Attributes | |
Signals | |
| boost::signal< void(DtModel *)> | signal_modelAdded |
| Signaled after a model has been added. | |
| boost::signal< void(DtModel *)> | signal_modelRemoved |
| Signaled after the model has been removed. | |
| boost::signal< void(const DtUniqueID &) > | signal_sceneObjectToBeDeleted |
| Emitted before the scene object is destroyed. | |
| boost::signal< void(DtSceneObject *)> | signal_boundingVolumeChanged |
| Emitted after the bounding volume of the object changes. | |
Protected Member Functions | |
| void | initializeModel (DtModel *modelInstanceOwner) |
| Initialize the specified model. | |
| void | modelChanged (DtModel *model) |
| Register that a model has changed. | |
| bool | modelVisibilityRequested (DtModel *model, bool visible) |
| Part of an elaborate scheme to allow multiple models within a single scene object where some models may be visible while others. | |
| void | resetModelTransforms () |
| Push all scene object transforms to all models. | |
| void | updateBoundingBoxViaContents () |
| Update the bounding box of this scene object based on the bounding boxes of the models it contains. | |
| void | calculateBoundingRadius () |
| Calculate the scene object's bounding radius. | |
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.
| typedef std::vector<ObjectTransform> makVrv::DtSceneObject::TransformList |
| typedef std::vector<ModelRecord> makVrv::DtSceneObject::ModelList |
| makVrv::DtSceneObject::DtSceneObject | ( | DtDe & | de, |
| DtUniqueID | id | ||
| ) |
CTOR.
| makVrv::DtSceneObject::~DtSceneObject | ( | ) |
DTOR.
| void makVrv::DtSceneObject::addModel | ( | DtModel * | model, |
| int | visualizerType | ||
| ) |
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::getOrientation | ( | int | vtx, |
| DtTaitBryan & | orientation | ||
| ) | const |
Gets the orientation of the object and all of it's models.
| void makVrv::DtSceneObject::getOrientation | ( | int | vtx, |
| DtQuat & | orientation | ||
| ) | const |
Gets the orientation of the object and all of it's models.
| 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 | ( | int | modelSet | ) |
Set the model set this object uses; ignored if isProp is true.
| int 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::setSolid | ( | bool | b | ) |
| 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
| DtUniqueID makVrv::DtSceneObject::uniqueId | ( | ) | const |
Get the unique ID of the object.
| 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.
| void makVrv::DtSceneObject::getBoundingBoxExtents | ( | double & | x, |
| double & | y, | ||
| double & | z | ||
| ) | const |
Get the bounding box extents of the object.
| const DtVector& makVrv::DtSceneObject::boundingBoxCenter | ( | ) | const |
Get the bounding box center of the object.
| void makVrv::DtSceneObject::getBoundingBoxCenter | ( | double & | x, |
| double & | y, | ||
| double & | z | ||
| ) | const |
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. |
| 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 |
|
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.
| boost::signal<void (DtModel*)> makVrv::DtSceneObject::signal_modelAdded |
Signaled after a model has been added.
| boost::signal<void (DtModel*)> makVrv::DtSceneObject::signal_modelRemoved |
Signaled after the model has been removed.
| boost::signal< void (const DtUniqueID&) > makVrv::DtSceneObject::signal_sceneObjectToBeDeleted |
Emitted before the scene object is destroyed.
| boost::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 |