Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kge::sn::SceneNode Class Reference

#include <SceneNode.h>

Inheritance diagram for kge::sn::SceneNode:
kge::KgeUnknown kge::sn::AnimatedMesh kge::sn::AnimatedTexture kge::sn::Bone kge::sn::Camera kge::sn::Decal kge::sn::Light kge::sn::Listener kge::sn::Mesh kge::sn::ParticleSystem kge::sn::RibbonTrail kge::sn::Sound2D kge::sn::Sound3D kge::sn::StaticMesh kge::sn::TileTerrain kge::sn::TPCamera

Public Member Functions

 SceneNode ()
 Constructor.
virtual ~SceneNode ()
 Destructor.
virtual void AddChild (SceneNode *child)
 Adds a node as child.
virtual void PreRender (float elapsedTime=0.0f)=0
 The jobs before rendering like culling and calculate position.
virtual void Render ()=0
 Render the objects.
virtual void PostRender ()=0
 The jobs after rendering.
virtual void Draw (bool WithMaterial, bool WithTransform, bool bPosition=true, bool bNormalTexcoord=true, bool bTangentBinormal=true)=0
virtual bool AddEffect (efx::EffectType p, efx::Effect **ppOut)
virtual void SetSceneManager (SceneManager *smgr)
 Sets the scene manager and renderer pointer.
virtual void SetPosition (const math::Vector &v)
 Set the position of the scenenode.
virtual void SetRotation (const math::Vector &v)
 Set the rotation of the scenenode.
virtual void SetScale (const math::Vector &v)
 Set the scale of the scenenode.
virtual void SetAutomaticCulling (bool isTrue)
 Set Cutting Enable or Disable.
virtual void SetVisible (bool isVisible)
 Set Visible Enable or Disable.
virtual bool GetVisible ()
 Get Visible.
virtual bool IsVisibleInFrame ()
 Is it visible in this frame?
virtual const math::VectorGetPosition () const
 Returns the node position.
virtual const math::VectorGetRotation () const
 Returns the node rotation.
virtual const math::VectorGetScale () const
 Returns the node scale.
virtual math::MatrixGetAbsoluteMatrix () const
 Get the absolute matrix.
virtual math::MatrixGetFinalMatrix ()
 Get the final matrix.
virtual u32 GetMaterialCount ()
 Get the count of materials this node has.
virtual gfx::MaterialGetMaterial (u32 Index)
virtual math::SphereGetBoundingBox ()
 Returns the node bounding box.
virtual math::AABBGetAxisAlignedBoundingBox ()
 Returns the node Axis aligned bounding box.
virtual NodeType GetType () const
 Returns the node type.
virtual void RemoveChild (SceneNode *child)
virtual void RemoveChildren ()
 Removes all children of this node.
virtual const SceneNodeGetParent ()
 Returns the node parent.
virtual void SetParent (SceneNode *parent)
 Sets the node parent.
virtual void SetName (const char *name)
 Sets the node name.
virtual core::StringGetName ()
 Gets the node name.
virtual void SetID (int ID)
 Sets the node ID.
virtual int GetID ()
 Gets the node ID.
void EnableShadow (bool enable)
bool HasShadow () const
virtual void UpdateFinalMat ()
 Update final matrix.
- Public Member Functions inherited from kge::KgeUnknown
 KgeUnknown ()
 Constructor.
virtual ~KgeUnknown ()
 Destructor.
virtual void AddRef ()
 Add a reference to the object.
virtual void DecRef ()
 Decrease a reference from the object. if its reference count get 0 then the object will destroy.
u32 GetRefCount ()
 Return resource reference count.
const char * GetDebugText ()
 returns the instance debug text.

Protected Member Functions

virtual bool HasThisEffect (efx::EffectType p)
- Protected Member Functions inherited from kge::KgeUnknown
void SetDebugText (char *text)

Protected Attributes

core::String m_sName
int m_iID
SceneManagerm_pSnMan
gfx::Rendererm_pRenderer
bool m_bVis
bool m_bAutoCulling
bool m_bVisFrame
SceneNodem_pParent
std::vector< SceneNode * > m_vChilds
std::vector< int > m_vEffectType
std::vector< efx::Effect * > m_vEffect
math::Matrixm_pAbsMat
math::Matrixm_pFinalMat
math::Vector m_Position
math::Vector m_Rotation
math::Vector m_Scale
math::Spherem_pBB
math::AABBm_pAABB
NodeType m_eNodeType
bool m_hasShadow

Friends

class SceneManager

Detailed Description

In class chizi bishtar az ye Interface nist vali baes mishe ke khili rahat masalan ye tofang ro be daste ye Sarbaz bedid.

Definition at line 59 of file SceneNode.h.

Constructor & Destructor Documentation

kge::sn::SceneNode::SceneNode ( )

Constructor.

virtual kge::sn::SceneNode::~SceneNode ( )
virtual

Destructor.

Member Function Documentation

virtual void kge::sn::SceneNode::AddChild ( SceneNode child)
virtual

Adds a node as child.

Reimplemented in kge::sn::Bone.

Referenced by kge::sn::Bone::AddChild().

virtual bool kge::sn::SceneNode::AddEffect ( efx::EffectType  p,
efx::Effect **  ppOut 
)
inlinevirtual

Ezafe kardane effect be hamin gereh.

Parameters
pEffecti ke mikhahid ezafe konid.
ppOutClass Effect sakhte shode.
Returns
agar ke in gereh betavanad in effect ra bepazirad true bar migardanad.

Reimplemented in kge::sn::Camera, kge::sn::TileTerrain, kge::sn::Sound2D, kge::sn::Mesh, kge::sn::StaticMesh, kge::sn::AnimatedMesh, kge::sn::Sound3D, and kge::sn::Light.

Definition at line 93 of file SceneNode.h.

virtual void kge::sn::SceneNode::Draw ( bool  WithMaterial,
bool  WithTransform,
bool  bPosition = true,
bool  bNormalTexcoord = true,
bool  bTangentBinormal = true 
)
pure virtual

Draw the node with/without its Materials and Transforms.

Parameters
WithMaterialDraw it with its own materials or not?
WithMaterialDraw it with its own Transformations or not?

Implemented in kge::sn::ParticleSystem, kge::sn::TileTerrain, kge::sn::Camera, kge::sn::AnimatedTexture, kge::sn::Sound2D, kge::sn::Bone, kge::sn::Listener, kge::sn::Mesh, kge::sn::RibbonTrail, kge::sn::StaticMesh, kge::sn::AnimatedMesh, kge::sn::Decal, kge::sn::TPCamera, kge::sn::Light, and kge::sn::Sound3D.

void kge::sn::SceneNode::EnableShadow ( bool  enable)
virtual math::Matrix* kge::sn::SceneNode::GetAbsoluteMatrix ( ) const
virtual

Get the absolute matrix.

virtual math::AABB* kge::sn::SceneNode::GetAxisAlignedBoundingBox ( )
inlinevirtual

Returns the node Axis aligned bounding box.

Definition at line 147 of file SceneNode.h.

virtual math::Sphere* kge::sn::SceneNode::GetBoundingBox ( )
inlinevirtual

Returns the node bounding box.

Definition at line 144 of file SceneNode.h.

virtual math::Matrix* kge::sn::SceneNode::GetFinalMatrix ( )
inlinevirtual

Get the final matrix.

Definition at line 133 of file SceneNode.h.

virtual int kge::sn::SceneNode::GetID ( )
inlinevirtual

Gets the node ID.

Definition at line 187 of file SceneNode.h.

virtual gfx::Material* kge::sn::SceneNode::GetMaterial ( u32  Index)
virtual

Get the node material by its index.

Parameters
IndexThe material index. Some nodes have more than one material.

Reimplemented in kge::sn::TileTerrain, kge::sn::AnimatedMesh, kge::sn::StaticMesh, and kge::sn::Decal.

virtual u32 kge::sn::SceneNode::GetMaterialCount ( )
virtual

Get the count of materials this node has.

Reimplemented in kge::sn::TileTerrain, kge::sn::AnimatedMesh, and kge::sn::StaticMesh.

virtual core::String* kge::sn::SceneNode::GetName ( )
inlinevirtual

Gets the node name.

Definition at line 175 of file SceneNode.h.

virtual const SceneNode* kge::sn::SceneNode::GetParent ( )
inlinevirtual

Returns the node parent.

Definition at line 163 of file SceneNode.h.

virtual const math::Vector& kge::sn::SceneNode::GetPosition ( ) const
virtual

Returns the node position.

Reimplemented in kge::sn::TPCamera, kge::sn::Camera, and kge::sn::Light.

virtual const math::Vector& kge::sn::SceneNode::GetRotation ( ) const
virtual

Returns the node rotation.

virtual const math::Vector& kge::sn::SceneNode::GetScale ( ) const
virtual

Returns the node scale.

virtual NodeType kge::sn::SceneNode::GetType ( ) const
inlinevirtual

Returns the node type.

Reimplemented in kge::sn::TPCamera, and kge::sn::Camera.

Definition at line 151 of file SceneNode.h.

virtual bool kge::sn::SceneNode::GetVisible ( )
inlinevirtual

Get Visible.

Definition at line 115 of file SceneNode.h.

bool kge::sn::SceneNode::HasShadow ( ) const
inline

Definition at line 196 of file SceneNode.h.

virtual bool kge::sn::SceneNode::HasThisEffect ( efx::EffectType  p)
protectedvirtual
virtual bool kge::sn::SceneNode::IsVisibleInFrame ( )
inlinevirtual

Is it visible in this frame?

Definition at line 118 of file SceneNode.h.

virtual void kge::sn::SceneNode::PreRender ( float  elapsedTime = 0.0f)
pure virtual
virtual void kge::sn::SceneNode::RemoveChild ( SceneNode child)
virtual

Removes a child from this node.

Parameters
childThe pointer to the child.
DeleteIf pass true it will be deleted from memory.
virtual void kge::sn::SceneNode::RemoveChildren ( )
virtual

Removes all children of this node.

virtual void kge::sn::SceneNode::SetAutomaticCulling ( bool  isTrue)
inlinevirtual

Set Cutting Enable or Disable.

Definition at line 109 of file SceneNode.h.

virtual void kge::sn::SceneNode::SetID ( int  ID)
inlinevirtual

Sets the node ID.

Definition at line 181 of file SceneNode.h.

virtual void kge::sn::SceneNode::SetName ( const char *  name)
inlinevirtual

Sets the node name.

Reimplemented in kge::sn::Bone.

Definition at line 169 of file SceneNode.h.

virtual void kge::sn::SceneNode::SetParent ( SceneNode parent)
virtual

Sets the node parent.

Reimplemented in kge::sn::Bone.

virtual void kge::sn::SceneNode::SetPosition ( const math::Vector v)
virtual

Set the position of the scenenode.

Reimplemented in kge::sn::Camera, kge::sn::Listener, kge::sn::TPCamera, kge::sn::Light, and kge::sn::Sound3D.

virtual void kge::sn::SceneNode::SetRotation ( const math::Vector v)
virtual

Set the rotation of the scenenode.

virtual void kge::sn::SceneNode::SetScale ( const math::Vector v)
virtual

Set the scale of the scenenode.

virtual void kge::sn::SceneNode::SetSceneManager ( SceneManager smgr)
virtual

Sets the scene manager and renderer pointer.

virtual void kge::sn::SceneNode::SetVisible ( bool  isVisible)
virtual

Set Visible Enable or Disable.

virtual void kge::sn::SceneNode::UpdateFinalMat ( )
inlinevirtual

Update final matrix.

Reimplemented in kge::sn::StaticMesh, and kge::sn::Bone.

Definition at line 199 of file SceneNode.h.

Friends And Related Function Documentation

friend class SceneManager
friend

Definition at line 61 of file SceneNode.h.

Member Data Documentation

bool kge::sn::SceneNode::m_bAutoCulling
protected

Definition at line 207 of file SceneNode.h.

bool kge::sn::SceneNode::m_bVis
protected

Definition at line 207 of file SceneNode.h.

bool kge::sn::SceneNode::m_bVisFrame
protected

Definition at line 207 of file SceneNode.h.

NodeType kge::sn::SceneNode::m_eNodeType
protected

Definition at line 224 of file SceneNode.h.

bool kge::sn::SceneNode::m_hasShadow
protected

Definition at line 225 of file SceneNode.h.

int kge::sn::SceneNode::m_iID
protected

Definition at line 204 of file SceneNode.h.

math::AABB* kge::sn::SceneNode::m_pAABB
protected

Definition at line 223 of file SceneNode.h.

math::Matrix* kge::sn::SceneNode::m_pAbsMat
protected

Definition at line 217 of file SceneNode.h.

math::Sphere* kge::sn::SceneNode::m_pBB
protected

Definition at line 222 of file SceneNode.h.

math::Matrix * kge::sn::SceneNode::m_pFinalMat
protected

Definition at line 217 of file SceneNode.h.

math::Vector kge::sn::SceneNode::m_Position
protected

Definition at line 219 of file SceneNode.h.

SceneNode* kge::sn::SceneNode::m_pParent
protected

Definition at line 211 of file SceneNode.h.

gfx::Renderer* kge::sn::SceneNode::m_pRenderer
protected

Definition at line 206 of file SceneNode.h.

SceneManager* kge::sn::SceneNode::m_pSnMan
protected

Definition at line 205 of file SceneNode.h.

math::Vector kge::sn::SceneNode::m_Rotation
protected

Definition at line 219 of file SceneNode.h.

math::Vector kge::sn::SceneNode::m_Scale
protected

Definition at line 219 of file SceneNode.h.

core::String kge::sn::SceneNode::m_sName
protected

Definition at line 203 of file SceneNode.h.

std::vector< SceneNode*> kge::sn::SceneNode::m_vChilds
protected

Definition at line 213 of file SceneNode.h.

std::vector<efx ::Effect*> kge::sn::SceneNode::m_vEffect
protected

Definition at line 216 of file SceneNode.h.

std::vector<int> kge::sn::SceneNode::m_vEffectType
protected

Definition at line 214 of file SceneNode.h.


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