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

MeshEntity Class Reference

#include <mesh.h>

Inheritance diagram for MeshEntity:

Inheritance graph
[legend]
Collaboration diagram for MeshEntity:

Collaboration graph
[legend]
List of all members.

Detailed Description

An instance of a mesh in a scene A mesh scene entity, an instance of a mesh.

Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 DefineVisitable () public
 Mesh flags.

 MeshEntity (const MeshPtr &pkMesh)
 MeshEntity (MeshEntity &rkMesh)
virtual ~MeshEntity ()
virtual bool Render (Frustum *pkFrustum=0, bool bForce=false)
virtual void Update (float fDeltaTime)
virtual SceneEntityDuplicate ()
virtual bool Intersection (BoundingVolume *pkObj, ContactSet *pkContactSet=0, bool bInvertNormal=false)
virtual bool Intersection (const Ray &rkRay, ContactSet *pkContactSet=0)
void SetSubMeshAnimation (const HashString &rstrAnimation)
void SetSubMeshAnimation (unsigned int uiAnimation)
virtual void SetFlags (unsigned int uiFlags)
virtual void ResetFlags (unsigned int uiFlags)
const std::vector< SubMesh * > & GetSubMeshes () const
SkeletonGetSkeleton ()
MeshPtr GetMesh ()
void GenerateBoundingVolume ()
SceneNodeGetSceneNode ()
BoundingVolumeGetBoundingVolume ()
void SetBoundingVolume (BoundingVolume *pkBoundingVolume)
bool IsActive () const
virtual void Activate ()
virtual void Deactivate ()
bool Toggle ()
virtual void Accept (BaseVisitor &rkVisitor)=0

Public Attributes

unsigned int m_uiLastFrame

Static Public Attributes

unsigned int s_uiFrameCount

Protected Member Functions

virtual void SetNode ()

Static Protected Member Functions

template<class NodeType> void AcceptImpl (NodeType &rkVisited, BaseVisitor &rkVisitor)

Protected Attributes

MeshPtr m_pkMesh
Skeletonm_pkSkeleton
std::vector< SubMesh * > m_vpkSubMeshes
unsigned int m_uiFlags
SceneNodem_pkNode
BoundingVolumem_pkBoundingVolume
bool m_bActive


Constructor & Destructor Documentation

MeshEntity const MeshPtr &  pkMesh  ) 
 

Parameters:
pkMesh Mesh to instantiate

MeshEntity MeshEntity rkMesh  ) 
 

Parameters:
rkMeshEntity Mesh entity to copy

virtual ~MeshEntity  )  [virtual]
 


Member Function Documentation

DefineVisitable  )  [inline]
 

Mesh flags.

Use only bounding volume for intersection tests

Automatically re-generate bounding volume when submeshes change

Reimplemented from SceneEntity.

virtual void SetNode  )  [protected, virtual]
 

Called by scene node when we have been set to a node

Reimplemented from SceneEntity.

virtual bool Render Frustum pkFrustum = 0,
bool  bForce = false
[virtual]
 

Render this mesh instance

Parameters:
pkFrustum Current frustum
bForce If true, force rendering even if already rendered this frame
Returns:
true if rendered, false if already rendered this frame and not forced

Reimplemented from RenderEntity.

virtual void Update float  fDeltaTime  )  [virtual]
 

Update this mesh instance

Parameters:
fDeltaTime Delta time passed

Reimplemented from UpdateEntity.

virtual SceneEntity* Duplicate  )  [virtual]
 

Duplicate mesh (create new entity based on mesh)

Returns:
New mesh entity that is exact copy of this entity

Reimplemented from SceneEntity.

virtual bool Intersection BoundingVolume pkObj,
ContactSet pkContactSet = 0,
bool  bInvertNormal = false
[virtual]
 

Intersection test with unknown object type

Parameters:
pkObj Bounding volume object to test for intersection with
pkContactSet Contact set object receiving collision contact data, 0 if not needed
bInvertNormal If false, collision normal will point from passed object to this. If true, normal will point in other direction
Returns:
true if volumes intersect, false if not

Reimplemented from SceneEntity.

virtual bool Intersection const Ray rkRay,
ContactSet pkContactSet = 0
[virtual]
 

Intersection test with ray

Parameters:
rkRay Ray
pkContactSet Contact set object receiving collision contact data, 0 if not needed
Returns:
true if volumes intersect, false if not

Reimplemented from SceneEntity.

void SetSubMeshAnimation const HashString rstrAnimation  ) 
 

Set animation on all animated submeshes

Parameters:
rstrAnimation Animation name

void SetSubMeshAnimation unsigned int  uiAnimation  ) 
 

Set animation on all animated submeshes

Parameters:
uiAnimation Animation ID

virtual void SetFlags unsigned int  uiFlags  )  [virtual]
 

Set flags

Parameters:
uiFlags Flags to set

virtual void ResetFlags unsigned int  uiFlags  )  [virtual]
 

Reset flags

Parameters:
uiFlags Flags to reset

const std::vector< SubMesh* >& GetSubMeshes  )  const [inline]
 

Returns:
All submeshes

Skeleton* GetSkeleton  )  [inline]
 

Returns:
Skeleton (if any)

MeshPtr GetMesh  )  [inline]
 

Returns:
Mesh blueprint this entity was instantiated from

void GenerateBoundingVolume  ) 
 

Generate bounding volume from submesh vertices

SceneNode* GetSceneNode  )  [inline, inherited]
 

Returns:
parent scene node

BoundingVolume* GetBoundingVolume  )  [inline, inherited]
 

Returns:
Bounding volume

void SetBoundingVolume BoundingVolume pkBoundingVolume  )  [inherited]
 

Set new bounding volume object. Old bounding volume object will be deleted. The new bounding volume SRT data should be in LOCAL space, the world space SRT data will be calculated internally

Parameters:
pkBoundingVolume New bounding volume object

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

void AcceptImpl NodeType &  rkVisited,
BaseVisitor rkVisitor
[inline, static, protected, inherited]
 

Accept visitors if implementation available

Parameters:
rkVisited Node being visited
rkVisitor Visitor

virtual void Accept BaseVisitor rkVisitor  )  [pure virtual, inherited]
 

Accept a visitor

Parameters:
rkVisitor Visitor


Member Data Documentation

MeshPtr m_pkMesh [protected]
 

Mesh blueprint this object instantiates

Skeleton* m_pkSkeleton [protected]
 

Skeleton

std::vector< SubMesh* > m_vpkSubMeshes [protected]
 

Sub meshes

unsigned int m_uiFlags [protected]
 

Flags

SceneNode* m_pkNode [protected, inherited]
 

Parent scene node object

BoundingVolume* m_pkBoundingVolume [protected, inherited]
 

Bounding volume for this entity

bool m_bActive [protected, inherited]
 

Active flag

unsigned int s_uiFrameCount [static, inherited]
 

Frame counter (at 500 frames per second, can be active ~100 days continously before loop, and then it will just skip one frame -> safe enough)

unsigned int m_uiLastFrame [inherited]
 

Last frame count we were rendered


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