5#ifndef __I_SCENE_NODE_H_INCLUDED__
6#define __I_SCENE_NODE_H_INCLUDED__
8#include "IAttributeExchangingObject.h"
9#include "ESceneNodeTypes.h"
10#include "ECullingTypes.h"
11#include "EDebugSceneTypes.h"
12#include "ISceneNodeAnimator.h"
13#include "ITriangleSelector.h"
19#include "IAttributes.h"
68 ISceneNodeAnimatorList::Iterator ait =
Animators.begin();
96 for (; it != end; ++it)
105 virtual void CheckCount(
int &count)
110 for (; it != end; ++it)
112 (*it)->CheckCount(count);
124 if (
IsVisible && IsStaticObject ==
false)
145 for (; it != itEnd; ++it)
148 if (node->
IsVisible ==
true && node->IsStaticObject ==
false)
246 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
255 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
262 return Parent->isTrulyVisible();
277 virtual void setStaticNode(
bool s)
282 virtual bool isStaticNode()
284 return IsStaticObject;
311 if (child && (child !=
this))
333 ISceneNodeList::Iterator it =
Children.begin();
343 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
354 ISceneNodeList::Iterator it =
Children.begin();
371 Parent->removeChild(
this);
401 ISceneNodeAnimatorList::Iterator it =
Animators.begin();
404 if ((*it) == animator)
419 ISceneNodeAnimatorList::Iterator it =
Animators.begin();
610 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
720 out->addString (
"Name",
Name.c_str());
721 out->addInt (
"Id",
ID );
725 out->addVector3d(
"Scale",
getScale() );
809 (*it)->clone(
this, newManager);
813 ISceneNodeAnimatorList::Iterator ait = toCopyFrom->
Animators.
begin();
831 ISceneNodeList::Iterator it =
Children.begin();
833 (*it)->setSceneManager(newManager);
bool drop() const
Drops the object. Decrements the reference counter by one.
Definition IReferenceCounted.h:126
void grab() const
Grabs the object. Increments the reference counter by one.
Definition IReferenceCounted.h:96
CMatrix4< T > & setScale(const vector3d< T > &scale)
Set Scale.
Definition matrix4.h:778
CMatrix4< T > & setRotationDegrees(const vector3d< T > &rotation)
Make a rotation matrix from Euler angles. The 4th row and column are unmodified.
Definition matrix4.h:816
CMatrix4< T > & setTranslation(const vector3d< T > &translation)
Set the translation of the current matrix. Will erase any previous values.
Definition matrix4.h:754
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.h:22
Doubly linked list template.
Definition irrList.h:21
Iterator end()
Gets end node.
Definition irrList.h:273
Iterator begin()
Gets first node.
Definition irrList.h:257
An object which is able to serialize and deserialize its attributes into an attributes object.
Definition IAttributeExchangingObject.h:52
Provides a generic interface for attributes and their values and the possiblity to serialize them.
Definition IAttributes.h:42
virtual s32 getAttributeAsInt(const c8 *attributeName, irr::s32 defaultNotFound=0) const =0
virtual core::vector3df getAttributeAsVector3d(const c8 *attributeName, const core::vector3df &defaultNotFound=core::vector3df(0, 0, 0))=0
virtual core::stringc getAttributeAsString(const c8 *attributeName, const core::stringc &defaultNotFound=core::stringc())=0
virtual bool getAttributeAsBool(const c8 *attributeName, bool defaultNotFound=false)=0
virtual const c8 * getAttributeAsEnumeration(const c8 *attributeName, const c8 *defaultNotFound=0)=0
The Scene Manager manages scene nodes, mesh recources, cameras and all the other stuff.
Definition ISceneManager.h:135
Animates a scene node. Can animate position, rotation, material, and so on.
Definition ISceneNodeAnimator.h:31
virtual ISceneNodeAnimator * createClone(ISceneNode *node, ISceneManager *newManager=0)=0
Creates a clone of this animator.
virtual void animateNode(ISceneNode *node, u32 timeMs)=0
Animates a scene node.
Scene node interface.
Definition ISceneNode.h:41
s32 ID
ID of the node.
Definition ISceneNode.h:867
void cloneMembers(ISceneNode *toCopyFrom, ISceneManager *newManager)
A clone function for the ISceneNode members.
Definition ISceneNode.h:786
ISceneManager * SceneManager
Pointer to the scene manager.
Definition ISceneNode.h:861
u32 getAutomaticCulling() const
Gets the automatic culling state.
Definition ISceneNode.h:571
u32 AutomaticCullingState
Automatic culling state.
Definition ISceneNode.h:870
virtual core::vector3df getAbsolutePosition() const
Gets the absolute position of the node in world coordinates.
Definition ISceneNode.h:551
void setMaterialTexture(u32 textureLayer, video::ITexture *texture)
Sets the texture of the specified layer in all materials of this scene node to the new texture.
Definition ISceneNode.h:465
virtual void addAnimator(ISceneNodeAnimator *animator)
Adds an animator which should animate this node.
Definition ISceneNode.h:377
ISceneNode * Parent
Pointer to the parent.
Definition ISceneNode.h:852
virtual s32 getID() const
Get the id of the scene node.
Definition ISceneNode.h:290
const core::list< ISceneNode * > & getChildren() const
Returns a const reference to the list of all children.
Definition ISceneNode.h:617
core::list< ISceneNode * > Children
List of all children of this node.
Definition ISceneNode.h:855
virtual void setScale(const core::vector3df &scale)
Sets the relative scale of the scene node.
Definition ISceneNode.h:497
core::vector3df RelativeTranslation
Relative translation of the scene node.
Definition ISceneNode.h:843
virtual const core::matrix4 & getAbsoluteTransformation() const
Get the absolute transformation of the node. Is recalculated every OnAnimate()-call.
Definition ISceneNode.h:211
virtual void setName(const core::stringc &name)
Sets the name of the node.
Definition ISceneNode.h:177
virtual void setPosition(const core::vector3df &newpos)
Sets the position of the node relative to its parent.
Definition ISceneNode.h:536
u32 DebugDataVisible
Flag if debug data should be drawn, such as Bounding Boxes.
Definition ISceneNode.h:873
core::stringc Name
Name of the scene node.
Definition ISceneNode.h:837
virtual const core::vector3df & getScale() const
Gets the scale of the scene node relative to its parent.
Definition ISceneNode.h:489
void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue)
Sets all material flags at once to a new value.
Definition ISceneNode.h:454
virtual void removeAnimators()
Removes all animators from this scene node.
Definition ISceneNode.h:417
scene::ISceneNode * getParent() const
Returns the parent of this scene node.
Definition ISceneNode.h:695
virtual void setVisible(bool isVisible)
Sets if the node should be visible or not.
Definition ISceneNode.h:270
virtual void remove()
Removes this scene node from the scene.
Definition ISceneNode.h:368
bool isDebugObject() const
Returns if this scene node is a debug object.
Definition ISceneNode.h:608
virtual ~ISceneNode()
Destructor.
Definition ISceneNode.h:62
virtual void serializeAttributes(io::IAttributes *out, io::SAttributeReadWriteOptions *options=0) const
Writes attributes of the scene node.
Definition ISceneNode.h:716
virtual const c8 * getName() const
Returns the name of the node.
Definition ISceneNode.h:161
virtual ESCENE_NODE_TYPE getType() const
Returns type of the scene node.
Definition ISceneNode.h:703
virtual void removeAll()
Removes all children of this scene node.
Definition ISceneNode.h:352
virtual bool isTrulyVisible() const
Check whether the node is truly visible, taking into accounts its parents' visibility.
Definition ISceneNode.h:253
void setSceneManager(ISceneManager *newManager)
Definition ISceneNode.h:827
virtual void setParent(ISceneNode *newParent)
Changes the parent of the scene node.
Definition ISceneNode.h:625
virtual const core::aabbox3d< f32 > getTransformedBoundingBox() const
Get the axis aligned, transformed and animated absolute bounding box of this node.
Definition ISceneNode.h:196
virtual void deserializeAttributes(io::IAttributes *in, io::SAttributeReadWriteOptions *options=0)
Reads attributes of the scene node.
Definition ISceneNode.h:741
void setAutomaticCulling(u32 state)
Enables or disables automatic culling based on the bounding box.
Definition ISceneNode.h:563
virtual ISceneManager * getSceneManager(void) const
Retrieve the scene manager for this node.
Definition ISceneNode.h:777
core::vector3df RelativeScale
Relative scale of the scene node.
Definition ISceneNode.h:849
void setIsDebugObject(bool debugObject)
Sets if this scene node is a debug object.
Definition ISceneNode.h:598
core::list< ISceneNodeAnimator * > Animators
List of all animator nodes.
Definition ISceneNode.h:858
virtual void setName(const c8 *name)
Sets the name of the node.
Definition ISceneNode.h:169
virtual bool removeChild(ISceneNode *child)
Removes a child from this scene node.
Definition ISceneNode.h:331
core::vector3df RelativeRotation
Relative rotation of the scene node.
Definition ISceneNode.h:846
virtual void setTriangleSelector(ITriangleSelector *selector)
Sets the triangle selector of the scene node.
Definition ISceneNode.h:664
virtual u32 getMaterialCount() const
Get amount of materials used by this scene node.
Definition ISceneNode.h:443
bool IsDebugObject
Is debug object?
Definition ISceneNode.h:882
virtual const core::aabbox3d< f32 > & getBoundingBox() const =0
Get the axis aligned, not transformed bounding box of this node.
ISceneNode(ISceneNode *parent, ISceneManager *mgr, s32 id=-1, const core::vector3df &position=core::vector3df(0, 0, 0), const core::vector3df &rotation=core::vector3df(0, 0, 0), const core::vector3df &scale=core::vector3df(1.0f, 1.0f, 1.0f))
Constructor.
Definition ISceneNode.h:45
virtual bool isVisible() const
Returns whether the node should be visible (if all of its parents are visible).
Definition ISceneNode.h:244
virtual video::SMaterial & getMaterial(u32 num)
Returns the material based on the zero based index i.
Definition ISceneNode.h:435
bool IsVisible
Is the node visible?
Definition ISceneNode.h:876
virtual void removeAnimator(ISceneNodeAnimator *animator)
Removes an animator from this scene node.
Definition ISceneNode.h:399
core::matrix4 AbsoluteTransformation
Absolute transformation of the node.
Definition ISceneNode.h:840
virtual core::matrix4 getRelativeTransformation() const
Returns the relative transformation of the scene node.
Definition ISceneNode.h:222
virtual void OnRegisterSceneNode()
This method is called just before the rendering process of the whole scene.
Definition ISceneNode.h:91
virtual const core::vector3df & getPosition() const
Gets the position of the node relative to its parent.
Definition ISceneNode.h:527
virtual void addChild(ISceneNode *child)
Adds a child to this scene node.
Definition ISceneNode.h:309
u32 isDebugDataVisible() const
Returns if debug data like bounding boxes are drawn.
Definition ISceneNode.h:589
const core::list< ISceneNodeAnimator * > & getAnimators() const
Get a list of all scene node animators.
Definition ISceneNode.h:389
ITriangleSelector * TriangleSelector
Pointer to the triangle selector.
Definition ISceneNode.h:864
virtual ITriangleSelector * getTriangleSelector() const
Returns the triangle selector attached to this scene node.
Definition ISceneNode.h:649
void setMaterialType(s32 newType)
Sets the material type of all materials in this scene node to a new material type.
Definition ISceneNode.h:477
virtual void setDebugDataVisible(u32 state)
Sets if debug data like bounding boxes should be drawn.
Definition ISceneNode.h:581
virtual ISceneNode * clone(ISceneNode *newParent=0, ISceneManager *newManager=0)
Creates a clone of this scene node and its children.
Definition ISceneNode.h:770
virtual void setRotation(const core::vector3df &rotation)
Sets the rotation of the node relative to its parent.
Definition ISceneNode.h:517
virtual const core::vector3df & getRotation() const
Gets the rotation of the node relative to its parent.
Definition ISceneNode.h:508
virtual void setID(s32 id)
Sets the id of the scene node.
Definition ISceneNode.h:299
virtual void updateAbsolutePosition()
Updates the absolute position based on the relative and the parents position.
Definition ISceneNode.h:681
virtual void OnAnimate(u32 timeMs)
OnAnimate() is called just before rendering the whole scene.
Definition ISceneNode.h:122
virtual void render()=0
Renders the node.
Interface to return triangles with specific properties.
Definition ITriangleSelector.h:29
Interface of a Video Driver dependent Texture.
Definition ITexture.h:119
Struct for holding parameters for a material renderer.
Definition SMaterial.h:255
s32 MaterialType
Type of the material. Specifies how everything is blended together.
Definition SMaterial.h:333
void setTexture(u32 i, ITexture *tex)
Sets the i-th texture.
Definition SMaterial.h:524
void setFlag(E_MATERIAL_FLAG flag, bool value, int intValue=0)
Sets the Material flag to the given value.
Definition SMaterial.h:534
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
Definition vector3d.h:445
CMatrix4< f32 > matrix4
Typedef for f32 matrix.
Definition matrix4.h:2241
string< c8 > stringc
Typedef for character strings.
Definition irrString.h:1373
All scene management can be found in this namespace: Mesh loading, special scene nodes like octrees a...
Definition CIndexBuffer.h:13
core::list< ISceneNodeAnimator * > ISceneNodeAnimatorList
Typedef for list of scene node animators.
Definition ISceneNode.h:30
@ EDS_OFF
No Debug Data ( Default ).
Definition EDebugSceneTypes.h:17
core::list< ISceneNode * > ISceneNodeList
Typedef for list of scene nodes.
Definition ISceneNode.h:28
ESCENE_NODE_TYPE
An enumeration for all types of built-in scene nodes.
Definition ESceneNodeTypes.h:20
@ ESNT_UNKNOWN
Unknown scene node.
Definition ESceneNodeTypes.h:48
const c8 *const AutomaticCullingNames[]
Names for culling type.
Definition ECullingTypes.h:26
IRRLICHT_API SMaterial IdentityMaterial
global const identity Material
E_MATERIAL_FLAG
Material flags.
Definition EMaterialFlags.h:15
const u32 MATERIAL_MAX_TEXTURES
Maximum number of texture an SMaterial can have.
Definition SMaterial.h:251
Everything in the Irrlicht Engine can be found in this namespace.
Definition Skylicht.h:33
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58
char c8
8 bit character variable.
Definition irrTypes.h:31
signed int s32
32 bit signed variable.
Definition irrTypes.h:66
struct holding data describing options
Definition IAttributeExchangingObject.h:35