arsa  2.7
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
irr::scene::ISceneNode Class Referenceabstract

Scene node interface. More...

#include <ISceneNode.h>

Inheritance diagram for irr::scene::ISceneNode:
irr::io::IAttributeExchangingObject irr::IReferenceCounted irr::arsa::CARSADPad irr::arsa::CARSAJson irr::arsa::CARSAPsd irr::arsa::CARSASpine irr::arsa::CAVSceneNode irr::scene::IAnimatedMeshSceneNode irr::scene::IBillboardSceneNode irr::scene::IBoneSceneNode irr::scene::ICameraSceneNode irr::scene::IDummyTransformationSceneNode irr::scene::ILightSceneNode irr::scene::IMeshSceneNode irr::scene::IParticleSystemSceneNode irr::scene::IShadowVolumeSceneNode irr::scene::ITerrainSceneNode irr::scene::ITextSceneNode irr::scene::IVolumeLightSceneNode

Public Member Functions

 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. More...
 
virtual ~ISceneNode ()
 Destructor. More...
 
virtual void OnRegisterSceneNode ()
 This method is called just before the rendering process of the whole scene. More...
 
virtual void OnAnimate (u32 timeMs)
 OnAnimate() is called just before rendering the whole scene. More...
 
virtual void render ()=0
 Renders the node. More...
 
virtual const c8getName () const
 Returns the name of the node. More...
 
virtual void setName (const c8 *name)
 Sets the name of the node. More...
 
virtual void setName (const core::stringc &name)
 Sets the name of the node. More...
 
virtual const core::aabbox3d< f32 > & getBoundingBox () const =0
 Get the axis aligned, not transformed bounding box of this node. More...
 
virtual const core::aabbox3d< f32getTransformedBoundingBox () const
 Get the axis aligned, transformed and animated absolute bounding box of this node. More...
 
virtual void getTransformedBoundingBoxEdges (core::array< core::vector3d< f32 > > &edges) const
 
virtual const core::matrix4getAbsoluteTransformation () const
 Get the absolute transformation of the node. Is recalculated every OnAnimate()-call. More...
 
virtual core::matrix4 getRelativeTransformation () const
 Returns the relative transformation of the scene node. More...
 
virtual bool isVisible () const
 Returns whether the node should be visible (if all of its parents are visible). More...
 
virtual bool isTrulyVisible () const
 Check whether the node is truly visible, taking into accounts its parents' visibility. More...
 
virtual void setVisible (bool isVisible)
 Sets if the node should be visible or not. More...
 
virtual s32 getID () const
 Get the id of the scene node. More...
 
virtual void setID (s32 id)
 Sets the id of the scene node. More...
 
virtual void addChild (ISceneNode *child)
 Adds a child to this scene node. More...
 
virtual bool removeChild (ISceneNode *child)
 Removes a child from this scene node. More...
 
virtual void removeAll ()
 Removes all children of this scene node. More...
 
virtual void remove ()
 Removes this scene node from the scene. More...
 
virtual void addAnimator (ISceneNodeAnimator *animator)
 Adds an animator which should animate this node. More...
 
const core::list< ISceneNodeAnimator * > & getAnimators () const
 Get a list of all scene node animators. More...
 
virtual void removeAnimator (ISceneNodeAnimator *animator)
 Removes an animator from this scene node. More...
 
virtual void removeAnimators ()
 Removes all animators from this scene node. More...
 
virtual video::SMaterialgetMaterial (u32 num)
 Returns the material based on the zero based index i. More...
 
virtual u32 getMaterialCount () const
 Get amount of materials used by this scene node. More...
 
void setMaterialFlag (video::E_MATERIAL_FLAG flag, bool newvalue)
 Sets all material flags at once to a new value. More...
 
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. More...
 
void setMaterialType (video::E_MATERIAL_TYPE newType)
 Sets the material type of all materials in this scene node to a new material type. More...
 
virtual const core::vector3dfgetScale () const
 Gets the scale of the scene node relative to its parent. More...
 
virtual void setScale (const core::vector3df &scale)
 Sets the relative scale of the scene node. More...
 
virtual const core::vector3dfgetRotation () const
 Gets the rotation of the node relative to its parent. More...
 
virtual void setRotation (const core::vector3df &rotation)
 Sets the rotation of the node relative to its parent. More...
 
virtual const core::vector3dfgetPosition () const
 Gets the position of the node relative to its parent. More...
 
virtual void setPosition (const core::vector3df &newpos)
 Sets the position of the node relative to its parent. More...
 
virtual core::vector3df getAbsolutePosition () const
 Gets the absolute position of the node in world coordinates. More...
 
void setAutomaticCulling (u32 state)
 Set a culling style or disable culling completely. More...
 
u32 getAutomaticCulling () const
 Gets the automatic culling state. More...
 
virtual void setDebugDataVisible (u32 state)
 Sets if debug data like bounding boxes should be drawn. More...
 
u32 isDebugDataVisible () const
 Returns if debug data like bounding boxes are drawn. More...
 
void setIsDebugObject (bool debugObject)
 Sets if this scene node is a debug object. More...
 
bool isDebugObject () const
 Returns if this scene node is a debug object. More...
 
const core::list< ISceneNode * > & getChildren () const
 Returns a const reference to the list of all children. More...
 
virtual void setParent (ISceneNode *newParent)
 Changes the parent of the scene node. More...
 
virtual ITriangleSelectorgetTriangleSelector () const
 Returns the triangle selector attached to this scene node. More...
 
virtual void setTriangleSelector (ITriangleSelector *selector)
 Sets the triangle selector of the scene node. More...
 
virtual void updateAbsolutePosition ()
 Updates the absolute position based on the relative and the parents position. More...
 
scene::ISceneNodegetParent () const
 Returns the parent of this scene node. More...
 
virtual ESCENE_NODE_TYPE getType () const
 Returns type of the scene node. More...
 
virtual void serializeAttributes (io::IAttributes *out, io::SAttributeReadWriteOptions *options=0) const _IRR_OVERRIDE_
 Writes attributes of the scene node. More...
 
virtual void deserializeAttributes (io::IAttributes *in, io::SAttributeReadWriteOptions *options=0) _IRR_OVERRIDE_
 Reads attributes of the scene node. More...
 
virtual ISceneNodeclone (ISceneNode *newParent=0, ISceneManager *newManager=0)
 Creates a clone of this scene node and its children. More...
 
virtual ISceneManagergetSceneManager (void) const
 Retrieve the scene manager for this node. More...
 
- Public Member Functions inherited from irr::IReferenceCounted
 IReferenceCounted ()
 Constructor. More...
 
virtual ~IReferenceCounted ()
 Destructor. More...
 
void grab () const
 Grabs the object. Increments the reference counter by one. More...
 
bool drop () const
 Drops the object. Decrements the reference counter by one. More...
 
s32 getReferenceCount () const
 Get the reference count. More...
 
const c8getDebugName () const
 Returns the debug name of the object. More...
 

Protected Member Functions

void cloneMembers (ISceneNode *toCopyFrom, ISceneManager *newManager)
 A clone function for the ISceneNode members. More...
 
void setSceneManager (ISceneManager *newManager)
 
- Protected Member Functions inherited from irr::IReferenceCounted
void setDebugName (const c8 *newName)
 Sets the debug name of the object. More...
 

Protected Attributes

core::stringc Name
 Name of the scene node. More...
 
core::matrix4 AbsoluteTransformation
 Absolute transformation of the node. More...
 
core::vector3df RelativeTranslation
 Relative translation of the scene node. More...
 
core::vector3df RelativeRotation
 Relative rotation of the scene node. More...
 
core::vector3df RelativeScale
 Relative scale of the scene node. More...
 
ISceneNodeParent
 Pointer to the parent. More...
 
core::list< ISceneNode * > Children
 List of all children of this node. More...
 
core::list< ISceneNodeAnimator * > Animators
 List of all animator nodes. More...
 
ISceneManagerSceneManager
 Pointer to the scene manager. More...
 
ITriangleSelectorTriangleSelector
 Pointer to the triangle selector. More...
 
s32 ID
 ID of the node. More...
 
u32 AutomaticCullingState
 Automatic culling state. More...
 
u32 DebugDataVisible
 Flag if debug data should be drawn, such as Bounding Boxes. More...
 
bool IsVisible
 Is the node visible? More...
 
bool IsDebugObject
 Is debug object? More...
 

Detailed Description

Scene node interface.

A scene node is a node in the hierarchical scene graph. Every scene node may have children, which are also scene nodes. Children move relative to their parent's position. If the parent of a node is not visible, its children won't be visible either. In this way, it is for example easily possible to attach a light to a moving car, or to place a walking character on a moving platform on a moving ship.

Definition at line 40 of file ISceneNode.h.

Constructor & Destructor Documentation

◆ ISceneNode()

irr::scene::ISceneNode::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) 
)
inline

Constructor.

Definition at line 45 of file ISceneNode.h.

50  Parent(0), SceneManager(mgr), TriangleSelector(0), ID(id),
52  IsVisible(true), IsDebugObject(false)
53  {
54  if (parent)
55  parent->addChild(this);
56 
58  }
GLenum GLenum GLenum GLenum GLenum scale
bool IsDebugObject
Is debug object?
Definition: ISceneNode.h:866
bool IsVisible
Is the node visible?
Definition: ISceneNode.h:863
s32 ID
ID of the node.
Definition: ISceneNode.h:854
ISceneManager * SceneManager
Pointer to the scene manager.
Definition: ISceneNode.h:848
u32 DebugDataVisible
Flag if debug data should be drawn, such as Bounding Boxes.
Definition: ISceneNode.h:860
virtual void updateAbsolutePosition()
Updates the absolute position based on the relative and the parents position.
Definition: ISceneNode.h:665
core::vector3df RelativeTranslation
Relative translation of the scene node.
Definition: ISceneNode.h:830
ISceneNode * Parent
Pointer to the parent.
Definition: ISceneNode.h:839
core::vector3df RelativeRotation
Relative rotation of the scene node.
Definition: ISceneNode.h:833
core::vector3df RelativeScale
Relative scale of the scene node.
Definition: ISceneNode.h:836
No Debug Data ( Default )
u32 AutomaticCullingState
Automatic culling state.
Definition: ISceneNode.h:857
ITriangleSelector * TriangleSelector
Pointer to the triangle selector.
Definition: ISceneNode.h:851

◆ ~ISceneNode()

virtual irr::scene::ISceneNode::~ISceneNode ( )
inlinevirtual

Destructor.

Definition at line 62 of file ISceneNode.h.

63  {
64  // delete all children
65  removeAll();
66 
67  // delete all animators
68  ISceneNodeAnimatorList::Iterator ait = Animators.begin();
69  for (; ait != Animators.end(); ++ait)
70  (*ait)->drop();
71 
72  if (TriangleSelector)
74  }
bool drop() const
Drops the object. Decrements the reference counter by one.
core::list< ISceneNodeAnimator * > Animators
List of all animator nodes.
Definition: ISceneNode.h:845
virtual void removeAll()
Removes all children of this scene node.
Definition: ISceneNode.h:337
ITriangleSelector * TriangleSelector
Pointer to the triangle selector.
Definition: ISceneNode.h:851

Member Function Documentation

◆ addAnimator()

virtual void irr::scene::ISceneNode::addAnimator ( ISceneNodeAnimator animator)
inlinevirtual

Adds an animator which should animate this node.

Parameters
animatorA pointer to the new animator.

Definition at line 362 of file ISceneNode.h.

363  {
364  if (animator)
365  {
366  Animators.push_back(animator);
367  animator->grab();
368  }
369  }
core::list< ISceneNodeAnimator * > Animators
List of all animator nodes.
Definition: ISceneNode.h:845

◆ addChild()

virtual void irr::scene::ISceneNode::addChild ( ISceneNode child)
inlinevirtual

Adds a child to this scene node.

If the scene node already has a parent it is first removed from the other parent.

Parameters
childA pointer to the new child.

Definition at line 295 of file ISceneNode.h.

296  {
297  if (child && (child != this))
298  {
299  // Change scene manager?
300  if (SceneManager != child->SceneManager)
301  child->setSceneManager(SceneManager);
302 
303  child->grab();
304  child->remove(); // remove from old parent
305  Children.push_back(child);
306  child->Parent = this;
307  }
308  }
core::list< ISceneNode * > Children
List of all children of this node.
Definition: ISceneNode.h:842
ISceneManager * SceneManager
Pointer to the scene manager.
Definition: ISceneNode.h:848

◆ clone()

virtual ISceneNode* irr::scene::ISceneNode::clone ( ISceneNode newParent = 0,
ISceneManager newManager = 0 
)
inlinevirtual

Creates a clone of this scene node and its children.

Parameters
newParentAn optional new parent.
newManagerAn optional new scene manager.
Returns
The newly created clone of this node.

Reimplemented in irr::scene::IAnimatedMeshSceneNode, irr::arsa::CAVSceneNode, irr::arsa::CARSAJson, irr::arsa::CARSASpine, and irr::arsa::CARSAPsd.

Definition at line 757 of file ISceneNode.h.

758  {
759  return 0; // to be implemented by derived classes
760  }

◆ cloneMembers()

void irr::scene::ISceneNode::cloneMembers ( ISceneNode toCopyFrom,
ISceneManager newManager 
)
inlineprotected

A clone function for the ISceneNode members.

This method can be used by clone() implementations of derived classes

Parameters
toCopyFromThe node from which the values are copied
newManagerThe new scene manager.

Definition at line 773 of file ISceneNode.h.

774  {
775  Name = toCopyFrom->Name;
776  AbsoluteTransformation = toCopyFrom->AbsoluteTransformation;
777  RelativeTranslation = toCopyFrom->RelativeTranslation;
778  RelativeRotation = toCopyFrom->RelativeRotation;
779  RelativeScale = toCopyFrom->RelativeScale;
780  ID = toCopyFrom->ID;
781  setTriangleSelector(toCopyFrom->TriangleSelector);
782  AutomaticCullingState = toCopyFrom->AutomaticCullingState;
783  DebugDataVisible = toCopyFrom->DebugDataVisible;
784  IsVisible = toCopyFrom->IsVisible;
785  IsDebugObject = toCopyFrom->IsDebugObject;
786 
787  if (newManager)
788  SceneManager = newManager;
789  else
790  SceneManager = toCopyFrom->SceneManager;
791 
792  // clone children
793 
794  ISceneNodeList::Iterator it = toCopyFrom->Children.begin();
795  for (; it != toCopyFrom->Children.end(); ++it)
796  (*it)->clone(this, newManager);
797 
798  // clone animators
799 
800  ISceneNodeAnimatorList::Iterator ait = toCopyFrom->Animators.begin();
801  for (; ait != toCopyFrom->Animators.end(); ++ait)
802  {
803  ISceneNodeAnimator* anim = (*ait)->createClone(this, SceneManager);
804  if (anim)
805  {
806  addAnimator(anim);
807  anim->drop();
808  }
809  }
810  }
core::stringc Name
Name of the scene node.
Definition: ISceneNode.h:824
virtual void setTriangleSelector(ITriangleSelector *selector)
Sets the triangle selector of the scene node.
Definition: ISceneNode.h:648
bool IsDebugObject
Is debug object?
Definition: ISceneNode.h:866
bool IsVisible
Is the node visible?
Definition: ISceneNode.h:863
s32 ID
ID of the node.
Definition: ISceneNode.h:854
ISceneManager * SceneManager
Pointer to the scene manager.
Definition: ISceneNode.h:848
u32 DebugDataVisible
Flag if debug data should be drawn, such as Bounding Boxes.
Definition: ISceneNode.h:860
virtual void addAnimator(ISceneNodeAnimator *animator)
Adds an animator which should animate this node.
Definition: ISceneNode.h:362
core::vector3df RelativeTranslation
Relative translation of the scene node.
Definition: ISceneNode.h:830
core::vector3df RelativeRotation
Relative rotation of the scene node.
Definition: ISceneNode.h:833
core::vector3df RelativeScale
Relative scale of the scene node.
Definition: ISceneNode.h:836
u32 AutomaticCullingState
Automatic culling state.
Definition: ISceneNode.h:857
core::matrix4 AbsoluteTransformation
Absolute transformation of the node.
Definition: ISceneNode.h:827

◆ deserializeAttributes()

virtual void irr::scene::ISceneNode::deserializeAttributes ( io::IAttributes in,
io::SAttributeReadWriteOptions options = 0 
)
inlinevirtual

Reads attributes of the scene node.

Implement this to set the attributes of your scene node for scripting languages, editors, debuggers or xml deserialization purposes.

Parameters
inThe attribute container to read from.
optionsAdditional options which might influence the deserialization.

Reimplemented from irr::io::IAttributeExchangingObject.

Reimplemented in irr::scene::IParticleSystemSceneNode, irr::arsa::CAVSceneNode, irr::scene::ICameraSceneNode, irr::arsa::CARSAJson, irr::arsa::CARSASpine, and irr::arsa::CARSAPsd.

Definition at line 725 of file ISceneNode.h.

726  {
727  if (!in)
728  return;
729  Name = in->getAttributeAsString("Name", Name);
730  ID = in->getAttributeAsInt("Id", ID);
731 
732  setPosition(in->getAttributeAsVector3d("Position", RelativeTranslation));
733  setRotation(in->getAttributeAsVector3d("Rotation", RelativeRotation));
734  setScale(in->getAttributeAsVector3d("Scale", RelativeScale));
735 
736  IsVisible = in->getAttributeAsBool("Visible", IsVisible);
737  if (in->existsAttribute("AutomaticCulling"))
738  {
739  s32 tmpState = in->getAttributeAsEnumeration("AutomaticCulling",
741  if (tmpState != -1)
742  AutomaticCullingState = (u32)tmpState;
743  else
744  AutomaticCullingState = in->getAttributeAsInt("AutomaticCulling");
745  }
746 
747  DebugDataVisible = in->getAttributeAsInt("DebugDataVisible", DebugDataVisible);
748  IsDebugObject = in->getAttributeAsBool("IsDebugObject", IsDebugObject);
749 
751  }
core::stringc Name
Name of the scene node.
Definition: ISceneNode.h:824
bool IsDebugObject
Is debug object?
Definition: ISceneNode.h:866
virtual void setScale(const core::vector3df &scale)
Sets the relative scale of the scene node.
Definition: ISceneNode.h:482
virtual void setRotation(const core::vector3df &rotation)
Sets the rotation of the node relative to its parent.
Definition: ISceneNode.h:502
bool IsVisible
Is the node visible?
Definition: ISceneNode.h:863
s32 ID
ID of the node.
Definition: ISceneNode.h:854
signed int s32
32 bit signed variable.
Definition: irrTypes.h:70
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
u32 DebugDataVisible
Flag if debug data should be drawn, such as Bounding Boxes.
Definition: ISceneNode.h:860
virtual void updateAbsolutePosition()
Updates the absolute position based on the relative and the parents position.
Definition: ISceneNode.h:665
core::vector3df RelativeTranslation
Relative translation of the scene node.
Definition: ISceneNode.h:830
core::vector3df RelativeRotation
Relative rotation of the scene node.
Definition: ISceneNode.h:833
core::vector3df RelativeScale
Relative scale of the scene node.
Definition: ISceneNode.h:836
virtual void setPosition(const core::vector3df &newpos)
Sets the position of the node relative to its parent.
Definition: ISceneNode.h:521
GLuint in
u32 AutomaticCullingState
Automatic culling state.
Definition: ISceneNode.h:857
const c8 *const AutomaticCullingNames[]
Names for culling type.
Definition: ECullingTypes.h:26

◆ getAbsolutePosition()

virtual core::vector3df irr::scene::ISceneNode::getAbsolutePosition ( ) const
inlinevirtual

Gets the absolute position of the node in world coordinates.

If you want the position of the node relative to its parent, use getPosition() instead. NOTE: For speed reasons the absolute position is not automatically recalculated on each change of the relative position or by a position change of an parent. Instead the update usually happens once per frame in OnAnimate. You can enforce an update with updateAbsolutePosition().

Returns
The current absolute position of the scene node (updated on last call of updateAbsolutePosition).

Definition at line 536 of file ISceneNode.h.

537  {
539  }
vector3d< T > getTranslation() const
Gets the current translation.
Definition: matrix4.h:786
core::matrix4 AbsoluteTransformation
Absolute transformation of the node.
Definition: ISceneNode.h:827

◆ getAbsoluteTransformation()

virtual const core::matrix4& irr::scene::ISceneNode::getAbsoluteTransformation ( ) const
inlinevirtual

Get the absolute transformation of the node. Is recalculated every OnAnimate()-call.

NOTE: For speed reasons the absolute transformation is not automatically recalculated on each change of the relative transformation or by a transformation change of an parent. Instead the update usually happens once per frame in OnAnimate. You can enforce an update with updateAbsolutePosition().

Returns
The absolute transformation matrix.

Definition at line 210 of file ISceneNode.h.

211  {
212  return AbsoluteTransformation;
213  }
core::matrix4 AbsoluteTransformation
Absolute transformation of the node.
Definition: ISceneNode.h:827

◆ getAnimators()

const core::list<ISceneNodeAnimator*>& irr::scene::ISceneNode::getAnimators ( ) const
inline

Get a list of all scene node animators.

Returns
The list of animators attached to this node.

Definition at line 374 of file ISceneNode.h.

375  {
376  return Animators;
377  }
core::list< ISceneNodeAnimator * > Animators
List of all animator nodes.
Definition: ISceneNode.h:845

◆ getAutomaticCulling()

u32 irr::scene::ISceneNode::getAutomaticCulling ( ) const
inline

Gets the automatic culling state.

Returns
The automatic culling state.

Definition at line 556 of file ISceneNode.h.

557  {
558  return AutomaticCullingState;
559  }
u32 AutomaticCullingState
Automatic culling state.
Definition: ISceneNode.h:857

◆ getBoundingBox()

virtual const core::aabbox3d<f32>& irr::scene::ISceneNode::getBoundingBox ( ) const
pure virtual

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

This means that if this node is an animated 3d character, moving in a room, the bounding box will always be around the origin. To get the box in real world coordinates, just transform it with the matrix you receive with getAbsoluteTransformation() or simply use getTransformedBoundingBox(), which does the same.

Returns
The non-transformed bounding box.

Implemented in irr::arsa::CAVSceneNode, irr::arsa::CARSAJson, irr::arsa::CARSASpine, irr::scene::IBoneSceneNode, irr::arsa::CARSAPsd, irr::scene::ITerrainSceneNode, and irr::arsa::CARSADPad.

◆ getChildren()

const core::list<ISceneNode*>& irr::scene::ISceneNode::getChildren ( ) const
inline

Returns a const reference to the list of all children.

Returns
The list of all children of this node.

Definition at line 601 of file ISceneNode.h.

602  {
603  return Children;
604  }
core::list< ISceneNode * > Children
List of all children of this node.
Definition: ISceneNode.h:842

◆ getID()

virtual s32 irr::scene::ISceneNode::getID ( ) const
inlinevirtual

Get the id of the scene node.

This id can be used to identify the node.

Returns
The id.

Definition at line 276 of file ISceneNode.h.

277  {
278  return ID;
279  }
s32 ID
ID of the node.
Definition: ISceneNode.h:854

◆ getMaterial()

virtual video::SMaterial& irr::scene::ISceneNode::getMaterial ( u32  num)
inlinevirtual

Returns the material based on the zero based index i.

To get the amount of materials used by this scene node, use getMaterialCount(). This function is needed for inserting the node into the scene hierarchy at an optimal position for minimizing renderstate changes, but can also be used to directly modify the material of a scene node.

Parameters
numZero based index. The maximal value is getMaterialCount() - 1.
Returns
The material at that index.

Reimplemented in irr::arsa::CAVSceneNode.

Definition at line 420 of file ISceneNode.h.

421  {
423  }
IRRLICHT_API SMaterial IdentityMaterial
global const identity Material

◆ getMaterialCount()

virtual u32 irr::scene::ISceneNode::getMaterialCount ( ) const
inlinevirtual

Get amount of materials used by this scene node.

Returns
Current amount of materials of this scene node.

Reimplemented in irr::arsa::CAVSceneNode.

Definition at line 428 of file ISceneNode.h.

429  {
430  return 0;
431  }

◆ getName()

virtual const c8* irr::scene::ISceneNode::getName ( ) const
inlinevirtual

Returns the name of the node.

Returns
Name as character string.

Definition at line 146 of file ISceneNode.h.

147  {
148  return Name.c_str();
149  }
core::stringc Name
Name of the scene node.
Definition: ISceneNode.h:824
const T * c_str() const
Returns character string.
Definition: irrString.h:526

◆ getParent()

scene::ISceneNode* irr::scene::ISceneNode::getParent ( ) const
inline

Returns the parent of this scene node.

Returns
A pointer to the parent.

Definition at line 679 of file ISceneNode.h.

680  {
681  return Parent;
682  }
ISceneNode * Parent
Pointer to the parent.
Definition: ISceneNode.h:839

◆ getPosition()

virtual const core::vector3df& irr::scene::ISceneNode::getPosition ( ) const
inlinevirtual

Gets the position of the node relative to its parent.

Note that the position is relative to the parent. If you want the position in world coordinates, use getAbsolutePosition() instead.

Returns
The current position of the node relative to the parent.

Definition at line 512 of file ISceneNode.h.

513  {
514  return RelativeTranslation;
515  }
core::vector3df RelativeTranslation
Relative translation of the scene node.
Definition: ISceneNode.h:830

◆ getRelativeTransformation()

virtual core::matrix4 irr::scene::ISceneNode::getRelativeTransformation ( ) const
inlinevirtual

Returns the relative transformation of the scene node.

The relative transformation is stored internally as 3 vectors: translation, rotation and scale. To get the relative transformation matrix, it is calculated from these values.

Returns
The relative transformation matrix.

Definition at line 221 of file ISceneNode.h.

222  {
223  core::matrix4 mat;
224  mat.setRotationDegrees(RelativeRotation);
225  mat.setTranslation(RelativeTranslation);
226 
227  if (RelativeScale != core::vector3df(1.f,1.f,1.f))
228  {
229  core::matrix4 smat;
230  smat.setScale(RelativeScale);
231  mat *= smat;
232  }
233 
234  return mat;
235  }
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
Definition: vector3d.h:461
GLfloat f
core::vector3df RelativeTranslation
Relative translation of the scene node.
Definition: ISceneNode.h:830
core::vector3df RelativeRotation
Relative rotation of the scene node.
Definition: ISceneNode.h:833
core::vector3df RelativeScale
Relative scale of the scene node.
Definition: ISceneNode.h:836
CMatrix4< f32 > matrix4
Typedef for f32 matrix.
Definition: matrix4.h:2377

◆ getRotation()

virtual const core::vector3df& irr::scene::ISceneNode::getRotation ( ) const
inlinevirtual

Gets the rotation of the node relative to its parent.

Note that this is the relative rotation of the node. If you want the absolute rotation, use getAbsoluteTransformation().getRotation()

Returns
Current relative rotation of the scene node.

Definition at line 493 of file ISceneNode.h.

494  {
495  return RelativeRotation;
496  }
core::vector3df RelativeRotation
Relative rotation of the scene node.
Definition: ISceneNode.h:833

◆ getScale()

virtual const core::vector3df& irr::scene::ISceneNode::getScale ( ) const
inlinevirtual

Gets the scale of the scene node relative to its parent.

This is the scale of this node relative to its parent. If you want the absolute scale, use getAbsoluteTransformation().getScale()

Returns
The scale of the scene node.

Definition at line 474 of file ISceneNode.h.

475  {
476  return RelativeScale;
477  }
core::vector3df RelativeScale
Relative scale of the scene node.
Definition: ISceneNode.h:836

◆ getSceneManager()

virtual ISceneManager* irr::scene::ISceneNode::getSceneManager ( void  ) const
inlinevirtual

Retrieve the scene manager for this node.

Returns
The node's scene manager.

Definition at line 764 of file ISceneNode.h.

764 { return SceneManager; }
ISceneManager * SceneManager
Pointer to the scene manager.
Definition: ISceneNode.h:848

◆ getTransformedBoundingBox()

virtual const core::aabbox3d<f32> irr::scene::ISceneNode::getTransformedBoundingBox ( ) const
inlinevirtual

Get the axis aligned, transformed and animated absolute bounding box of this node.

Note: The result is still an axis-aligned bounding box, so it's size changes with rotation.

Returns
The transformed bounding box.

Definition at line 183 of file ISceneNode.h.

184  {
185  core::aabbox3d<f32> box = getBoundingBox();
187  return box;
188  }
virtual const core::aabbox3d< f32 > & getBoundingBox() const =0
Get the axis aligned, not transformed bounding box of this node.
core::matrix4 AbsoluteTransformation
Absolute transformation of the node.
Definition: ISceneNode.h:827
void transformBoxEx(core::aabbox3d< f32 > &box) const
Transforms a axis aligned bounding box.
Definition: matrix4.h:1282

◆ getTransformedBoundingBoxEdges()

virtual void irr::scene::ISceneNode::getTransformedBoundingBoxEdges ( core::array< core::vector3d< f32 > > &  edges) const
inlinevirtual

Get a the 8 corners of the original bounding box transformed and animated by the absolute transformation. Note: The result is not identical to getTransformedBoundingBox().getEdges(), but getting an aabbox3d of these edges would then be identical.

Parameters
edgesReceives an array with the transformed edges

Definition at line 195 of file ISceneNode.h.

196  {
197  edges.set_used(8);
198  getBoundingBox().getEdges( edges.pointer() );
199  for ( u32 i=0; i<8; ++i )
201  }
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
virtual const core::aabbox3d< f32 > & getBoundingBox() const =0
Get the axis aligned, not transformed bounding box of this node.
void transformVect(vector3df &vect) const
Transforms the vector by this matrix.
Definition: matrix4.h:1192
void getEdges(vector3d< T > *edges) const
Stores all 8 edges of the box into an array.
Definition: aabbox3d.h:150
core::matrix4 AbsoluteTransformation
Absolute transformation of the node.
Definition: ISceneNode.h:827

◆ getTriangleSelector()

virtual ITriangleSelector* irr::scene::ISceneNode::getTriangleSelector ( ) const
inlinevirtual

Returns the triangle selector attached to this scene node.

The Selector can be used by the engine for doing collision detection. You can create a TriangleSelector with ISceneManager::createTriangleSelector() or ISceneManager::createOctreeTriangleSelector and set it with ISceneNode::setTriangleSelector(). If a scene node got no triangle selector, but collision tests should be done with it, a triangle selector is created using the bounding box of the scene node.

Returns
A pointer to the TriangleSelector or 0, if there is none.

Definition at line 633 of file ISceneNode.h.

634  {
635  return TriangleSelector;
636  }
ITriangleSelector * TriangleSelector
Pointer to the triangle selector.
Definition: ISceneNode.h:851

◆ getType()

virtual ESCENE_NODE_TYPE irr::scene::ISceneNode::getType ( ) const
inlinevirtual

Returns type of the scene node.

Returns
The type of this node.

Reimplemented in irr::arsa::CAVSceneNode, irr::arsa::CARSAJson, irr::arsa::CARSASpine, irr::arsa::CARSAPsd, irr::arsa::CARSADPad, and irr::scene::IVolumeLightSceneNode.

Definition at line 687 of file ISceneNode.h.

688  {
689  return ESNT_UNKNOWN;
690  }
Unknown scene node.

◆ isDebugDataVisible()

u32 irr::scene::ISceneNode::isDebugDataVisible ( ) const
inline

Returns if debug data like bounding boxes are drawn.

Returns
A bitwise OR of the debug data values from irr::scene::E_DEBUG_SCENE_TYPE that are currently visible.

Definition at line 574 of file ISceneNode.h.

575  {
576  return DebugDataVisible;
577  }
u32 DebugDataVisible
Flag if debug data should be drawn, such as Bounding Boxes.
Definition: ISceneNode.h:860

◆ isDebugObject()

bool irr::scene::ISceneNode::isDebugObject ( ) const
inline

Returns if this scene node is a debug object.

Debug objects have some special properties, for example they can be easily excluded from collision detection or from serialization, etc.

Returns
If this node is a debug object, true is returned.

Definition at line 593 of file ISceneNode.h.

594  {
595  return IsDebugObject;
596  }
bool IsDebugObject
Is debug object?
Definition: ISceneNode.h:866

◆ isTrulyVisible()

virtual bool irr::scene::ISceneNode::isTrulyVisible ( ) const
inlinevirtual

Check whether the node is truly visible, taking into accounts its parents' visibility.

Returns
true if the node and all its parents are visible, false if this or any parent node is invisible.

Definition at line 251 of file ISceneNode.h.

252  {
253  if(!IsVisible)
254  return false;
255 
256  if(!Parent)
257  return true;
258 
259  return Parent->isTrulyVisible();
260  }
bool IsVisible
Is the node visible?
Definition: ISceneNode.h:863
virtual bool isTrulyVisible() const
Check whether the node is truly visible, taking into accounts its parents' visibility.
Definition: ISceneNode.h:251
ISceneNode * Parent
Pointer to the parent.
Definition: ISceneNode.h:839

◆ isVisible()

virtual bool irr::scene::ISceneNode::isVisible ( ) const
inlinevirtual

Returns whether the node should be visible (if all of its parents are visible).

This is only an option set by the user, but has nothing to do with geometry culling

Returns
The requested visibility of the node, true means visible (if all parents are also visible).

Definition at line 243 of file ISceneNode.h.

244  {
245  return IsVisible;
246  }
bool IsVisible
Is the node visible?
Definition: ISceneNode.h:863

◆ OnAnimate()

virtual void irr::scene::ISceneNode::OnAnimate ( u32  timeMs)
inlinevirtual

OnAnimate() is called just before rendering the whole scene.

Nodes may calculate or store animations here, and may do other useful things, depending on what they are. Also, OnAnimate() should be called for all child scene nodes here. This method will be called once per frame, independent of whether the scene node is visible or not.

Parameters
timeMsCurrent time in milliseconds.

Reimplemented in irr::arsa::CAVSceneNode, irr::arsa::CARSAJson, irr::arsa::CARSASpine, irr::scene::IBoneSceneNode, irr::arsa::CARSAPsd, and irr::arsa::CARSADPad.

Definition at line 108 of file ISceneNode.h.

109  {
110  if (IsVisible)
111  {
112  // animate this node with all animators
113 
114  ISceneNodeAnimatorList::Iterator ait = Animators.begin();
115  while (ait != Animators.end())
116  {
117  // continue to the next node before calling animateNode()
118  // so that the animator may remove itself from the scene
119  // node without the iterator becoming invalid
120  ISceneNodeAnimator* anim = *ait;
121  ++ait;
122  if ( anim->isEnabled() )
123  {
124  anim->animateNode(this, timeMs);
125  }
126  }
127 
128  // update absolute position
130 
131  // perform the post render process on all children
132 
133  ISceneNodeList::Iterator it = Children.begin();
134  for (; it != Children.end(); ++it)
135  (*it)->OnAnimate(timeMs);
136  }
137  }
core::list< ISceneNode * > Children
List of all children of this node.
Definition: ISceneNode.h:842
bool IsVisible
Is the node visible?
Definition: ISceneNode.h:863
core::list< ISceneNodeAnimator * > Animators
List of all animator nodes.
Definition: ISceneNode.h:845
virtual void updateAbsolutePosition()
Updates the absolute position based on the relative and the parents position.
Definition: ISceneNode.h:665

◆ OnRegisterSceneNode()

virtual void irr::scene::ISceneNode::OnRegisterSceneNode ( )
inlinevirtual

This method is called just before the rendering process of the whole scene.

Nodes may register themselves in the render pipeline during this call, precalculate the geometry which should be renderered, and prevent their children from being able to register themselves if they are clipped by simply not calling their OnRegisterSceneNode method. If you are implementing your own scene node, you should overwrite this method with an implementation code looking like this:

Reimplemented in irr::arsa::CAVSceneNode, irr::arsa::CARSAJson, irr::arsa::CARSASpine, irr::arsa::CARSAPsd, and irr::arsa::CARSADPad.

Definition at line 91 of file ISceneNode.h.

92  {
93  if (IsVisible)
94  {
95  ISceneNodeList::Iterator it = Children.begin();
96  for (; it != Children.end(); ++it)
97  (*it)->OnRegisterSceneNode();
98  }
99  }
core::list< ISceneNode * > Children
List of all children of this node.
Definition: ISceneNode.h:842
bool IsVisible
Is the node visible?
Definition: ISceneNode.h:863

◆ remove()

virtual void irr::scene::ISceneNode::remove ( )
inlinevirtual

Removes this scene node from the scene.

If no other grab exists for this node, it will be deleted.

Definition at line 353 of file ISceneNode.h.

354  {
355  if (Parent)
356  Parent->removeChild(this);
357  }
ISceneNode * Parent
Pointer to the parent.
Definition: ISceneNode.h:839
virtual bool removeChild(ISceneNode *child)
Removes a child from this scene node.
Definition: ISceneNode.h:317

◆ removeAll()

virtual void irr::scene::ISceneNode::removeAll ( )
inlinevirtual

Removes all children of this scene node.

The scene nodes found in the children list are also dropped and might be deleted if no other grab exists on them.

Definition at line 337 of file ISceneNode.h.

338  {
339  ISceneNodeList::Iterator it = Children.begin();
340  for (; it != Children.end(); ++it)
341  {
342  (*it)->Parent = 0;
343  (*it)->drop();
344  }
345 
346  Children.clear();
347  }
core::list< ISceneNode * > Children
List of all children of this node.
Definition: ISceneNode.h:842

◆ removeAnimator()

virtual void irr::scene::ISceneNode::removeAnimator ( ISceneNodeAnimator animator)
inlinevirtual

Removes an animator from this scene node.

If the animator is found, it is also dropped and might be deleted if not other grab exists for it.

Parameters
animatorA pointer to the animator to be deleted.

Definition at line 384 of file ISceneNode.h.

385  {
386  ISceneNodeAnimatorList::Iterator it = Animators.begin();
387  for (; it != Animators.end(); ++it)
388  {
389  if ((*it) == animator)
390  {
391  (*it)->drop();
392  Animators.erase(it);
393  return;
394  }
395  }
396  }
core::list< ISceneNodeAnimator * > Animators
List of all animator nodes.
Definition: ISceneNode.h:845

◆ removeAnimators()

virtual void irr::scene::ISceneNode::removeAnimators ( )
inlinevirtual

Removes all animators from this scene node.

The animators might also be deleted if no other grab exists for them.

Definition at line 402 of file ISceneNode.h.

403  {
404  ISceneNodeAnimatorList::Iterator it = Animators.begin();
405  for (; it != Animators.end(); ++it)
406  (*it)->drop();
407 
408  Animators.clear();
409  }
core::list< ISceneNodeAnimator * > Animators
List of all animator nodes.
Definition: ISceneNode.h:845

◆ removeChild()

virtual bool irr::scene::ISceneNode::removeChild ( ISceneNode child)
inlinevirtual

Removes a child from this scene node.

If found in the children list, the child pointer is also dropped and might be deleted if no other grab exists.

Parameters
childA pointer to the child which shall be removed.
Returns
True if the child was removed, and false if not, e.g. because it couldn't be found in the children list.

Definition at line 317 of file ISceneNode.h.

318  {
319  ISceneNodeList::Iterator it = Children.begin();
320  for (; it != Children.end(); ++it)
321  if ((*it) == child)
322  {
323  (*it)->Parent = 0;
324  (*it)->drop();
325  Children.erase(it);
326  return true;
327  }
328 
329  return false;
330  }
core::list< ISceneNode * > Children
List of all children of this node.
Definition: ISceneNode.h:842

◆ render()

virtual void irr::scene::ISceneNode::render ( )
pure virtual

◆ serializeAttributes()

virtual void irr::scene::ISceneNode::serializeAttributes ( io::IAttributes out,
io::SAttributeReadWriteOptions options = 0 
) const
inlinevirtual

Writes attributes of the scene node.

Implement this to expose the attributes of your scene node for scripting languages, editors, debuggers or xml serialization purposes.

Parameters
outThe attribute container to write into.
optionsAdditional options which might influence the serialization.

Reimplemented from irr::io::IAttributeExchangingObject.

Reimplemented in irr::scene::IParticleSystemSceneNode, irr::arsa::CAVSceneNode, irr::scene::ICameraSceneNode, irr::arsa::CARSAJson, irr::arsa::CARSASpine, and irr::arsa::CARSAPsd.

Definition at line 700 of file ISceneNode.h.

701  {
702  if (!out)
703  return;
704  out->addString("Name", Name.c_str());
705  out->addInt("Id", ID );
706 
707  out->addVector3d("Position", getPosition() );
708  out->addVector3d("Rotation", getRotation() );
709  out->addVector3d("Scale", getScale() );
710 
711  out->addBool("Visible", IsVisible );
712  out->addInt("AutomaticCulling", AutomaticCullingState);
713  out->addInt("DebugDataVisible", DebugDataVisible );
714  out->addBool("IsDebugObject", IsDebugObject );
715  }
core::stringc Name
Name of the scene node.
Definition: ISceneNode.h:824
bool IsDebugObject
Is debug object?
Definition: ISceneNode.h:866
virtual const core::vector3df & getPosition() const
Gets the position of the node relative to its parent.
Definition: ISceneNode.h:512
bool IsVisible
Is the node visible?
Definition: ISceneNode.h:863
s32 ID
ID of the node.
Definition: ISceneNode.h:854
const T * c_str() const
Returns character string.
Definition: irrString.h:526
u32 DebugDataVisible
Flag if debug data should be drawn, such as Bounding Boxes.
Definition: ISceneNode.h:860
virtual const core::vector3df & getScale() const
Gets the scale of the scene node relative to its parent.
Definition: ISceneNode.h:474
virtual const core::vector3df & getRotation() const
Gets the rotation of the node relative to its parent.
Definition: ISceneNode.h:493
u32 AutomaticCullingState
Automatic culling state.
Definition: ISceneNode.h:857

◆ setAutomaticCulling()

void irr::scene::ISceneNode::setAutomaticCulling ( u32  state)
inline

Set a culling style or disable culling completely.

Box cullling (EAC_BOX) is set by default. Note that not all SceneNodes support culling and that some nodes always cull their geometry because it is their only reason for existence, for example the OctreeSceneNode.

Parameters
stateThe culling state to be used. Check E_CULLING_TYPE for possible values.

Definition at line 548 of file ISceneNode.h.

549  {
550  AutomaticCullingState = state;
551  }
u32 AutomaticCullingState
Automatic culling state.
Definition: ISceneNode.h:857

◆ setDebugDataVisible()

virtual void irr::scene::ISceneNode::setDebugDataVisible ( u32  state)
inlinevirtual

Sets if debug data like bounding boxes should be drawn.

A bitwise OR of the types from irr::scene::E_DEBUG_SCENE_TYPE. Please note that not all scene nodes support all debug data types.

Parameters
stateThe debug data visibility state to be used.

Definition at line 566 of file ISceneNode.h.

567  {
568  DebugDataVisible = state;
569  }
u32 DebugDataVisible
Flag if debug data should be drawn, such as Bounding Boxes.
Definition: ISceneNode.h:860

◆ setID()

virtual void irr::scene::ISceneNode::setID ( s32  id)
inlinevirtual

Sets the id of the scene node.

This id can be used to identify the node.

Parameters
idThe new id.

Definition at line 285 of file ISceneNode.h.

286  {
287  ID = id;
288  }
GLuint id
s32 ID
ID of the node.
Definition: ISceneNode.h:854

◆ setIsDebugObject()

void irr::scene::ISceneNode::setIsDebugObject ( bool  debugObject)
inline

Sets if this scene node is a debug object.

Debug objects have some special properties, for example they can be easily excluded from collision detection or from serialization, etc.

Definition at line 583 of file ISceneNode.h.

584  {
585  IsDebugObject = debugObject;
586  }
bool IsDebugObject
Is debug object?
Definition: ISceneNode.h:866

◆ setMaterialFlag()

void irr::scene::ISceneNode::setMaterialFlag ( video::E_MATERIAL_FLAG  flag,
bool  newvalue 
)
inline

Sets all material flags at once to a new value.

Useful, for example, if you want the whole mesh to be affected by light.

Parameters
flagWhich flag of all materials to be set.
newvalueNew value of that flag.

Definition at line 439 of file ISceneNode.h.

440  {
441  for (u32 i=0; i<getMaterialCount(); ++i)
442  getMaterial(i).setFlag(flag, newvalue);
443  }
void setFlag(E_MATERIAL_FLAG flag, bool value)
Sets the Material flag to the given value.
Definition: SMaterial.h:606
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
virtual video::SMaterial & getMaterial(u32 num)
Returns the material based on the zero based index i.
Definition: ISceneNode.h:420
virtual u32 getMaterialCount() const
Get amount of materials used by this scene node.
Definition: ISceneNode.h:428

◆ setMaterialTexture()

void irr::scene::ISceneNode::setMaterialTexture ( u32  textureLayer,
video::ITexture texture 
)
inline

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

Parameters
textureLayerLayer of texture to be set. Must be a value smaller than MATERIAL_MAX_TEXTURES.
textureNew texture to be used.

Definition at line 450 of file ISceneNode.h.

451  {
452  if (textureLayer >= video::MATERIAL_MAX_TEXTURES)
453  return;
454 
455  for (u32 i=0; i<getMaterialCount(); ++i)
456  getMaterial(i).setTexture(textureLayer, texture);
457  }
void setTexture(u32 i, ITexture *tex)
Sets the i-th texture.
Definition: SMaterial.h:596
GLenum GLenum GLuint texture
const u32 MATERIAL_MAX_TEXTURES
Maximum number of texture an SMaterial can have.
Definition: SMaterial.h:283
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
virtual video::SMaterial & getMaterial(u32 num)
Returns the material based on the zero based index i.
Definition: ISceneNode.h:420
virtual u32 getMaterialCount() const
Get amount of materials used by this scene node.
Definition: ISceneNode.h:428

◆ setMaterialType()

void irr::scene::ISceneNode::setMaterialType ( video::E_MATERIAL_TYPE  newType)
inline

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

Parameters
newTypeNew type of material to be set.

Definition at line 462 of file ISceneNode.h.

463  {
464  for (u32 i=0; i<getMaterialCount(); ++i)
465  getMaterial(i).MaterialType = newType;
466  }
E_MATERIAL_TYPE MaterialType
Type of the material. Specifies how everything is blended together.
Definition: SMaterial.h:382
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
virtual video::SMaterial & getMaterial(u32 num)
Returns the material based on the zero based index i.
Definition: ISceneNode.h:420
virtual u32 getMaterialCount() const
Get amount of materials used by this scene node.
Definition: ISceneNode.h:428

◆ setName() [1/2]

virtual void irr::scene::ISceneNode::setName ( const c8 name)
inlinevirtual

Sets the name of the node.

Parameters
nameNew name of the scene node.

Definition at line 154 of file ISceneNode.h.

155  {
156  Name = name;
157  }
core::stringc Name
Name of the scene node.
Definition: ISceneNode.h:824
GLuint const GLchar * name

◆ setName() [2/2]

virtual void irr::scene::ISceneNode::setName ( const core::stringc name)
inlinevirtual

Sets the name of the node.

Parameters
nameNew name of the scene node.

Definition at line 162 of file ISceneNode.h.

163  {
164  Name = name;
165  }
core::stringc Name
Name of the scene node.
Definition: ISceneNode.h:824
GLuint const GLchar * name

◆ setParent()

virtual void irr::scene::ISceneNode::setParent ( ISceneNode newParent)
inlinevirtual

Changes the parent of the scene node.

Parameters
newParentThe new parent to be used.

Definition at line 609 of file ISceneNode.h.

610  {
611  grab();
612  remove();
613 
614  Parent = newParent;
615 
616  if (Parent)
617  Parent->addChild(this);
618 
619  drop();
620  }
bool drop() const
Drops the object. Decrements the reference counter by one.
virtual void remove()
Removes this scene node from the scene.
Definition: ISceneNode.h:353
virtual void addChild(ISceneNode *child)
Adds a child to this scene node.
Definition: ISceneNode.h:295
ISceneNode * Parent
Pointer to the parent.
Definition: ISceneNode.h:839
void grab() const
Grabs the object. Increments the reference counter by one.

◆ setPosition()

virtual void irr::scene::ISceneNode::setPosition ( const core::vector3df newpos)
inlinevirtual

Sets the position of the node relative to its parent.

Note that the position is relative to the parent.

Parameters
newposNew relative position of the scene node.

Definition at line 521 of file ISceneNode.h.

522  {
523  RelativeTranslation = newpos;
524  }
core::vector3df RelativeTranslation
Relative translation of the scene node.
Definition: ISceneNode.h:830

◆ setRotation()

virtual void irr::scene::ISceneNode::setRotation ( const core::vector3df rotation)
inlinevirtual

Sets the rotation of the node relative to its parent.

This only modifies the relative rotation of the node.

Parameters
rotationNew rotation of the node in degrees.

Reimplemented in irr::scene::ICameraSceneNode.

Definition at line 502 of file ISceneNode.h.

503  {
504  RelativeRotation = rotation;
505  }
core::vector3df RelativeRotation
Relative rotation of the scene node.
Definition: ISceneNode.h:833

◆ setScale()

virtual void irr::scene::ISceneNode::setScale ( const core::vector3df scale)
inlinevirtual

Sets the relative scale of the scene node.

Parameters
scaleNew scale of the node, relative to its parent.

Definition at line 482 of file ISceneNode.h.

483  {
485  }
GLenum GLenum GLenum GLenum GLenum scale
core::vector3df RelativeScale
Relative scale of the scene node.
Definition: ISceneNode.h:836

◆ setSceneManager()

void irr::scene::ISceneNode::setSceneManager ( ISceneManager newManager)
inlineprotected

Sets the new scene manager for this node and all children. Called by addChild when moving nodes between scene managers

Definition at line 814 of file ISceneNode.h.

815  {
816  SceneManager = newManager;
817 
818  ISceneNodeList::Iterator it = Children.begin();
819  for (; it != Children.end(); ++it)
820  (*it)->setSceneManager(newManager);
821  }
core::list< ISceneNode * > Children
List of all children of this node.
Definition: ISceneNode.h:842
ISceneManager * SceneManager
Pointer to the scene manager.
Definition: ISceneNode.h:848

◆ setTriangleSelector()

virtual void irr::scene::ISceneNode::setTriangleSelector ( ITriangleSelector selector)
inlinevirtual

Sets the triangle selector of the scene node.

The Selector can be used by the engine for doing collision detection. You can create a TriangleSelector with ISceneManager::createTriangleSelector() or ISceneManager::createOctreeTriangleSelector(). Some nodes may create their own selector by default, so it would be good to check if there is already a selector in this node by calling ISceneNode::getTriangleSelector().

Parameters
selectorNew triangle selector for this scene node.

Definition at line 648 of file ISceneNode.h.

649  {
650  if (TriangleSelector != selector)
651  {
652  if (TriangleSelector)
654 
655  TriangleSelector = selector;
656  if (TriangleSelector)
658  }
659  }
bool drop() const
Drops the object. Decrements the reference counter by one.
void grab() const
Grabs the object. Increments the reference counter by one.
ITriangleSelector * TriangleSelector
Pointer to the triangle selector.
Definition: ISceneNode.h:851

◆ setVisible()

virtual void irr::scene::ISceneNode::setVisible ( bool  isVisible)
inlinevirtual

Sets if the node should be visible or not.

All children of this node won't be visible either, when set to false. Invisible nodes are not valid candidates for selection by collision manager bounding box methods.

Parameters
isVisibleIf the node shall be visible.

Reimplemented in irr::arsa::CAVSceneNode, and irr::scene::ILightSceneNode.

Definition at line 267 of file ISceneNode.h.

268  {
270  }
virtual bool isVisible() const
Returns whether the node should be visible (if all of its parents are visible).
Definition: ISceneNode.h:243
bool IsVisible
Is the node visible?
Definition: ISceneNode.h:863

◆ updateAbsolutePosition()

virtual void irr::scene::ISceneNode::updateAbsolutePosition ( )
inlinevirtual

Updates the absolute position based on the relative and the parents position.

Note: This does not recursively update the parents absolute positions, so if you have a deeper hierarchy you might want to update the parents first.

Definition at line 665 of file ISceneNode.h.

666  {
667  if (Parent)
668  {
671  }
672  else
674  }
virtual const core::matrix4 & getAbsoluteTransformation() const
Get the absolute transformation of the node. Is recalculated every OnAnimate()-call.
Definition: ISceneNode.h:210
ISceneNode * Parent
Pointer to the parent.
Definition: ISceneNode.h:839
virtual core::matrix4 getRelativeTransformation() const
Returns the relative transformation of the scene node.
Definition: ISceneNode.h:221
core::matrix4 AbsoluteTransformation
Absolute transformation of the node.
Definition: ISceneNode.h:827

Member Data Documentation

◆ AbsoluteTransformation

core::matrix4 irr::scene::ISceneNode::AbsoluteTransformation
protected

Absolute transformation of the node.

Definition at line 827 of file ISceneNode.h.

◆ Animators

core::list<ISceneNodeAnimator*> irr::scene::ISceneNode::Animators
protected

List of all animator nodes.

Definition at line 845 of file ISceneNode.h.

◆ AutomaticCullingState

u32 irr::scene::ISceneNode::AutomaticCullingState
protected

Automatic culling state.

Definition at line 857 of file ISceneNode.h.

◆ Children

core::list<ISceneNode*> irr::scene::ISceneNode::Children
protected

List of all children of this node.

Definition at line 842 of file ISceneNode.h.

◆ DebugDataVisible

u32 irr::scene::ISceneNode::DebugDataVisible
protected

Flag if debug data should be drawn, such as Bounding Boxes.

Definition at line 860 of file ISceneNode.h.

◆ ID

s32 irr::scene::ISceneNode::ID
protected

ID of the node.

Definition at line 854 of file ISceneNode.h.

◆ IsDebugObject

bool irr::scene::ISceneNode::IsDebugObject
protected

Is debug object?

Definition at line 866 of file ISceneNode.h.

◆ IsVisible

bool irr::scene::ISceneNode::IsVisible
protected

Is the node visible?

Definition at line 863 of file ISceneNode.h.

◆ Name

core::stringc irr::scene::ISceneNode::Name
protected

Name of the scene node.

Definition at line 824 of file ISceneNode.h.

◆ Parent

ISceneNode* irr::scene::ISceneNode::Parent
protected

Pointer to the parent.

Definition at line 839 of file ISceneNode.h.

◆ RelativeRotation

core::vector3df irr::scene::ISceneNode::RelativeRotation
protected

Relative rotation of the scene node.

Definition at line 833 of file ISceneNode.h.

◆ RelativeScale

core::vector3df irr::scene::ISceneNode::RelativeScale
protected

Relative scale of the scene node.

Definition at line 836 of file ISceneNode.h.

◆ RelativeTranslation

core::vector3df irr::scene::ISceneNode::RelativeTranslation
protected

Relative translation of the scene node.

Definition at line 830 of file ISceneNode.h.

◆ SceneManager

ISceneManager* irr::scene::ISceneNode::SceneManager
protected

Pointer to the scene manager.

Definition at line 848 of file ISceneNode.h.

◆ TriangleSelector

ITriangleSelector* irr::scene::ISceneNode::TriangleSelector
protected

Pointer to the triangle selector.

Definition at line 851 of file ISceneNode.h.


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