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

#include <Mesh.h>

Inheritance diagram for kge::sn::Mesh:
kge::sn::SceneNode kge::KgeUnknown

Public Member Functions

 Mesh ()
 Constructor.
 Mesh (SceneManager *sn, gfx::Renderer *rn)
 ~Mesh ()
void PreRender (float elapsedTime=0.0f)
 Karhayee ke Ghabl az render bayad anjam shvad. Mesle colision detection.
void Render ()
 Render the mesh.
void Render (bool bPosition, bool bNormalTexcoord, bool bTangentBinormal)
 Render with options.
virtual void PostRender ()
 Karhaee ke bad az render bayad anjam beshe.
virtual bool AddEffect (efx::EffectType p, efx::Effect **ppOut)
virtual void Draw (bool WithMaterial, bool WithTransform, bool bPosition, bool bNormalTexcoord, bool bTangentBinormal)
virtual void PrepareBuffers (bool CreateTangents=false, bool Dynamic=false)
virtual void RefillBuffers ()
 Refills vertex and index buffers.
- Public Member Functions inherited from kge::sn::SceneNode
 SceneNode ()
 Constructor.
virtual ~SceneNode ()
 Destructor.
virtual void AddChild (SceneNode *child)
 Adds a node as child.
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.

Public Attributes

core::String m_sName
gfx::Vertex3TNm_pVerts
gfx::Vertex3m_pPos
gfx::Vertex3Tm_pNorTex
gfx::VertexNTCm_pNorTexColor
gfx::Vertex3m_pTangentBinormal
u16m_pIndices
u32m_pIndices32
u32 m_NumVerts
u32 m_NumIndices
gfx::HardwareBufferm_pIndexBuffer
gfx::HardwareBufferm_pvbPosition
gfx::HardwareBufferm_pvbNormalTexcoord
gfx::HardwareBufferm_pvbTangentBinormal
s16m_Bone
bool m_bHasMat
 Has a material?
bool m_bInstanced
 Instanced mesh.
gfx::Material m_Mat
gfx::Rendererm_pRenderer
gfx::VertexDecm_pVertexDec

Protected Member Functions

void CreateMirrorPlane (efx::Effect **ppCreatedMirror)
void CreateShadowPlane (efx::Effect **ppCreatedShadow, math::Vector &vLightDir)
void CreateTangentBinormalBuffers (bool Dynamic)
 Create tangent and binormal buffers.
void PrepareBuffers2 (bool CreateTangents, bool Dynamic)
 Prepare the buffers for multi stream.
void CreateTangentBinormalBuffers2 (bool Dynamic)
 Create tangent and binormal buffers.
- Protected Member Functions inherited from kge::sn::SceneNode
virtual bool HasThisEffect (efx::EffectType p)
- Protected Member Functions inherited from kge::KgeUnknown
void SetDebugText (char *text)

Friends

class MeshMS3D

Additional Inherited Members

- Protected Attributes inherited from kge::sn::SceneNode
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

Detailed Description

Definition at line 21 of file Mesh.h.

Constructor & Destructor Documentation

kge::sn::Mesh::Mesh ( )

Constructor.

kge::sn::Mesh::Mesh ( SceneManager sn,
gfx::Renderer rn 
)

Constructor.

Parameters
snA pointer to SceneManager.
rnA pointer to Renderer.
kge::sn::Mesh::~Mesh ( )

Member Function Documentation

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

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 from kge::sn::SceneNode.

void kge::sn::Mesh::CreateMirrorPlane ( efx::Effect **  ppCreatedMirror)
protected
void kge::sn::Mesh::CreateShadowPlane ( efx::Effect **  ppCreatedShadow,
math::Vector vLightDir 
)
protected
void kge::sn::Mesh::CreateTangentBinormalBuffers ( bool  Dynamic)
protected

Create tangent and binormal buffers.

void kge::sn::Mesh::CreateTangentBinormalBuffers2 ( bool  Dynamic)
protected

Create tangent and binormal buffers.

virtual void kge::sn::Mesh::Draw ( bool  WithMaterial,
bool  WithTransform,
bool  bPosition,
bool  bNormalTexcoord,
bool  bTangentBinormal 
)
virtual

Draw the mesh with/without its Materials and Transforms.

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

Implements kge::sn::SceneNode.

virtual void kge::sn::Mesh::PostRender ( )
virtual

Karhaee ke bad az render bayad anjam beshe.

Implements kge::sn::SceneNode.

virtual void kge::sn::Mesh::PrepareBuffers ( bool  CreateTangents = false,
bool  Dynamic = false 
)
virtual

Prepare the buffers for multi stream

void kge::sn::Mesh::PrepareBuffers2 ( bool  CreateTangents,
bool  Dynamic 
)
protected

Prepare the buffers for multi stream.

void kge::sn::Mesh::PreRender ( float  elapsedTime = 0.0f)
virtual

Karhayee ke Ghabl az render bayad anjam shvad. Mesle colision detection.

Implements kge::sn::SceneNode.

virtual void kge::sn::Mesh::RefillBuffers ( )
virtual

Refills vertex and index buffers.

void kge::sn::Mesh::Render ( )
virtual

Render the mesh.

Implements kge::sn::SceneNode.

void kge::sn::Mesh::Render ( bool  bPosition,
bool  bNormalTexcoord,
bool  bTangentBinormal 
)

Render with options.

Friends And Related Function Documentation

friend class MeshMS3D
friend

Definition at line 23 of file Mesh.h.

Member Data Documentation

bool kge::sn::Mesh::m_bHasMat

Has a material?

Definition at line 89 of file Mesh.h.

bool kge::sn::Mesh::m_bInstanced

Instanced mesh.

Definition at line 90 of file Mesh.h.

s16* kge::sn::Mesh::m_Bone

Definition at line 87 of file Mesh.h.

gfx::Material kge::sn::Mesh::m_Mat

Definition at line 92 of file Mesh.h.

u32 kge::sn::Mesh::m_NumIndices

Definition at line 79 of file Mesh.h.

u32 kge::sn::Mesh::m_NumVerts

Definition at line 79 of file Mesh.h.

gfx::HardwareBuffer* kge::sn::Mesh::m_pIndexBuffer

Definition at line 82 of file Mesh.h.

u16* kge::sn::Mesh::m_pIndices

Definition at line 76 of file Mesh.h.

u32* kge::sn::Mesh::m_pIndices32

Definition at line 77 of file Mesh.h.

gfx::Vertex3T* kge::sn::Mesh::m_pNorTex

Definition at line 73 of file Mesh.h.

gfx::VertexNTC* kge::sn::Mesh::m_pNorTexColor

Definition at line 74 of file Mesh.h.

gfx::Vertex3* kge::sn::Mesh::m_pPos

Definition at line 72 of file Mesh.h.

gfx::Renderer* kge::sn::Mesh::m_pRenderer

Definition at line 94 of file Mesh.h.

gfx::Vertex3* kge::sn::Mesh::m_pTangentBinormal

Definition at line 75 of file Mesh.h.

gfx::HardwareBuffer * kge::sn::Mesh::m_pvbNormalTexcoord

Definition at line 82 of file Mesh.h.

gfx::HardwareBuffer * kge::sn::Mesh::m_pvbPosition

Definition at line 82 of file Mesh.h.

gfx::HardwareBuffer * kge::sn::Mesh::m_pvbTangentBinormal

Definition at line 82 of file Mesh.h.

gfx::VertexDec* kge::sn::Mesh::m_pVertexDec

Definition at line 96 of file Mesh.h.

gfx::Vertex3TN* kge::sn::Mesh::m_pVerts

Definition at line 71 of file Mesh.h.

core::String kge::sn::Mesh::m_sName

Definition at line 69 of file Mesh.h.


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