Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

SubMesh Class Reference

#include <submesh.h>

Inheritance diagram for SubMesh:

Inheritance graph
[legend]
Collaboration diagram for SubMesh:

Collaboration graph
[legend]
List of all members.

Detailed Description

A chunk of polygons of same material.

Author:
Mattias Jansson (mattias@realityrift.com

Todo:
Perhaps derive from BoundingVolume to let parent Mesh do collision detection with us rather that one big volume itself


Public Types

enum  SUBMESHTYPE { SUBMESH = 0x0001, ANIMATEDSUBMESH = 0x0002, SKELETALSUBMESH = 0x0003, PATCHSURFACE = 0x0004 }
 Supported sub mesh types. More...


Public Member Functions

 SubMesh ()
 SubMesh (const SubMesh &rkSubMesh)
virtual ~SubMesh ()
virtual void Update (float fDeltaTime)
virtual VertexBufferPtrGetVertexBuffer ()
virtual PolygonBufferPtr & GetPolygonBuffer ()
virtual void SetVertexBuffer (VertexBufferPtr pkVertices)
virtual void SetPolygonBuffer (PolygonBufferPtr pkPolygons)
virtual void SetShadowVertexBuffer (VertexBufferPtr pkVertices)
virtual void SetShadowPolygonBuffer (PolygonBufferPtr pkPolygons)
virtual SubMeshDuplicate () const
virtual unsigned int GetType () const
virtual void Render (RenderPrimitive *pkPrimitive, Frustum *pkFrustum=0)
bool IsActive () const
virtual void Activate ()
virtual void Deactivate ()
bool Toggle ()

Public Attributes

MaterialPtr m_pkMaterial
bool m_bChanged

Protected Member Functions

virtual void UpdateData ()

Protected Attributes

VertexBufferPtr m_pkVertices
PolygonBufferPtr m_pkPolygons
bool m_bNeedUpdate
VertexBufferPtr m_pkShadowVertices
PolygonBufferPtr m_pkShadowPolygons
bool m_bActive


Member Enumeration Documentation

enum SUBMESHTYPE
 

Supported sub mesh types.

Enumeration values:
SUBMESH  Plain static submesh
ANIMATEDSUBMESH  Vertex-animated submesh
SKELETALSUBMESH  Skeletal-animated (skinned) submesh
PATCHSURFACE  Patch surface submesh (bezier, nurbs...)


Constructor & Destructor Documentation

SubMesh  ) 
 

SubMesh const SubMesh rkSubMesh  ) 
 

Parameters:
rkSubMesh Reference submesh object to copy data from

virtual ~SubMesh  )  [virtual]
 


Member Function Documentation

virtual void UpdateData  )  [protected, virtual]
 

Update data

Reimplemented in AnimatedSubMesh, PatchSurfaceSubMesh, and SkeletalSubMesh.

virtual void Update float  fDeltaTime  )  [virtual]
 

Update this submesh

Parameters:
fDeltaTime Delta time passed

Reimplemented from UpdateEntity.

Reimplemented in AnimatedSubMesh, and SkeletalSubMesh.

virtual VertexBufferPtr& GetVertexBuffer  )  [inline, virtual]
 

Returns:
Vertex buffer

Reimplemented in SkeletalSubMesh.

virtual PolygonBufferPtr& GetPolygonBuffer  )  [inline, virtual]
 

Returns:
Polygon buffer

virtual void SetVertexBuffer VertexBufferPtr  pkVertices  )  [virtual]
 

Parameters:
pkVertices New vertex buffer

Reimplemented in PatchSurfaceSubMesh.

virtual void SetPolygonBuffer PolygonBufferPtr  pkPolygons  )  [virtual]
 

Parameters:
pkPolygons New polygon buffer

Reimplemented in PatchSurfaceSubMesh.

virtual void SetShadowVertexBuffer VertexBufferPtr  pkVertices  )  [virtual]
 

Parameters:
pkVertices New shadow vertex buffer

virtual void SetShadowPolygonBuffer PolygonBufferPtr  pkPolygons  )  [virtual]
 

Parameters:
pkPolygons New shadow polygon buffer

virtual SubMesh* Duplicate  )  const [virtual]
 

Returns:
new submesh that is duplicate of this

Reimplemented in AnimatedSubMesh, PatchSurfaceSubMesh, and SkeletalSubMesh.

virtual unsigned int GetType  )  const [inline, virtual]
 

Returns:
Sub mesh type

Reimplemented in AnimatedSubMesh, PatchSurfaceSubMesh, and SkeletalSubMesh.

virtual void Render RenderPrimitive pkPrimitive,
Frustum pkFrustum = 0
[virtual]
 

Render submesh geometry

Parameters:
pkPrimitive Presetup render primitive object (needed for inverse mesh transform matrix)
pkFrustum Current view frustum

bool IsActive  )  const [inline, inherited]
 

Query state of object

Returns:
true if active, false if not

void Activate  )  [inline, virtual, inherited]
 

Activate object

void Deactivate  )  [inline, virtual, inherited]
 

Deactivate object

bool Toggle  )  [inline, inherited]
 

Toggle active state. This method does not need to be overloaded, it is only a wrapper to Activate and Deactivate

Returns:
true if activated, false if deactivated


Member Data Documentation

VertexBufferPtr m_pkVertices [protected]
 

Vertex buffer

PolygonBufferPtr m_pkPolygons [protected]
 

Polygon buffer

bool m_bNeedUpdate [protected]
 

Flag indicating update needed

VertexBufferPtr m_pkShadowVertices [protected]
 

Shadow vertex buffer

PolygonBufferPtr m_pkShadowPolygons [protected]
 

Shadow polygon buffer

MaterialPtr m_pkMaterial
 

Material

bool m_bChanged
 

Flag indicating geometry has changed

bool m_bActive [protected, inherited]
 

Active flag


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:15 2004 for NeoEngine by doxygen 1.3.5