DustyEngine::NodeGeneratorTask Class Reference

NodeGeneratorTask will create a new SceneNode in the Irrlicht scene using a list of meshes each time it is updated. More...

#include <dustynodegeneratortask.h>

Inheritance diagram for DustyEngine::NodeGeneratorTask:

DustyEngine::DummyTask DustyEngine::Task List of all members.

Public Member Functions

 NodeGeneratorTask ()
 ~NodeGeneratorTask ()
void SetPosition (irr::core::vector3df position)
void SetRange (irr::core::vector3df minimum, irr::core::vector3df maximum)
void SetParentNode (irr::scene::IAnimatedMeshSceneNode *n)
void AddMesh (irr::scene::IAnimatedMesh *m)
void RemoveMesh (irr::scene::IAnimatedMesh *m)
void ClearMeshes ()
 ClearMeshes clears all the meshes in the list of meshes.
irr::core::array< irr::scene::IAnimatedMesh * > * GetMeshes ()
irr::core::list< irr::scene::IAnimatedMeshSceneNode * > * GetNewNodes ()
void ClearNewNodes ()
 ClearNewNodes() clears the list of new nodes created by this task. The nodes still remain on the irrlicht scene.
void OnUpdate ()
 OnUpdate() is called by the TaskTree when the time has come to execute the task's code.

Protected Attributes

bool randomPosition
irr::scene::IAnimatedMeshSceneNode * parentNode
irr::core::list< irr::scene::IAnimatedMeshSceneNode * > createdNodes
irr::core::array< irr::scene::IAnimatedMesh * > meshes
irr::core::vector3df creationPosition
irr::core::vector3df creationRangeMax
irr::core::vector3df creationRangeMin

Detailed Description

NodeGeneratorTask will create a new SceneNode in the Irrlicht scene using a list of meshes each time it is updated.

NodeGeneratorTask has a list of meshes that it uses. These meshes are added using the AddMesh() method. It will choose at random a mesh to use when it creates the node. If only one mesh is supplied, it will use just that one mesh.

The nodes can be created at a specific point, or at a random position in a range of points.

If a specific point is supplied, then the generator will use that point. If a range is supplied, then it will choose points in the range. It automatically switches between a specific point and a range depending on which one was last set.

Generator nodes can be added as children of a specific parent node, as well.

Definition at line 23 of file dustynodegeneratortask.h.


Constructor & Destructor Documentation

DustyEngine::NodeGeneratorTask::NodeGeneratorTask  ) 
 

DustyEngine::NodeGeneratorTask::~NodeGeneratorTask  ) 
 


Member Function Documentation

void DustyEngine::NodeGeneratorTask::AddMesh irr::scene::IAnimatedMesh *  m  ) 
 

If more than one mesh is in the list, it chooses a mesh at random when it creates a node. If only one mesh exists in the list, it will use that mesh.

void DustyEngine::NodeGeneratorTask::ClearMeshes  ) 
 

ClearMeshes clears all the meshes in the list of meshes.

If no meshes are in the list when the task goes to add a node, it will not add a node.

void DustyEngine::NodeGeneratorTask::ClearNewNodes  )  [inline]
 

ClearNewNodes() clears the list of new nodes created by this task. The nodes still remain on the irrlicht scene.

You should clear the new nodes created by the task so nodes won't be used a second time when you change them outside of the task.

Definition at line 81 of file dustynodegeneratortask.h.

irr::core::array<irr::scene::IAnimatedMesh*>* DustyEngine::NodeGeneratorTask::GetMeshes  )  [inline]
 

GetMeshes() returns a pointer to list of meshes in the task.

Returns:
Returns a pointer to the mesh list.

Definition at line 64 of file dustynodegeneratortask.h.

irr::core::list<irr::scene::IAnimatedMeshSceneNode*>* DustyEngine::NodeGeneratorTask::GetNewNodes  )  [inline]
 

You should always clear the list of new nodes (using ClearNewNodes()) after you use the nodes that have been created.

Definition at line 73 of file dustynodegeneratortask.h.

void DustyEngine::NodeGeneratorTask::OnUpdate  )  [virtual]
 

OnUpdate() is called by the TaskTree when the time has come to execute the task's code.

OnUpdate is typically the most important function. OnUpdate is only called when enough time has passed or every frame, depending upon what the priority of the task is. If you want code to execute on a time-based basis, put that code here and add the task to the tree.

Reimplemented from DustyEngine::DummyTask.

void DustyEngine::NodeGeneratorTask::RemoveMesh irr::scene::IAnimatedMesh *  m  ) 
 

RemoveMesh removes a mesh from the list of meshes.

Parameters:
m,: The mesh to remove from the list.

void DustyEngine::NodeGeneratorTask::SetParentNode irr::scene::IAnimatedMeshSceneNode *  n  ) 
 

SetParentNode() sets the node which all nodes created should be a child of.

Parameters:
n,: The parent node for all nodes created.

void DustyEngine::NodeGeneratorTask::SetPosition irr::core::vector3df  position  ) 
 

If this function is called, then the task will be set to create nodes at a certain position instead of within a random range.

void DustyEngine::NodeGeneratorTask::SetRange irr::core::vector3df  minimum,
irr::core::vector3df  maximum
 

If this function is called, then the task will be set to create nodes within the range supplied. It will do so at random positions.


Member Data Documentation

irr::core::list<irr::scene::IAnimatedMeshSceneNode*> DustyEngine::NodeGeneratorTask::createdNodes [protected]
 

Definition at line 93 of file dustynodegeneratortask.h.

irr::core::vector3df DustyEngine::NodeGeneratorTask::creationPosition [protected]
 

Definition at line 96 of file dustynodegeneratortask.h.

irr::core::vector3df DustyEngine::NodeGeneratorTask::creationRangeMax [protected]
 

Definition at line 98 of file dustynodegeneratortask.h.

irr::core::vector3df DustyEngine::NodeGeneratorTask::creationRangeMin [protected]
 

Definition at line 99 of file dustynodegeneratortask.h.

irr::core::array<irr::scene::IAnimatedMesh*> DustyEngine::NodeGeneratorTask::meshes [protected]
 

Definition at line 95 of file dustynodegeneratortask.h.

irr::scene::IAnimatedMeshSceneNode* DustyEngine::NodeGeneratorTask::parentNode [protected]
 

Definition at line 91 of file dustynodegeneratortask.h.

bool DustyEngine::NodeGeneratorTask::randomPosition [protected]
 

Definition at line 89 of file dustynodegeneratortask.h.


The documentation for this class was generated from the following file:
Generated on Fri Jan 27 17:32:01 2006 for Dusty Engine by  doxygen 1.4.6-NO