Drag[en]gine Game Engine  1.0
deOcclusionMesh Class Reference

Occlusion Mesh. Defines an occlusion mesh used to help graphic modules to improve occlusion testing if supported. Occlusion meshes are optional but potentially improve performance. Occlusion meshes are similar to models in that they support bone weights but they do not support LOD nor textures or texture coordinate sets. Faces are classified in single sided and double sided. Single sided is useful to define occlusion only in the direction in front of a faces. In contrary to models an occlusion mesh face can have more than 3 corners as long as they are all coplanar and convex. corners are the vertices used in the faces and are stored as a continuous array of vertex indices. Each face defines the number of corners it contains in clockwise order. More...

#include <deOcclusionMesh.h>

Inheritance diagram for deOcclusionMesh:
deFileResource deResource deObject

Public Member Functions

Management
bool Verify () const
 
void Prepare ()
 
Bones
int GetBoneCount () const
 
void SetBoneCount (int count)
 
deOcclusionMeshBoneGetBoneAt (int index) const
 
deOcclusionMeshBoneGetBones () const
 
int IndexOfBoneNamed (const char *name) const
 
bool HasBoneNamed (const char *name) const
 
Weight Sets
int GetWeightCount () const
 
void SetWeightCount (int count)
 
deOcclusionMeshWeightGetWeightAt (int index) const
 
deOcclusionMeshWeightGetWeights () const
 
int GetWeightGroupCount () const
 
void SetWeightGroupCount (int count)
 
int GetWeightGroupAt (int index) const
 
void SetWeightGroupAt (int index, int weightSetCount) const
 
int * GetWeightGroups () const
 
Vertices
int GetVertexCount () const
 
void SetVertexCount (int count)
 
deOcclusionMeshVertexGetVertexAt (int index) const
 
deOcclusionMeshVertexGetVertices () const
 
Corners
int GetCornerCount () const
 
void SetCornerCount (int count)
 
unsigned short GetCornerAt (int index) const
 
void SetCornerAt (int index, unsigned short vertexIndex)
 
unsigned short * GetCorners () const
 
Faces
int GetFaceCount () const
 
void SetFaceCount (int count)
 
int GetDoubleSidedFaceCount () const
 
void SetDoubleSidedFaceCount (int count)
 
unsigned short GetFaceAt (int index) const
 
void SetFaceAt (int index, unsigned short cornerCount)
 
unsigned short * GetFaces () const
 
System Peers
deBaseGraphicOcclusionMeshGetPeerGraphic () const
 
void SetPeerGraphic (deBaseGraphicOcclusionMesh *peer)
 
- Public Member Functions inherited from deFileResource
deVirtualFileSystemGetVirtualFileSystem () const
 Virtual file system or NULL if build from memory. More...
 
const decStringGetFilename () const
 Filename or empty string if build from memory. More...
 
bool GetAsynchron () const
 Resource is asynchron. More...
 
void SetAsynchron (bool asynchron)
 Set if resource is asynchron. More...
 
 deFileResource (deResourceManager *resourceManager, deVirtualFileSystem *vfs, const char *filename)
 Create file resource. More...
 
- Public Member Functions inherited from deResource
deResourceManagerGetResourceManager () const
 Resource manager or NULL if resource is leaking. More...
 
deEngineGetEngine () const
 Game engine object from resource manager. More...
 
deResourceGetLLManagerPrev () const
 Previous resource in the resource manager linked list. More...
 
void SetLLManagerPrev (deResource *resource)
 Set next resource in the resource manager linked list. More...
 
deResourceGetLLManagerNext () const
 Next resource in the resource manager linked list. More...
 
void SetLLManagerNext (deResource *resource)
 Set next resource in the resource manager linked list. More...
 
void MarkLeaking ()
 Marks the resource leaking. More...
 
 deResource (deResourceManager *resourceManager)
 Create resource. More...
 
- Public Member Functions inherited from deObject
int GetRefCount () const
 Reference count. More...
 
void AddReference ()
 Add reference increasing reference count by 1. More...
 
void FreeReference ()
 Decrease reference count by one and delete object if count reaches 0. More...
 
 deObject ()
 Create object with reference count of 1. More...
 

Constructors and Destructors

 deOcclusionMesh (deOcclusionMeshManager *manager, deVirtualFileSystem *vfs, const char *filename)
 
virtual ~deOcclusionMesh ()
 Clean up occlusion mesh. More...
 

Additional Inherited Members

- Protected Member Functions inherited from deFileResource
virtual ~deFileResource ()
 Clean up file resource. More...
 
- Protected Member Functions inherited from deResource
virtual ~deResource ()
 Clean up resource. More...
 
- Protected Member Functions inherited from deObject
virtual ~deObject ()
 Clean up object. More...
 

Detailed Description

Occlusion Mesh. Defines an occlusion mesh used to help graphic modules to improve occlusion testing if supported. Occlusion meshes are optional but potentially improve performance. Occlusion meshes are similar to models in that they support bone weights but they do not support LOD nor textures or texture coordinate sets. Faces are classified in single sided and double sided. Single sided is useful to define occlusion only in the direction in front of a faces. In contrary to models an occlusion mesh face can have more than 3 corners as long as they are all coplanar and convex. corners are the vertices used in the faces and are stored as a continuous array of vertex indices. Each face defines the number of corners it contains in clockwise order.

Author
Pl├╝ss Roland
Version
1.0
Date
2012

Constructor & Destructor Documentation

◆ deOcclusionMesh()

deOcclusionMesh::deOcclusionMesh ( deOcclusionMeshManager manager,
deVirtualFileSystem vfs,
const char *  filename 
)

Creates a new occlusion mesh with the given resource manager.

◆ ~deOcclusionMesh()

virtual deOcclusionMesh::~deOcclusionMesh ( )
protectedvirtual

Clean up occlusion mesh.

Note
Subclasses should set their destructor protected too to avoid users accidently deleting a reference counted object through the object pointer. Only FreeReference() is allowed to delete the object.

Member Function Documentation

◆ GetBoneAt()

deOcclusionMeshBone& deOcclusionMesh::GetBoneAt ( int  index) const

Retrieves a bone by index.

Referenced by GetBoneCount().

◆ GetBoneCount()

int deOcclusionMesh::GetBoneCount ( ) const
inline

Retrieves the number of bones.

References GetBoneAt(), and SetBoneCount().

◆ GetBones()

deOcclusionMeshBone* deOcclusionMesh::GetBones ( ) const
inline

Retrieves the pointer to the bones.

References HasBoneNamed(), and IndexOfBoneNamed().

◆ GetCornerAt()

unsigned short deOcclusionMesh::GetCornerAt ( int  index) const

Retrieves the corner at the given position.

Referenced by GetCornerCount().

◆ GetCornerCount()

int deOcclusionMesh::GetCornerCount ( ) const
inline

Retrieves the number of corners.

References GetCornerAt(), SetCornerAt(), and SetCornerCount().

◆ GetCorners()

unsigned short* deOcclusionMesh::GetCorners ( ) const
inline

Retrieves the pointer to the corners.

◆ GetDoubleSidedFaceCount()

int deOcclusionMesh::GetDoubleSidedFaceCount ( ) const
inline

Retrieves the number of faces at the end of the face list that are double sided not single sided.

References GetFaceAt(), SetDoubleSidedFaceCount(), and SetFaceAt().

◆ GetFaceAt()

unsigned short deOcclusionMesh::GetFaceAt ( int  index) const

Retrieves the corner count for the face at the given position.

Referenced by GetDoubleSidedFaceCount().

◆ GetFaceCount()

int deOcclusionMesh::GetFaceCount ( ) const
inline

Retrieves the number of faces.

References SetFaceCount().

◆ GetFaces()

unsigned short* deOcclusionMesh::GetFaces ( ) const
inline

Retrieves the pointer to the face corner counts.

◆ GetPeerGraphic()

deBaseGraphicOcclusionMesh* deOcclusionMesh::GetPeerGraphic ( ) const
inline

Retrieves the Graphic system peer.

References SetPeerGraphic().

◆ GetVertexAt()

deOcclusionMeshVertex& deOcclusionMesh::GetVertexAt ( int  index) const

Retrieves the vertex at the given position.

Referenced by GetVertexCount().

◆ GetVertexCount()

int deOcclusionMesh::GetVertexCount ( ) const
inline

Retrieves the number of vertices.

References GetVertexAt(), and SetVertexCount().

◆ GetVertices()

deOcclusionMeshVertex* deOcclusionMesh::GetVertices ( ) const
inline

Retrieves the pointer to the vertices.

◆ GetWeightAt()

deOcclusionMeshWeight& deOcclusionMesh::GetWeightAt ( int  index) const

Retrieves the weight at the given position.

Referenced by GetWeightCount().

◆ GetWeightCount()

int deOcclusionMesh::GetWeightCount ( ) const
inline

Retrieves the number of weights.

References GetWeightAt(), and SetWeightCount().

◆ GetWeightGroupAt()

int deOcclusionMesh::GetWeightGroupAt ( int  index) const

Retrieves the weight group at the given position.

Referenced by GetWeightGroupCount().

◆ GetWeightGroupCount()

int deOcclusionMesh::GetWeightGroupCount ( ) const
inline

Retrieves the number of weight groups.

References GetWeightGroupAt(), SetWeightGroupAt(), and SetWeightGroupCount().

◆ GetWeightGroups()

int* deOcclusionMesh::GetWeightGroups ( ) const
inline

Retrieves the pointer to the weight groups.

◆ GetWeights()

deOcclusionMeshWeight* deOcclusionMesh::GetWeights ( ) const
inline

Retrieves the pointer to the weights.

◆ HasBoneNamed()

bool deOcclusionMesh::HasBoneNamed ( const char *  name) const

Determiens if a bone with the given name exists.

Referenced by GetBones().

◆ IndexOfBoneNamed()

int deOcclusionMesh::IndexOfBoneNamed ( const char *  name) const

Retrieves the index of the bone with the given name or -1 if not found.

Referenced by GetBones().

◆ Prepare()

void deOcclusionMesh::Prepare ( )

Prepare mesh for later use.

◆ SetBoneCount()

void deOcclusionMesh::SetBoneCount ( int  count)

Sets the number of bones.

Referenced by GetBoneCount().

◆ SetCornerAt()

void deOcclusionMesh::SetCornerAt ( int  index,
unsigned short  vertexIndex 
)

Sets the corner at the given position.

Referenced by GetCornerCount().

◆ SetCornerCount()

void deOcclusionMesh::SetCornerCount ( int  count)

Sets the number of corners.

Referenced by GetCornerCount().

◆ SetDoubleSidedFaceCount()

void deOcclusionMesh::SetDoubleSidedFaceCount ( int  count)

Sets the number of faces at the end of the face list that are double sided not single sided.

Referenced by GetDoubleSidedFaceCount().

◆ SetFaceAt()

void deOcclusionMesh::SetFaceAt ( int  index,
unsigned short  cornerCount 
)

Sets the corner count for the face at the given position.

Referenced by GetDoubleSidedFaceCount().

◆ SetFaceCount()

void deOcclusionMesh::SetFaceCount ( int  count)

Sets the number of faces.

Referenced by GetFaceCount().

◆ SetPeerGraphic()

void deOcclusionMesh::SetPeerGraphic ( deBaseGraphicOcclusionMesh peer)

Sets the graphic system peer.

Referenced by GetPeerGraphic().

◆ SetVertexCount()

void deOcclusionMesh::SetVertexCount ( int  count)

Sets the number of vertices.

Referenced by GetVertexCount().

◆ SetWeightCount()

void deOcclusionMesh::SetWeightCount ( int  count)

Sets the number of weights.

Referenced by GetWeightCount().

◆ SetWeightGroupAt()

void deOcclusionMesh::SetWeightGroupAt ( int  index,
int  weightSetCount 
) const

Sets the weight group at the given position.

Referenced by GetWeightGroupCount().

◆ SetWeightGroupCount()

void deOcclusionMesh::SetWeightGroupCount ( int  count)

Sets the number of weight groups.

Referenced by GetWeightGroupCount().

◆ Verify()

bool deOcclusionMesh::Verify ( ) const

Verify the mesh.


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