dtCore::Scene Class Reference

Scene: This class encapsulates the root of the delta scene graph. More...

#include <scene.h>

Inheritance diagram for dtCore::Scene:

dtCore::Base

List of all members.

Public Types

enum  Mode { POINT = GL_POINT, LINE = GL_LINE, FILL = GL_FILL }
enum  Face { FRONT, BACK, FRONT_AND_BACK }

Public Member Functions

 Scene (const std::string &name="scene")
osg::Group * GetSceneNode ()
 Get a pointer to the internal scene node.
void SetSceneNode (osg::Group *newSceneNode)
void AddDrawable (DeltaDrawable *drawable)
 Add a DeltaDrawable to the Scene to be viewed.
void RemoveDrawable (DeltaDrawable *drawable)
 Remove a DeltaDrawable from the Scene.
void RemoveAllDrawables ()
 clears the scene.
DeltaDrawableGetDrawable (unsigned int i)
 Get a handle to the DeltaDrawable with the supplied index number.
void SetRenderState (Face face, Mode mode)
const std::pair< Face, ModeGetRenderState () const
float GetHeightOfTerrain (float x, float y)
 Get the height of terrain at a given x,y.
dSpaceID GetSpaceID () const
 Get the ODE space ID.
dWorldID GetWorldID () const
 Get the ODE world ID.
dJointGroupID GetContactJoinGroupID () const
 Get the ODE contact join group ID.
void SetGravity (const osg::Vec3 &gravity)
 Set the gravity vector.
void SetGravity (float x, float y, float z)
 Set the gravity vector.
void GetGravity (osg::Vec3 &vec) const
 Get the gravity vector.
osg::Vec3 GetGravity () const
 Get the gravity vector.
void GetGravity (float &x, float &y, float &z) const
 Get the gravity vector.
virtual void OnMessage (MessageData *data)
 Performs collision detection and updates physics.
void SetUserCollisionCallback (dNearCallback *func, void *data=0)
 Supply a user-defined collision callback to replace the internal one.
double GetPhysicsStepSize () const
 Get the step size of the physics.
void SetPhysicsStepSize (double stepSize=0.0)
 
See also:
GetPhysicsStepSize()

void RegisterCollidable (Transformable *collidable)
 Register a Transformable with the Scene.
void UnRegisterCollidable (Transformable *collidable)
 UnRegister a Transformable with the Scene.
LightGetLight (const int number)
 Returns a pointer to the light specified by the param number.
const LightGetLight (const int number) const
LightGetLight (const std::string &name)
 Returns a pointer to the light specified by the current string.
const LightGetLight (const std::string &name) const
void RegisterLight (Light *light)
 Registers a light using the light number.
void UnRegisterLight (Light *light)
 Unreferences the current light, by number, Note: does not erase.
void UseSceneLight (bool lightState=true)
 Use the internal scene light.
unsigned int GetDrawableIndex (const DeltaDrawable *drawable) const
 Get the index number of the supplied drawable.
unsigned int GetNumberOfAddedDrawable () const
 Get the number of Drawables which have been directly added to the Scene.
void EnablePaging ()
 Enables paging when called ONLY AFTER a page-able node has been added to the scene.
void DisablePaging ()
 Disables Paging, after enabled called on scene cleanup.
bool IsPagingEnabled () const
 Returns if paging is enabled.
void SetPagingCleanup (double pCleanup)
 Set's Slice time allocated for scene cleanup default 0.0025.
double GetPagingCleanup ()
 Get the cleanup time for paging.

Protected Member Functions

virtual ~Scene ()
void RemoveView (dtCore::View *view)
 define the owner mView of this instance
void AddView (dtCore::View *view)

Friends

class View

Classes

struct  CollisionData
 The user data associated with "collision" messages. More...
class  ParticleSystemFreezer


Detailed Description

Scene: This class encapsulates the root of the delta scene graph.

Member Enumeration Documentation

enum dtCore::Scene::Mode

Enumerator:
POINT 
LINE 
FILL 

enum dtCore::Scene::Face

Enumerator:
FRONT 
BACK 
FRONT_AND_BACK 


Constructor & Destructor Documentation

dtCore::Scene::Scene ( const std::string &  name = "scene"  ) 

dtCore::Scene::~Scene (  )  [protected, virtual]


Member Function Documentation

osg::Group* dtCore::Scene::GetSceneNode (  )  [inline]

Get a pointer to the internal scene node.

void dtCore::Scene::SetSceneNode ( osg::Group *  newSceneNode  ) 

void dtCore::Scene::AddDrawable ( DeltaDrawable drawable  ) 

Add a DeltaDrawable to the Scene to be viewed.

void dtCore::Scene::RemoveDrawable ( DeltaDrawable drawable  ) 

Remove a DeltaDrawable from the Scene.

void dtCore::Scene::RemoveAllDrawables (  ) 

clears the scene.

DeltaDrawable* dtCore::Scene::GetDrawable ( unsigned int  i  )  [inline]

Get a handle to the DeltaDrawable with the supplied index number.

void dtCore::Scene::SetRenderState ( Face  face,
Mode  mode 
)

const std::pair<Face,Mode> dtCore::Scene::GetRenderState (  )  const [inline]

float dtCore::Scene::GetHeightOfTerrain ( float  x,
float  y 
)

Get the height of terrain at a given x,y.

Get the height of terrain at the specified (X,Y). This essentially does an intersection check of the whole scene from (X,Y,10k) to (X,Y,-10k). Any geometry that intersects is considered the "terrain".

Parameters:
x : The X location to check for HOT
y : The Y location to check for HOT
Returns:
float : The found Height of Terrain (or 0 if no intersection)

dSpaceID dtCore::Scene::GetSpaceID (  )  const

Get the ODE space ID.

dWorldID dtCore::Scene::GetWorldID (  )  const

Get the ODE world ID.

dJointGroupID dtCore::Scene::GetContactJoinGroupID (  )  const

Get the ODE contact join group ID.

void dtCore::Scene::SetGravity ( const osg::Vec3 &  gravity  ) 

Set the gravity vector.

void dtCore::Scene::SetGravity ( float  x,
float  y,
float  z 
) [inline]

Set the gravity vector.

void dtCore::Scene::GetGravity ( osg::Vec3 &  vec  )  const [inline]

Get the gravity vector.

osg::Vec3 dtCore::Scene::GetGravity (  )  const [inline]

Get the gravity vector.

void dtCore::Scene::GetGravity ( float &  x,
float &  y,
float &  z 
) const [inline]

Get the gravity vector.

void dtCore::Scene::OnMessage ( MessageData data  )  [virtual]

Performs collision detection and updates physics.

Reimplemented from dtCore::Base.

void dtCore::Scene::SetUserCollisionCallback ( dNearCallback *  func,
void *  data = 0 
)

Supply a user-defined collision callback to replace the internal one.

The supplied function will be used instead of the built-in collision callback.

Parameters:
func : The function to handle collision detection
data : A void pointer to user data. This gets passed directly to func.

double dtCore::Scene::GetPhysicsStepSize (  )  const [inline]

Get the step size of the physics.

The physics will be updated numerous times per frame based on this number. For example, if the delta frame rate is 33ms and the step size is 2ms, the physics will be updated 16 times.

Returns:
the step size in seconds
See also:
SetPhysicsStepSize()

void dtCore::Scene::SetPhysicsStepSize ( double  stepSize = 0.0  )  [inline]

See also:
GetPhysicsStepSize()

void dtCore::Scene::RegisterCollidable ( Transformable collidable  ) 

Register a Transformable with the Scene.

void dtCore::Scene::UnRegisterCollidable ( Transformable collidable  ) 

UnRegister a Transformable with the Scene.

Light* dtCore::Scene::GetLight ( const int  number  )  [inline]

Returns a pointer to the light specified by the param number.

const Light* dtCore::Scene::GetLight ( const int  number  )  const [inline]

Light * dtCore::Scene::GetLight ( const std::string &  name  ) 

Returns a pointer to the light specified by the current string.

const Light * dtCore::Scene::GetLight ( const std::string &  name  )  const

void dtCore::Scene::RegisterLight ( Light light  ) 

Registers a light using the light number.

registers a light using the light number

void dtCore::Scene::UnRegisterLight ( Light light  ) 

Unreferences the current light, by number, Note: does not erase.

unreferences the current light, by number, Note: does not erase

void dtCore::Scene::UseSceneLight ( bool  lightState = true  ) 

Use the internal scene light.

unsigned int dtCore::Scene::GetDrawableIndex ( const DeltaDrawable drawable  )  const

Get the index number of the supplied drawable.

unsigned int dtCore::Scene::GetNumberOfAddedDrawable (  )  const [inline]

Get the number of Drawables which have been directly added to the Scene.

void dtCore::Scene::EnablePaging (  )  [inline]

Enables paging when called ONLY AFTER a page-able node has been added to the scene.

Note:
all settings must be made before this call

void dtCore::Scene::DisablePaging (  )  [inline]

Disables Paging, after enabled called on scene cleanup.

bool dtCore::Scene::IsPagingEnabled (  )  const [inline]

Returns if paging is enabled.

void dtCore::Scene::SetPagingCleanup ( double  pCleanup  )  [inline]

Set's Slice time allocated for scene cleanup default 0.0025.

Parameters:
allocated cleanup time in seconds

double dtCore::Scene::GetPagingCleanup (  )  [inline]

Get the cleanup time for paging.

void dtCore::Scene::RemoveView ( dtCore::View view  )  [inline, protected]

define the owner mView of this instance

void dtCore::Scene::AddView ( dtCore::View view  )  [inline, protected]


Friends And Related Function Documentation

friend class View [friend]


http://www.delta3d.org
2.0.0 generated 14 Feb 2008