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 ¢er=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. | |
virtual 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 | onRotationChange (void *p) |
Updates the rotation 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. | |
void | onTexture (void *p) |
Responds to changes of a texture attached to this component. | |
Static Public Member Functions | |
static bool | parseXML (IXMLReader *file, Entity *entity) |
Parses for a SceneComponent. | |
static void | parseBaseXML (IXMLReader *file, SceneComponent *component) |
Parses for the base elements of a SceneComponent. | |
Protected Member Functions | |
SceneComponent (Entity *parent, bool isDerived) | |
Constructor for derived classes. | |
Protected Attributes | |
ISceneNode * | mSceneNode |
IMetaTriangleSelector * | mMetaSelector |
ITriangleSelector * | mTriSelector |
XML:
<SceneComponent> <!-- Properties --> </SceneComponent>
Definition at line 33 of file SceneComponent.h.
SceneComponent::SceneComponent | ( | Entity * | parent | ) |
SceneComponent::~SceneComponent | ( | ) |
SceneComponent::SceneComponent | ( | Entity * | parent, | |
bool | isDerived | |||
) | [protected] |
void SceneComponent::addAnimator | ( | ISceneNodeAnimator * | animator | ) |
Adds an scene node animator to the component.
animator | Pointer to the animator which should be added. |
Definition at line 90 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.
XML:
<CollisionResponseAnimator> <ellipsoidRadius x="" y="" z="" /> <gravityPerSecond x="" y="" z="" /> <ellipsoidTranslation x="" y="" z="" /> <slidingValue value="" /> </CollisionResponseAnimator>
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. |
Definition at line 96 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.
XML:
<FlyCircleAnimator> <center x="" y="" z="" /> <radius value="" /> <speed value="" /> <direction x="" y="" z="" /> </FlyCircleAnimator>
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. |
Definition at line 111 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.
XML:
<FlyStraightAnimator> <startPoint x="" y="" z="" /> <endPoint x="" y="" z="" /> <timeForWay value="" /> <loop value="" /> </FlyStraightAnimator>
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. |
Definition at line 122 of file SceneComponent.cpp.
void SceneComponent::addToMetaSelector | ( | ITriangleSelector * | selector | ) |
Adds the given triangle selector to the meta selector of this component.
selector | Pointer to the triangle selector that should be added. |
Definition at line 164 of file SceneComponent.cpp.
void SceneComponent::addToMetaSelector | ( | SceneComponent * | component | ) |
Adds the triangle selector of the given component to the meta selector of this component.
component | Pointer to the component. |
Definition at line 152 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.
entity | Pointer to the entity. |
Definition at line 134 of file SceneComponent.cpp.
vector3df SceneComponent::getAbsolutePosition | ( | ) | const |
E_CULLING_TYPE SceneComponent::getAutomaticCulling | ( | ) | const |
const aabbox3df & SceneComponent::getBoundingBox | ( | ) | const [virtual] |
Get the axis aligned, not transformed bounding box of this component.
Reimplemented in TerrainComponent.
Definition at line 183 of file SceneComponent.cpp.
u32 SceneComponent::getMaterialCount | ( | ) | const |
IMetaTriangleSelector * SceneComponent::getMetaSelector | ( | ) | const |
Returns a direct pointer to the meta selector of this component.
Definition at line 78 of file SceneComponent.cpp.
const vector3df SceneComponent::getPosition | ( | ) | const |
matrix4 SceneComponent::getRelativeTransformation | ( | ) | const |
Returns the relative transformation of the component.
Definition at line 195 of file SceneComponent.cpp.
const vector3df & SceneComponent::getRotation | ( | ) | const |
const vector3df & SceneComponent::getScale | ( | ) | const |
ISceneNode * SceneComponent::getSceneNode | ( | ) |
Returns a direct pointer to the ISceneNode.
Definition at line 72 of file SceneComponent.cpp.
ITriangleSelector * SceneComponent::getTriangleSelector | ( | ) | const |
Returns a direct pointer to the triangle selector of this component.
Definition at line 84 of file SceneComponent.cpp.
void SceneComponent::onPause | ( | void * | p | ) |
Pauses the component if the parent is paused.
Definition at line 395 of file SceneComponent.cpp.
void SceneComponent::onPositionChange | ( | void * | p | ) |
Updates the position of the component after its parent has been updated.
Definition at line 344 of file SceneComponent.cpp.
void SceneComponent::onRotationChange | ( | void * | p | ) |
Updates the rotation of the component after its parent has been updated.
Definition at line 354 of file SceneComponent.cpp.
void SceneComponent::onTexture | ( | void * | p | ) |
Responds to changes of a texture attached to this component.
Definition at line 412 of file SceneComponent.cpp.
void SceneComponent::onUnPause | ( | void * | p | ) |
Unpauses the component if the parent is paused.
Definition at line 405 of file SceneComponent.cpp.
void SceneComponent::onUpdate | ( | void * | p | ) |
Updates the component if the parent is updated.
Definition at line 364 of file SceneComponent.cpp.
void SceneComponent::parseBaseXML | ( | IXMLReader * | file, | |
SceneComponent * | component | |||
) | [static] |
Parses for the base elements of a SceneComponent.
Definition at line 491 of file SceneComponent.cpp.
bool SceneComponent::parseXML | ( | IXMLReader * | file, | |
Entity * | entity | |||
) | [static] |
Parses for a SceneComponent.
Reimplemented in AnimatedMeshComponent, BillboardComponent, CameraComponent, LightComponent, MeshComponent, OctTreeComponent, ParticleSysComponent, SkyBoxComponent, SkyDomeComponent, TerrainComponent, and TextBillboardComponent.
Definition at line 441 of file SceneComponent.cpp.
void SceneComponent::removeAnimators | ( | ) |
void SceneComponent::setAbsolutePosition | ( | const vector3df & | position | ) |
Sets the absolute position of the component.
XML:
<absolutePosition value="" />
position | New absolute position of the component. |
Definition at line 225 of file SceneComponent.cpp.
void SceneComponent::setAutomaticCulling | ( | E_CULLING_TYPE | state | ) |
Enables or disables automatic culling based on the bounding box.
XML:
<automaticCulling value="" />
state | The culling state to be used. |
Definition at line 231 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.
XML:
<canAffectParent value="" />
value | Value to enable or disable this function. |
Definition at line 237 of file SceneComponent.cpp.
void SceneComponent::setDebugDataVisible | ( | s32 | state | ) |
Sets if debug data like bounding boxes should be drawn.
state | The debug data visibility state to be used. |
Definition at line 243 of file SceneComponent.cpp.
void SceneComponent::setMaterialFlag | ( | E_MATERIAL_FLAG | flag, | |
bool | value | |||
) |
Sets a material flag to a new value.
XML:
<materialFlag flag="" value="" />
flag | Which flag of all materials to be set. | |
value | New value of that flag. |
Definition at line 249 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.
layer | Layer of texture to be set. | |
texture | New texture to be used. |
Definition at line 292 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.
XML:
<materialTexture layer="" fileName="" />
layer | Layer of texture to be set. | |
fileName | Filename of the texture to load. |
Definition at line 256 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.
XML:
<materialType value="" />
type | New type of material to be set. |
Definition at line 313 of file SceneComponent.cpp.
void SceneComponent::setPosition | ( | const vector3df & | position | ) |
Sets the relative position of the component.
XML:
<position x="" y="" z="" />
position | New relative postition of the component. |
Definition at line 319 of file SceneComponent.cpp.
void SceneComponent::setRotation | ( | const vector3df & | rotation | ) | [virtual] |
Sets the rotation of the component.
XML:
<rotation x="" y="" z="" />
rotation | New rotation of the component in degrees. |
Reimplemented in CameraComponent.
Definition at line 325 of file SceneComponent.cpp.
void SceneComponent::setScale | ( | const vector3df & | scale | ) |
Sets the relative scale of the component.
XML:
<scale x="" y="" z="" />
scale | New scale of the node |
Definition at line 331 of file SceneComponent.cpp.
void SceneComponent::setVisible | ( | bool | value | ) |
Sets if the component should be visible or not.
XML:
<visible value="" />
value | If the node shall be visible. |
Definition at line 337 of file SceneComponent.cpp.
IMetaTriangleSelector* SceneComponent::mMetaSelector [protected] |
Definition at line 303 of file SceneComponent.h.
ISceneNode* SceneComponent::mSceneNode [protected] |
Definition at line 302 of file SceneComponent.h.
ITriangleSelector* SceneComponent::mTriSelector [protected] |
Definition at line 304 of file SceneComponent.h.