SceneComponent Class Reference

Component wrapper of Irrlicht's ISceneNode and base class of various scene components. More...

Inheritance diagram for SceneComponent:

Inheritance graph
[legend]
Collaboration diagram for SceneComponent:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SceneComponent (Entity *parent)
 Constructor (default).
 ~SceneComponent ()
 Deconstructor.
ISceneNode * getSceneNode ()
 Returns a direct pointer to the ISceneNode.
IMetaTriangleSelector * getMetaSelector () const
 Returns a direct pointer to the meta selector of this component.
ITriangleSelector * getTriangleSelector () const
 Returns a direct pointer to the triangle selector of this component.
void addAnimator (ISceneNodeAnimator *animator)
 Adds an scene node animator to the component.
void addCollisionResponseAnimator (const vector3df &ellipsoidRadius=vector3df(30, 60, 30), const vector3df &gravityPerSecond=vector3df(0,-10, 0), const vector3df &ellipsoidTranslation=vector3df(0, 0, 0), f32 slidingValue=0.0005f)
 Adds a collision response animator to the component.
void addFlyCircleAnimator (const vector3df &center=vector3df(0, 0, 0), f32 radius=100, f32 speed=0.001f, const vector3df &direction=vector3df(0, 0, 0))
 Adds a fly circle animator to the component.
void addFlyStraightAnimator (const vector3df &startPoint, const vector3df &endPoint, u32 timeForWay, bool loop=false)
 Adds a fly straight animator to the component.
void addToMetaSelector (Entity *entity)
 Searches for a SceneComponent within the given entity and if found adds the triangle selector of that component to the meta selector of this component.
void addToMetaSelector (SceneComponent *component)
 Adds the triangle selector of the given component to the meta selector of this component.
void addToMetaSelector (ITriangleSelector *selector)
 Adds the given triangle selector to the meta selector of this component.
vector3df getAbsolutePosition () const
 Gets the abolute position of the component.
E_CULLING_TYPE getAutomaticCulling () const
 Gets the automatic culling state.
virtual const aabbox3df & getBoundingBox () const
 Get the axis aligned, not transformed bounding box of this component.
u32 getMaterialCount () const
 Get amount of materials used by this component.
matrix4 getRelativeTransformation () const
 Returns the relative transformation of the component.
const vector3df getPosition () const
 Gets the relative position of the component.
const vector3df & getRotation () const
 Gets the rotation of the component.
const vector3df & getScale () const
 Gets the scale of the component.
void removeAnimators ()
 Removes all animators from this component.
void setAbsolutePosition (const vector3df &position)
 Sets the absolute position of the component.
void setAutomaticCulling (E_CULLING_TYPE state)
 Enables or disables automatic culling based on the bounding box.
void setCanAffectParent (bool value)
 Sets whether the component can affect the parent entity. A direct effect of enabling this option is that the position of the parent entity and this component will always be synchronised.
void setDebugDataVisible (s32 state)
 Sets if debug data like bounding boxes should be drawn.
void setMaterialFlag (E_MATERIAL_FLAG flag, bool value)
 Sets a material flag to a new value.
void setMaterialTexture (u32 layer, const std::string &fileName)
 Loads and sets the texture of the specified layer in all materials of this component to the new texture.
void setMaterialTexture (u32 layer, ITexture *texture)
 Sets the texture of the specified layer in all materials of this component to the new texture.
void setMaterialType (E_MATERIAL_TYPE type)
 Sets the material type of all materials in this component to a new material type.
void setPosition (const vector3df &position)
 Sets the relative position of the component.
void setRotation (const vector3df &rotation)
 Sets the rotation of the component.
void setScale (const vector3df &scale)
 Sets the relative scale of the component.
void setVisible (bool value)
 Sets if the component should be visible or not.
void onPositionChange (void *p)
 Updates the position of the component after its parent has been updated.
void onUpdate (void *p)
 Updates the component if the parent is updated.
void onPause (void *p)
 Pauses the component if the parent is paused.
void onUnPause (void *p)
 Unpauses the component if the parent is paused.

Static Public Member Functions

static SceneComponentrefFactory (Entity *parent)
 Will be used to instanciate objects of this class.

Protected Member Functions

 SceneComponent (Entity *parent, bool isDerived)
 Constructor for derived classes.

Protected Attributes

ISceneNode * mSceneNode
IMetaTriangleSelector * mMetaSelector
ITriangleSelector * mTriSelector


Detailed Description

Component wrapper of Irrlicht's ISceneNode and base class of various scene components.

Definition at line 26 of file SceneComponent.h.


Constructor & Destructor Documentation

SceneComponent::SceneComponent ( Entity parent  ) 

Constructor (default).

Definition at line 23 of file SceneComponent.cpp.

SceneComponent::~SceneComponent (  ) 

Deconstructor.

Definition at line 70 of file SceneComponent.cpp.

SceneComponent::SceneComponent ( Entity parent,
bool  isDerived 
) [protected]

Constructor for derived classes.

Definition at line 55 of file SceneComponent.cpp.


Member Function Documentation

void SceneComponent::addAnimator ( ISceneNodeAnimator *  animator  ) 

Adds an scene node animator to the component.

Parameters:
animator Pointer to the animator which should be added.
Note:
Don't forget to call SceneComponent::setCanAffectParent when you use an animator.

Definition at line 103 of file SceneComponent.cpp.

void SceneComponent::addCollisionResponseAnimator ( const vector3df &  ellipsoidRadius = vector3df(30, 60, 30),
const vector3df &  gravityPerSecond = vector3df(0, -10, 0),
const vector3df &  ellipsoidTranslation = vector3df(0, 0, 0),
f32  slidingValue = 0.0005f 
)

Adds a collision response animator to the component.

Parameters:
ellipsoidRadius Radius of the ellipsoid with which collision detection and response is done.
gravityPerSecond Sets the gravity of the environment, as an acceleration in units per second per second.
ellipsoidTranslation By default, the ellipsoid for collision detection is created around the center of the component, which means that the ellipsoid surrounds it completely. If this is not what you want, you may specify a translation for the ellipsoid.
slidingValue Sets the sliding value.
Note:
Don't forget to call SceneComponent::setCanAffectParent when you use an animator.

Definition at line 109 of file SceneComponent.cpp.

void SceneComponent::addFlyCircleAnimator ( const vector3df &  center = vector3df(0, 0, 0),
f32  radius = 100,
f32  speed = 0.001f,
const vector3df &  direction = vector3df(0, 0, 0) 
)

Adds a fly circle animator to the component.

Parameters:
center Center of the circle.
radius Radius of the circle.
speed Specifies the speed of the flight.
direction Specifies the upvector used for alignment of the mesh.
Note:
Don't forget to call SceneComponent::setCanAffectParent when you use an animator.

Definition at line 124 of file SceneComponent.cpp.

void SceneComponent::addFlyStraightAnimator ( const vector3df &  startPoint,
const vector3df &  endPoint,
u32  timeForWay,
bool  loop = false 
)

Adds a fly straight animator to the component.

Parameters:
startPoint Start point of the line.
endPoint End point of the line.
timeForWay Time in milliseconds how long the component should need to move from the start point to the end point.
loop If set to false, the component stops when the end point is reached. If loop is true, the component begins again at the start.
Note:
Don't forget to call SceneComponent::setCanAffectParent when you use an animator.

Definition at line 135 of file SceneComponent.cpp.

void SceneComponent::addToMetaSelector ( ITriangleSelector *  selector  ) 

Adds the given triangle selector to the meta selector of this component.

Parameters:
selector Pointer to the triangle selector that should be added.
Note:
Not available in AngelScript.

Definition at line 177 of file SceneComponent.cpp.

void SceneComponent::addToMetaSelector ( SceneComponent component  ) 

Adds the triangle selector of the given component to the meta selector of this component.

Parameters:
component Pointer to the component.

Definition at line 165 of file SceneComponent.cpp.

void SceneComponent::addToMetaSelector ( Entity entity  ) 

Searches for a SceneComponent within the given entity and if found adds the triangle selector of that component to the meta selector of this component.

Parameters:
entity Pointer to the entity.

Definition at line 147 of file SceneComponent.cpp.

vector3df SceneComponent::getAbsolutePosition (  )  const

Gets the abolute position of the component.

Definition at line 184 of file SceneComponent.cpp.

E_CULLING_TYPE SceneComponent::getAutomaticCulling (  )  const

Gets the automatic culling state.

Definition at line 190 of file SceneComponent.cpp.

const aabbox3df & SceneComponent::getBoundingBox (  )  const [virtual]

Get the axis aligned, not transformed bounding box of this component.

Reimplemented in TerrainComponent.

Definition at line 196 of file SceneComponent.cpp.

u32 SceneComponent::getMaterialCount (  )  const

Get amount of materials used by this component.

Definition at line 202 of file SceneComponent.cpp.

IMetaTriangleSelector * SceneComponent::getMetaSelector (  )  const

Returns a direct pointer to the meta selector of this component.

Note:
Not available in AngelScript.

Definition at line 91 of file SceneComponent.cpp.

const vector3df SceneComponent::getPosition (  )  const

Gets the relative position of the component.

Definition at line 214 of file SceneComponent.cpp.

matrix4 SceneComponent::getRelativeTransformation (  )  const

Returns the relative transformation of the component.

Definition at line 208 of file SceneComponent.cpp.

const vector3df & SceneComponent::getRotation (  )  const

Gets the rotation of the component.

Definition at line 220 of file SceneComponent.cpp.

const vector3df & SceneComponent::getScale (  )  const

Gets the scale of the component.

Definition at line 226 of file SceneComponent.cpp.

ISceneNode * SceneComponent::getSceneNode (  ) 

Returns a direct pointer to the ISceneNode.

Note:
Not available in AngelScript.

Definition at line 85 of file SceneComponent.cpp.

ITriangleSelector * SceneComponent::getTriangleSelector (  )  const

Returns a direct pointer to the triangle selector of this component.

Note:
Not available in AngelScript.

Definition at line 97 of file SceneComponent.cpp.

void SceneComponent::onPause ( void *  p  ) 

Pauses the component if the parent is paused.

Note:
For internal use only!

Definition at line 343 of file SceneComponent.cpp.

void SceneComponent::onPositionChange ( void *  p  ) 

Updates the position of the component after its parent has been updated.

Note:
For internal use only!

Definition at line 314 of file SceneComponent.cpp.

void SceneComponent::onUnPause ( void *  p  ) 

Unpauses the component if the parent is paused.

Note:
For internal use only!

Definition at line 353 of file SceneComponent.cpp.

void SceneComponent::onUpdate ( void *  p  ) 

Updates the component if the parent is updated.

Note:
For internal use only!

Definition at line 324 of file SceneComponent.cpp.

SceneComponent * SceneComponent::refFactory ( Entity parent  )  [static]

Will be used to instanciate objects of this class.

Note:
For internal use only!

Reimplemented from EntityComponent.

Reimplemented in AnimatedMeshComponent, BillboardComponent, CameraComponent, LightComponent, MeshComponent, TerrainComponent, and TextBillboardComponent.

Definition at line 78 of file SceneComponent.cpp.

void SceneComponent::removeAnimators (  ) 

Removes all animators from this component.

Definition at line 232 of file SceneComponent.cpp.

void SceneComponent::setAbsolutePosition ( const vector3df &  position  ) 

Sets the absolute position of the component.

Parameters:
position New absolute position of the component.

Definition at line 238 of file SceneComponent.cpp.

void SceneComponent::setAutomaticCulling ( E_CULLING_TYPE  state  ) 

Enables or disables automatic culling based on the bounding box.

Parameters:
state The culling state to be used.

Definition at line 244 of file SceneComponent.cpp.

void SceneComponent::setCanAffectParent ( bool  value  ) 

Sets whether the component can affect the parent entity. A direct effect of enabling this option is that the position of the parent entity and this component will always be synchronised.

Parameters:
value Value to enable or disable this function.
Note:
It's recommended to enable this option when you're using animators.

Definition at line 250 of file SceneComponent.cpp.

void SceneComponent::setDebugDataVisible ( s32  state  ) 

Sets if debug data like bounding boxes should be drawn.

Parameters:
state The debug data visibility state to be used.

Definition at line 256 of file SceneComponent.cpp.

void SceneComponent::setMaterialFlag ( E_MATERIAL_FLAG  flag,
bool  value 
)

Sets a material flag to a new value.

Parameters:
flag Which flag of all materials to be set.
value New value of that flag.

Definition at line 262 of file SceneComponent.cpp.

void SceneComponent::setMaterialTexture ( u32  layer,
ITexture *  texture 
)

Sets the texture of the specified layer in all materials of this component to the new texture.

Parameters:
layer Layer of texture to be set.
texture New texture to be used.
Note:
Not available in AngelScript.

Definition at line 277 of file SceneComponent.cpp.

void SceneComponent::setMaterialTexture ( u32  layer,
const std::string &  fileName 
)

Loads and sets the texture of the specified layer in all materials of this component to the new texture.

Parameters:
layer Layer of texture to be set.
fileName Filename of the texture to load.

Definition at line 269 of file SceneComponent.cpp.

void SceneComponent::setMaterialType ( E_MATERIAL_TYPE  type  ) 

Sets the material type of all materials in this component to a new material type.

Parameters:
type New type of material to be set.

Definition at line 283 of file SceneComponent.cpp.

void SceneComponent::setPosition ( const vector3df &  position  ) 

Sets the relative position of the component.

Parameters:
position New relative postition of the component.

Definition at line 289 of file SceneComponent.cpp.

void SceneComponent::setRotation ( const vector3df &  rotation  ) 

Sets the rotation of the component.

Parameters:
rotation New rotation of the component in degrees.

Reimplemented in CameraComponent.

Definition at line 295 of file SceneComponent.cpp.

void SceneComponent::setScale ( const vector3df &  scale  ) 

Sets the relative scale of the component.

Parameters:
scale New scale of the node

Definition at line 301 of file SceneComponent.cpp.

void SceneComponent::setVisible ( bool  value  ) 

Sets if the component should be visible or not.

Parameters:
value If the node shall be visible.

Definition at line 307 of file SceneComponent.cpp.


Member Data Documentation

IMetaTriangleSelector* SceneComponent::mMetaSelector [protected]

Definition at line 194 of file SceneComponent.h.

ISceneNode* SceneComponent::mSceneNode [protected]

Definition at line 193 of file SceneComponent.h.

ITriangleSelector* SceneComponent::mTriSelector [protected]

Definition at line 195 of file SceneComponent.h.


The documentation for this class was generated from the following files:

Generated on Wed Jun 10 22:26:26 2009 for Sirrf - Simple Irrlicht Framework by  doxygen 1.5.8