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. | |
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 SceneComponent * | refFactory (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 |
Definition at line 26 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 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.
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 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.
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 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.
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 135 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 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.
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.
entity | Pointer to the entity. |
Definition at line 147 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 196 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 91 of file SceneComponent.cpp.
const vector3df SceneComponent::getPosition | ( | ) | const |
matrix4 SceneComponent::getRelativeTransformation | ( | ) | const |
Returns the relative transformation of the component.
Definition at line 208 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 85 of file SceneComponent.cpp.
ITriangleSelector * SceneComponent::getTriangleSelector | ( | ) | const |
Returns a direct pointer to the triangle selector of this component.
Definition at line 97 of file SceneComponent.cpp.
void SceneComponent::onPause | ( | void * | p | ) |
Pauses the component if the parent is paused.
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.
Definition at line 314 of file SceneComponent.cpp.
void SceneComponent::onUnPause | ( | void * | p | ) |
Unpauses the component if the parent is paused.
Definition at line 353 of file SceneComponent.cpp.
void SceneComponent::onUpdate | ( | void * | p | ) |
Updates the component if the parent is updated.
Definition at line 324 of file SceneComponent.cpp.
SceneComponent * SceneComponent::refFactory | ( | Entity * | parent | ) | [static] |
Will be used to instanciate objects of this class.
Reimplemented from EntityComponent.
Reimplemented in AnimatedMeshComponent, BillboardComponent, CameraComponent, LightComponent, MeshComponent, TerrainComponent, and TextBillboardComponent.
Definition at line 78 of file SceneComponent.cpp.
void SceneComponent::removeAnimators | ( | ) |
void SceneComponent::setAbsolutePosition | ( | const vector3df & | position | ) |
Sets the absolute position of the component.
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.
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.
value | Value to enable or disable this function. |
Definition at line 250 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 256 of file SceneComponent.cpp.
void SceneComponent::setMaterialFlag | ( | E_MATERIAL_FLAG | flag, | |
bool | value | |||
) |
Sets a material flag to a new value.
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.
layer | Layer of texture to be set. | |
texture | New texture to be used. |
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.
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.
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.
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.
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.
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.
value | If the node shall be visible. |
Definition at line 307 of file SceneComponent.cpp.
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.