|
@@ -122,7 +122,7 @@ public:
|
|
|
* Custom tags can be used for a variety of purposes within a game. For example,
|
|
* Custom tags can be used for a variety of purposes within a game. For example,
|
|
|
* a tag called "transparent" can be added to nodes, to indicate which nodes in
|
|
* a tag called "transparent" can be added to nodes, to indicate which nodes in
|
|
|
* a scene are transparent. This tag can then be read during rendering to sort
|
|
* a scene are transparent. This tag can then be read during rendering to sort
|
|
|
- * transparent and opaque objects for correct drawing order.
|
|
|
|
|
|
|
+ * transparent and opaque objects for correct drawing order.
|
|
|
*
|
|
*
|
|
|
* Setting a tag to NULL removes the tag from the Node.
|
|
* Setting a tag to NULL removes the tag from the Node.
|
|
|
*
|
|
*
|
|
@@ -162,13 +162,13 @@ public:
|
|
|
* Sets the user pointer for this node.
|
|
* Sets the user pointer for this node.
|
|
|
*
|
|
*
|
|
|
* The user pointer is initially NULL and can be set to anything.
|
|
* The user pointer is initially NULL and can be set to anything.
|
|
|
- * This is normally used to store game-specific data, such as
|
|
|
|
|
|
|
+ * This is normally used to store game-specific data, such as
|
|
|
* game state for a particular node. For example, attributes
|
|
* game state for a particular node. For example, attributes
|
|
|
* for a game character, such as hit points, stamina, etc can
|
|
* for a game character, such as hit points, stamina, etc can
|
|
|
* be defined in a game structure and stored in this field.
|
|
* be defined in a game structure and stored in this field.
|
|
|
*
|
|
*
|
|
|
* When a node is deleted, the (optional) cleanup callback
|
|
* When a node is deleted, the (optional) cleanup callback
|
|
|
- * function passed to this function is called to allow the
|
|
|
|
|
|
|
+ * function passed to this function is called to allow the
|
|
|
* user to free any memory associated with the user pointer.
|
|
* user to free any memory associated with the user pointer.
|
|
|
*
|
|
*
|
|
|
* @param pointer User pointer.
|
|
* @param pointer User pointer.
|
|
@@ -212,7 +212,7 @@ public:
|
|
|
/**
|
|
/**
|
|
|
* Returns the first child node that matches the given ID.
|
|
* Returns the first child node that matches the given ID.
|
|
|
*
|
|
*
|
|
|
- * This method checks the specified ID against its immediate child nodes
|
|
|
|
|
|
|
+ * This method checks the specified ID against its immediate child nodes
|
|
|
* but does not check the ID against itself.
|
|
* but does not check the ID against itself.
|
|
|
* If recursive is true, it also traverses the Node's hierarchy with a breadth first search.
|
|
* If recursive is true, it also traverses the Node's hierarchy with a breadth first search.
|
|
|
*
|
|
*
|
|
@@ -220,7 +220,7 @@ public:
|
|
|
* @param recursive True to search recursively all the node's children, false for only direct children.
|
|
* @param recursive True to search recursively all the node's children, false for only direct children.
|
|
|
* @param exactMatch true if only nodes whose ID exactly matches the specified ID are returned,
|
|
* @param exactMatch true if only nodes whose ID exactly matches the specified ID are returned,
|
|
|
* or false if nodes that start with the given ID are returned.
|
|
* or false if nodes that start with the given ID are returned.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @return The Node found or NULL if not found.
|
|
* @return The Node found or NULL if not found.
|
|
|
*/
|
|
*/
|
|
|
Node* findNode(const char* id, bool recursive = true, bool exactMatch = true) const;
|
|
Node* findNode(const char* id, bool recursive = true, bool exactMatch = true) const;
|
|
@@ -233,7 +233,7 @@ public:
|
|
|
* @param recursive true if a recursive search should be performed, false otherwise.
|
|
* @param recursive true if a recursive search should be performed, false otherwise.
|
|
|
* @param exactMatch true if only nodes whose ID exactly matches the specified ID are returned,
|
|
* @param exactMatch true if only nodes whose ID exactly matches the specified ID are returned,
|
|
|
* or false if nodes that start with the given ID are returned.
|
|
* or false if nodes that start with the given ID are returned.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @return The number of matches found.
|
|
* @return The number of matches found.
|
|
|
* @script{ignore}
|
|
* @script{ignore}
|
|
|
*/
|
|
*/
|
|
@@ -415,7 +415,7 @@ public:
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Assigns a camera to this node.
|
|
* Assigns a camera to this node.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* This will increase the reference count of the new camera and decrease
|
|
* This will increase the reference count of the new camera and decrease
|
|
|
* the reference count of the old camera.
|
|
* the reference count of the old camera.
|
|
|
*
|
|
*
|
|
@@ -432,7 +432,7 @@ public:
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Assigns a light to this node.
|
|
* Assigns a light to this node.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* This will increase the reference count of the new light and decrease
|
|
* This will increase the reference count of the new light and decrease
|
|
|
* the reference count of the old light.
|
|
* the reference count of the old light.
|
|
|
*
|
|
*
|
|
@@ -442,14 +442,14 @@ public:
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Returns the pointer to this node's model.
|
|
* Returns the pointer to this node's model.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @return The pointer to this node's model or NULL.
|
|
* @return The pointer to this node's model or NULL.
|
|
|
*/
|
|
*/
|
|
|
Model* getModel() const;
|
|
Model* getModel() const;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Assigns a model to this node.
|
|
* Assigns a model to this node.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* This will increase the reference count of the new model and decrease
|
|
* This will increase the reference count of the new model and decrease
|
|
|
* the reference count of the old model.
|
|
* the reference count of the old model.
|
|
|
*
|
|
*
|
|
@@ -476,14 +476,14 @@ public:
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Returns the pointer to this node's form.
|
|
* Returns the pointer to this node's form.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @return The pointer to this node's form or NULL.
|
|
* @return The pointer to this node's form or NULL.
|
|
|
*/
|
|
*/
|
|
|
Form* getForm() const;
|
|
Form* getForm() const;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Assigns a form to this node.
|
|
* Assigns a form to this node.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @param form The form pointer. May be NULL.
|
|
* @param form The form pointer. May be NULL.
|
|
|
*/
|
|
*/
|
|
|
void setForm(Form* form);
|
|
void setForm(Form* form);
|
|
@@ -497,7 +497,7 @@ public:
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Assigns an audio source to this node.
|
|
* Assigns an audio source to this node.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* This will increase the reference count of the new audio source and decrease
|
|
* This will increase the reference count of the new audio source and decrease
|
|
|
* the reference count of the old audio source.
|
|
* the reference count of the old audio source.
|
|
|
*
|
|
*
|
|
@@ -514,7 +514,7 @@ public:
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Assigns a particle emitter to this node.
|
|
* Assigns a particle emitter to this node.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* This will increase the reference count of the new particle emitter and decrease
|
|
* This will increase the reference count of the new particle emitter and decrease
|
|
|
* the reference count of the old particle emitter.
|
|
* the reference count of the old particle emitter.
|
|
|
*
|
|
*
|
|
@@ -535,7 +535,7 @@ public:
|
|
|
/**
|
|
/**
|
|
|
* Sets (or disables) the physics collision object for this node.
|
|
* Sets (or disables) the physics collision object for this node.
|
|
|
*
|
|
*
|
|
|
- * The supported collision object types include rigid bodies, ghost objects,
|
|
|
|
|
|
|
+ * The supported collision object types include rigid bodies, ghost objects,
|
|
|
* characters, vehicles, and vehicle wheels.
|
|
* characters, vehicles, and vehicle wheels.
|
|
|
*
|
|
*
|
|
|
* Rigid bodies are used to represent most physical objects in a game. The important
|
|
* Rigid bodies are used to represent most physical objects in a game. The important
|
|
@@ -551,7 +551,7 @@ public:
|
|
|
* Ghost objects are a simple type of collision object that are not simulated. By default
|
|
* Ghost objects are a simple type of collision object that are not simulated. By default
|
|
|
* they pass through other objects in the scene without affecting them. Ghost objects do
|
|
* they pass through other objects in the scene without affecting them. Ghost objects do
|
|
|
* receive collision events however, which makes them useful for representing non-simulated
|
|
* receive collision events however, which makes them useful for representing non-simulated
|
|
|
- * entities in a game that still require collision events, such as volumetric triggers,
|
|
|
|
|
|
|
+ * entities in a game that still require collision events, such as volumetric triggers,
|
|
|
* power-ups, etc.
|
|
* power-ups, etc.
|
|
|
*
|
|
*
|
|
|
* Characters are an extension of ghost objects which provide a number of additional features
|
|
* Characters are an extension of ghost objects which provide a number of additional features
|
|
@@ -575,21 +575,21 @@ public:
|
|
|
* @param group Group identifier of the object for collision filtering.
|
|
* @param group Group identifier of the object for collision filtering.
|
|
|
* @param mask Bitmask to filter groups of objects to collide with this one.
|
|
* @param mask Bitmask to filter groups of objects to collide with this one.
|
|
|
*/
|
|
*/
|
|
|
- PhysicsCollisionObject* setCollisionObject(PhysicsCollisionObject::Type type, const PhysicsCollisionShape::Definition& shape = PhysicsCollisionShape::box(),
|
|
|
|
|
|
|
+ PhysicsCollisionObject* setCollisionObject(PhysicsCollisionObject::Type type, const PhysicsCollisionShape::Definition& shape = PhysicsCollisionShape::box(),
|
|
|
PhysicsRigidBody::Parameters* rigidBodyParameters = NULL, int group = PHYSICS_COLLISION_GROUP_DEFAULT, int mask = PHYSICS_COLLISION_MASK_DEFAULT);
|
|
PhysicsRigidBody::Parameters* rigidBodyParameters = NULL, int group = PHYSICS_COLLISION_GROUP_DEFAULT, int mask = PHYSICS_COLLISION_MASK_DEFAULT);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Sets the physics collision object for this node using the data from the Properties object defined at the specified URL,
|
|
|
|
|
|
|
+ * Sets the physics collision object for this node using the data from the Properties object defined at the specified URL,
|
|
|
* where the URL is of the format "<file-path>.<extension>#<namespace-id>/<namespace-id>/.../<namespace-id>"
|
|
* where the URL is of the format "<file-path>.<extension>#<namespace-id>/<namespace-id>/.../<namespace-id>"
|
|
|
- * (and "#<namespace-id>/<namespace-id>/.../<namespace-id>" is optional).
|
|
|
|
|
- *
|
|
|
|
|
|
|
+ * (and "#<namespace-id>/<namespace-id>/.../<namespace-id>" is optional).
|
|
|
|
|
+ *
|
|
|
* @param url The URL pointing to the Properties object defining the physics collision object.
|
|
* @param url The URL pointing to the Properties object defining the physics collision object.
|
|
|
*/
|
|
*/
|
|
|
PhysicsCollisionObject* setCollisionObject(const char* url);
|
|
PhysicsCollisionObject* setCollisionObject(const char* url);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Sets the physics collision object for this node from the given properties object.
|
|
* Sets the physics collision object for this node from the given properties object.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @param properties The properties object defining the collision object.
|
|
* @param properties The properties object defining the collision object.
|
|
|
*/
|
|
*/
|
|
|
PhysicsCollisionObject* setCollisionObject(Properties* properties);
|
|
PhysicsCollisionObject* setCollisionObject(Properties* properties);
|
|
@@ -612,7 +612,7 @@ public:
|
|
|
* Returns the bounding sphere for the Node, in world space.
|
|
* Returns the bounding sphere for the Node, in world space.
|
|
|
*
|
|
*
|
|
|
* The bounding sphere for a node represents the area, in world
|
|
* The bounding sphere for a node represents the area, in world
|
|
|
- * space, that the node contains. This includes the space occupied
|
|
|
|
|
|
|
+ * space, that the node contains. This includes the space occupied
|
|
|
* by any child nodes as well as the space occupied by any data
|
|
* by any child nodes as well as the space occupied by any data
|
|
|
* inside the node (such as models).
|
|
* inside the node (such as models).
|
|
|
*
|
|
*
|
|
@@ -631,7 +631,7 @@ public:
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Clones the node and all of its child nodes.
|
|
* Clones the node and all of its child nodes.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @return A new node.
|
|
* @return A new node.
|
|
|
* @script{create}
|
|
* @script{create}
|
|
|
*/
|
|
*/
|
|
@@ -651,25 +651,25 @@ protected:
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Clones a single node and its data but not its children.
|
|
* Clones a single node and its data but not its children.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @param context The clone context.
|
|
* @param context The clone context.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @return Pointer to the newly created node.
|
|
* @return Pointer to the newly created node.
|
|
|
*/
|
|
*/
|
|
|
virtual Node* cloneSingleNode(NodeCloneContext &context) const;
|
|
virtual Node* cloneSingleNode(NodeCloneContext &context) const;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Recursively clones this node and its children.
|
|
* Recursively clones this node and its children.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @param context The clone context.
|
|
* @param context The clone context.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @return The newly created node.
|
|
* @return The newly created node.
|
|
|
*/
|
|
*/
|
|
|
Node* cloneRecursive(NodeCloneContext &context) const;
|
|
Node* cloneRecursive(NodeCloneContext &context) const;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Copies the data from this node into the given node.
|
|
* Copies the data from this node into the given node.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @param node The node to copy the data to.
|
|
* @param node The node to copy the data to.
|
|
|
* @param context The clone context.
|
|
* @param context The clone context.
|
|
|
*/
|
|
*/
|
|
@@ -724,7 +724,7 @@ protected:
|
|
|
*/
|
|
*/
|
|
|
void* pointer;
|
|
void* pointer;
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
|
|
+ /**
|
|
|
* Cleanup callback.
|
|
* Cleanup callback.
|
|
|
*/
|
|
*/
|
|
|
void (*cleanupCallback)(void*);
|
|
void (*cleanupCallback)(void*);
|
|
@@ -737,19 +737,19 @@ protected:
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* The Node's ID.
|
|
* The Node's ID.
|
|
|
- */
|
|
|
|
|
|
|
+ */
|
|
|
std::string _id;
|
|
std::string _id;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Pointer to the Node's first child.
|
|
* Pointer to the Node's first child.
|
|
|
*/
|
|
*/
|
|
|
Node* _firstChild;
|
|
Node* _firstChild;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Pointer to the Node's next child.
|
|
* Pointer to the Node's next child.
|
|
|
*/
|
|
*/
|
|
|
Node* _nextSibling;
|
|
Node* _nextSibling;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Pointer to the Node's previous sibling.
|
|
* Pointer to the Node's previous sibling.
|
|
|
*/
|
|
*/
|
|
@@ -766,7 +766,7 @@ protected:
|
|
|
unsigned int _childCount;
|
|
unsigned int _childCount;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * If this node is visible. This may not be visiblein hierarchy if its parents are hidden
|
|
|
|
|
|
|
+ * If this node is visible. This may not be visible in hierarchy if its parents are hidden
|
|
|
*/
|
|
*/
|
|
|
bool _visible;
|
|
bool _visible;
|
|
|
|
|
|
|
@@ -782,7 +782,7 @@ protected:
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Pointer to the Light attached to the Node.
|
|
* Pointer to the Light attached to the Node.
|
|
|
- */
|
|
|
|
|
|
|
+ */
|
|
|
Light* _light;
|
|
Light* _light;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -799,22 +799,22 @@ protected:
|
|
|
* Pointer to the Form attached to the Node.
|
|
* Pointer to the Form attached to the Node.
|
|
|
*/
|
|
*/
|
|
|
Form* _form;
|
|
Form* _form;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Pointer to the AudioSource attached to the Node.
|
|
* Pointer to the AudioSource attached to the Node.
|
|
|
*/
|
|
*/
|
|
|
AudioSource* _audioSource;
|
|
AudioSource* _audioSource;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Pointer to the ParticleEmitter attached to the Node.
|
|
* Pointer to the ParticleEmitter attached to the Node.
|
|
|
*/
|
|
*/
|
|
|
ParticleEmitter* _particleEmitter;
|
|
ParticleEmitter* _particleEmitter;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Pointer to the PhysicsCollisionObject attached to the Node.
|
|
* Pointer to the PhysicsCollisionObject attached to the Node.
|
|
|
*/
|
|
*/
|
|
|
PhysicsCollisionObject* _collisionObject;
|
|
PhysicsCollisionObject* _collisionObject;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Pointer to the AI agent attached to the Node.
|
|
* Pointer to the AI agent attached to the Node.
|
|
|
*/
|
|
*/
|
|
@@ -829,10 +829,10 @@ protected:
|
|
|
* Dirty bits flag for the Node.
|
|
* Dirty bits flag for the Node.
|
|
|
*/
|
|
*/
|
|
|
mutable int _dirtyBits;
|
|
mutable int _dirtyBits;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* A flag indicating if the Node's hierarchy has changed.
|
|
* A flag indicating if the Node's hierarchy has changed.
|
|
|
- */
|
|
|
|
|
|
|
+ */
|
|
|
bool _notifyHierarchyChanged;
|
|
bool _notifyHierarchyChanged;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -848,7 +848,7 @@ protected:
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* NodeCloneContext represents the context data that is kept when cloning a node.
|
|
* NodeCloneContext represents the context data that is kept when cloning a node.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* The NodeCloneContext is used to make sure objects don't get cloned twice.
|
|
* The NodeCloneContext is used to make sure objects don't get cloned twice.
|
|
|
*/
|
|
*/
|
|
|
class NodeCloneContext
|
|
class NodeCloneContext
|
|
@@ -867,16 +867,16 @@ public:
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Finds the cloned animation of the given animation or NULL if this animation was not registered with this context.
|
|
* Finds the cloned animation of the given animation or NULL if this animation was not registered with this context.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @param animation The animation to search for the cloned copy of.
|
|
* @param animation The animation to search for the cloned copy of.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @return The cloned animation or NULL if not found.
|
|
* @return The cloned animation or NULL if not found.
|
|
|
*/
|
|
*/
|
|
|
Animation* findClonedAnimation(const Animation* animation);
|
|
Animation* findClonedAnimation(const Animation* animation);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Registers the cloned animation with this context so that it doesn't get cloned twice.
|
|
* Registers the cloned animation with this context so that it doesn't get cloned twice.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @param original The pointer to the original animation.
|
|
* @param original The pointer to the original animation.
|
|
|
* @param clone The pointer to the cloned animation.
|
|
* @param clone The pointer to the cloned animation.
|
|
|
*/
|
|
*/
|
|
@@ -884,23 +884,23 @@ public:
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Finds the cloned node of the given node or NULL if this node was not registered with this context.
|
|
* Finds the cloned node of the given node or NULL if this node was not registered with this context.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @param node The node to search for the cloned copy of.
|
|
* @param node The node to search for the cloned copy of.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @return The cloned node or NULL if not found.
|
|
* @return The cloned node or NULL if not found.
|
|
|
*/
|
|
*/
|
|
|
Node* findClonedNode(const Node* node);
|
|
Node* findClonedNode(const Node* node);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Registers the cloned node with this context so that it doens't get cloned twice.
|
|
* Registers the cloned node with this context so that it doens't get cloned twice.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* @param original The pointer to the original node.
|
|
* @param original The pointer to the original node.
|
|
|
* @param clone The pointer to the cloned node.
|
|
* @param clone The pointer to the cloned node.
|
|
|
*/
|
|
*/
|
|
|
void registerClonedNode(const Node* original, Node* clone);
|
|
void registerClonedNode(const Node* original, Node* clone);
|
|
|
|
|
|
|
|
private:
|
|
private:
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Hidden copy constructor.
|
|
* Hidden copy constructor.
|
|
|
*/
|
|
*/
|