This generic design allows for a central place to manage a wide variety of renderable types, including models, particle systems, cameras, sounds, and physics bodies.
Standard usage is to use the DISGManager DInterface to access DISGNode and DISGRenderObject's by name (every node and render object must have a unique name, although their can be duplication between DISGNodes and DISGRenderObjects. DISGNodeRepresentation, DISGRenderObjectRepresentation and DISGAnimatedRenderObjectRepresentation are only used if your componet is implementing DISGRepresentative. Implementing these DInterfaces allows your component to contribute objects to the scene graph (or to duplicate existing objects with your implementation). An example of this is that both 3DVisuals_OGRE and Physics_ODE implement DISGRepresentative and create DISGNodeRepresentation's. 3DVisuals_OGRE creates an Ogre::SceneNode for each DISGNodeRepresentation requested, where Physics_ODE creates ODE Bodies when the body="true" attribute is present.
The SGManagers creates DISGNode, DISGRenderObject and DISGAnimatedRenderObject's by:
Additional Notes on processing the unrecognized XML Nodes. There are from the SGManager implementation:
Data Structures | |
| struct | DigitalSpaces::DISGBase |
| The base functionality common to all scene-graph objects. More... | |
| struct | DigitalSpaces::DISGBaseRepr |
| Common functionality of SG Object Representations. More... | |
| void | DigitalSpaces::DISGBase::GetAbsolutePosition (out_Vector3f *pos) |
| Convenience functions. | |
| void | DigitalSpaces::DISGBase::GetAbsoluteOrientation (out_Quaternionf *orient) |
| Retreive the orientation of the object. | |
| void | DigitalSpaces::DISGBase::GetAbsoluteScale (out_Vector3f *scale) |
| Retreive the scale applied to render objects. | |
Functions | |
| const char * | DigitalSpaces::DISGBase::GetType () |
| Return the sub-type. | |
| DISGHeirachal * | DigitalSpaces::DISGBase::GetSGParent () |
| Return the parent node. | |
| void | DigitalSpaces::DISGBase::CreateAdditionalRepresentations (const char *type, DIXMLNode1 *configuration) |
| Allows creation of additional representations (from DISGRepresentative) using different information. | |
| DigitalSpaces::DInterfaceWithParent (DISGHeirachal, DISGBase) DISGBase *CreateChild(const char *name | |
| Convenience function for DISGManager::CreateSGNode(name, type, this, configuration). | |
| DISGBase * | DigitalSpaces::GetChild (const char *name) |
| Retreive a child node. | |
| bool | DigitalSpaces::AttachChild (DISGBase *child) |
| Add a child node. | |
| bool | DigitalSpaces::DetachChild (const char *name) |
| Remove a child node. | |
| void | DigitalSpaces::GetChildNames (DIStringList1 *names) |
| Retreive a list of the names of all child nodes. | |
| DISGBaseRepr * | DISGRepresentative::GetSGRepr (const char *name) |
| Retreive a previously created scenegraph object representation. | |
| DISGBaseRepr * | DISGRepresentative::CreateSGRepr (const char *name, const char *type, DISGHeirachal *parent, DIXMLNode1 *configuration) |
| Create a new scenegraph object representation. | |
| bool | DISGRepresentative::DestroySGRepr (const char *name) |
| Destroy a previously created scenegraph node representation. | |
| bool | DISGManager::DestroySGObject (const char *name) |
| Destroy a previously created scene graph object. | |
| DISGBase * | DISGManager::GetSGObject (const char *name) |
| Retreive a previously created scene graph object. | |
| DISGHeirachal * | DISGManager::GetSGHeirachal (const char *name) |
| A convenience version of GetSGObject, that performs the type cast for you. | |
| DISGMovable * | DISGManager::GetSGMovable (const char *name) |
| A convenience version of GetSGObject, that performs the type cast for you. | |
| DISGAnimated * | DISGManager::GetSGAnimated (const char *name) |
| A convenience version of GetSGObject, that performs the type cast for you. | |
| DISGBase * | DISGManager::CreateAdditionalRepresentationsOfObject (const char *name, const char *type, DIXMLNode1 *configuration) |
| Create additional representations of the specified object, with different configuration data. | |
Variables | |
| const char * | DigitalSpaces::type |
| const char DIXMLNode1 * | DigitalSpaces::configuration |
| bool DigitalSpaces::AttachChild | ( | DISGBase * | child | ) |
Add a child node.
This is generally used to move nodes from one point on the scene heirachy to another.
| void DigitalSpaces::DISGBase::CreateAdditionalRepresentations | ( | const char * | type, | |
| DIXMLNode1 * | configuration | |||
| ) | [inherited] |
Allows creation of additional representations (from DISGRepresentative) using different information.
| DISGBase* DISGManager::CreateAdditionalRepresentationsOfObject | ( | const char * | name, | |
| const char * | type, | |||
| DIXMLNode1 * | configuration | |||
| ) | [inherited] |
Create additional representations of the specified object, with different configuration data.
| DISGBaseRepr* DISGRepresentative::CreateSGRepr | ( | const char * | name, | |
| const char * | type, | |||
| DISGHeirachal * | parent, | |||
| DIXMLNode1 * | configuration | |||
| ) | [inherited] |
Create a new scenegraph object representation.
| name | Identifier used for the newly created node. It will (should) be unique. | |
| type | Subtype identifier used for the object. A commonexample is "node" however other types are permissable, assuming that a DISGRepresentative recognised the type. | |
| parent | Provided for context for new SG object creation. The new representation is not required to be attached to/a child of the parent, AddChild will be called on the parent after creation is complete. | |
| configuration | Free form XML providing configuration details to the DISGRepresentative's. Implementations are not required to understand all the information passed. The implementation should avoid doing too much work with the configuration data. Tt will also be passed to the implementation as DIAcceptConfiguration1::ParseConfiguration, where as much of the work as possible should be done. This is to allow post-creation configuration of properties that might otherwise remain unconfigurable. |
| bool DISGManager::DestroySGObject | ( | const char * | name | ) | [inherited] |
Destroy a previously created scene graph object.
| name | Name used when creating the object. |
| bool DISGRepresentative::DestroySGRepr | ( | const char * | name | ) | [inherited] |
Destroy a previously created scenegraph node representation.
| name | Name used to identify the node representation |
| bool DigitalSpaces::DetachChild | ( | const char * | name | ) |
Remove a child node.
| DigitalSpaces::DInterfaceWithParent | ( | DISGHeirachal | , | |
| DISGBase | ||||
| ) | const |
Convenience function for DISGManager::CreateSGNode(name, type, this, configuration).
| void DigitalSpaces::DISGBase::GetAbsoluteOrientation | ( | out_Quaternionf * | orient | ) | [inherited] |
Retreive the orientation of the object.
| [out] | orient | Quaternion to be filled with the orientation of the node. This is in world space. |
| void DigitalSpaces::DISGBase::GetAbsolutePosition | ( | out_Vector3f * | pos | ) | [inherited] |
Convenience functions.
Any object in the scenegraph has an absolute position and orientation, as long as it's part of the heirachy. Even if it's position cannot be moved, the position/orientation of it's nearest ancestor Movable is it's position/orientation. Retreive the position of the object.
| [out] | pos | Vector to be filled with the position of the node. This is in world space. |
| void DigitalSpaces::DISGBase::GetAbsoluteScale | ( | out_Vector3f * | scale | ) | [inherited] |
Retreive the scale applied to render objects.
| [out] | scale | Vector to be filled with the per-axis multiplier. |
| DISGBase* DigitalSpaces::GetChild | ( | const char * | name | ) |
Retreive a child node.
This includes attached render objects that have implementations that also implemented DISGNodeRepresentation - i.e. non-node heirachal objects or non-node positionable objects.
| void DigitalSpaces::GetChildNames | ( | DIStringList1 * | names | ) |
Retreive a list of the names of all child nodes.
This is not recursive, i.e it only returns the direct children.
| names | String List that will have the names of the child nodes appended. The implementation does not clear the list before appending. |
| DISGAnimated* DISGManager::GetSGAnimated | ( | const char * | name | ) | [inherited] |
A convenience version of GetSGObject, that performs the type cast for you.
Note that the returned DISGAnimated should still be able to be dss_cast to a DISGMovable or DISGHeirachal, if appropriate.
| name | Name used when creating the object. |
| DISGHeirachal* DISGManager::GetSGHeirachal | ( | const char * | name | ) | [inherited] |
A convenience version of GetSGObject, that performs the type cast for you.
Note that the returned DISGHeirachal should still be able to be dss_cast to a DISGMovable or DISGAnimated, if appropriate.
| name | Name used when creating the object. |
| DISGMovable* DISGManager::GetSGMovable | ( | const char * | name | ) | [inherited] |
A convenience version of GetSGObject, that performs the type cast for you.
Note that the returned DISGMovable should still be able to be dss_cast to a DISGHeirachal or DISGAnimated, if appropriate.
| name | Name used when creating the object. |
| DISGBase* DISGManager::GetSGObject | ( | const char * | name | ) | [inherited] |
Retreive a previously created scene graph object.
| name | Name used when creating the object. |
| DISGHeirachal* DigitalSpaces::DISGBase::GetSGParent | ( | ) | [inherited] |
Return the parent node.
| DISGBaseRepr* DISGRepresentative::GetSGRepr | ( | const char * | name | ) | [inherited] |
Retreive a previously created scenegraph object representation.
| name | Name used when creating the node. |
| const char* DigitalSpaces::DISGBase::GetType | ( | ) | [inherited] |
Return the sub-type.
This should only be used as a general peice of information, attempting to dss_cast is a better way of detecting what an object is/can do
An example value is node (created from a <node>).
| const char DIXMLNode1* DigitalSpaces::configuration |
| const char* DigitalSpaces::type |
1.5.6