Drag[en]gine Game Engine  1.0
deModel Class Reference

Model Resource. Models represent the geometry of a component to render in a scene. A model keeps track of bones, textures, weights, vertices, faces, normals and tangents. Furthermore additional named texture coordinate sets can be defined. More...

#include <deModel.h>

Inheritance diagram for deModel:
deFileResource deResource deObject

Classes

struct  sHackWeight
 

Public Member Functions

Management
decStringListGetTextureCoordinatesSetList ()
 
const decStringListGetTextureCoordinatesSetList () const
 
const decVectorGetMinimumExtend () const
 
const decVectorGetMaximumExtend () const
 
bool GetHasWeightlessExtends () const
 Weightless extends are present. More...
 
const decVectorGetWeightlessMinExtend () const
 Minimum extend of vertices without weights. More...
 
const decVectorGetWeightlessMaxExtend () const
 maximum extend of vertices without weights. More...
 
int GetNormalCount () const
 
const decVectorGetNormalAt (int index) const
 
int GetTangentCount () const
 
const decVectorGetTangentAt (int index) const
 
sHackWeightGetHackWeights () const
 
int GetHackWeightCount () const
 
Loading
bool Verify ()
 
void Prepare ()
 
Bone Management
int GetBoneCount () const
 
deModelBoneGetBoneAt (int index) const
 
int IndexOfBoneNamed (const char *name) const
 
bool HasBoneNamed (const char *name) const
 
void AddBone (deModelBone *bone)
 
Texture Management
int GetTextureCount () const
 
deModelTextureGetTextureAt (int index) const
 
int IndexOfTextureNamed (const char *name) const
 
bool HasTextureNamed (const char *name) const
 
void AddTexture (deModelTexture *texture)
 
LOD Management
int GetLODCount () const
 
deModelLODGetLODAt (int index) const
 
void AddLOD (deModelLOD *lod)
 
System Peers
deBaseGraphicModelGetGraphicModel () const
 
void SetGraphicModel (deBaseGraphicModel *peer)
 
deBaseAudioModelGetAudioModel () const
 
void SetAudioModel (deBaseAudioModel *peer)
 
deBasePhysicsModelGetPhysicsModel () const
 
void SetPhysicsModel (deBasePhysicsModel *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

 deModel (deModelManager *manager, deVirtualFileSystem *vfs, const char *filename)
 
virtual ~deModel ()
 Clean up model. 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

Model Resource. Models represent the geometry of a component to render in a scene. A model keeps track of bones, textures, weights, vertices, faces, normals and tangents. Furthermore additional named texture coordinate sets can be defined.

Author
Pl├╝ss Roland
Version
1.0
Date
2019

Constructor & Destructor Documentation

◆ deModel()

deModel::deModel ( deModelManager manager,
deVirtualFileSystem vfs,
const char *  filename 
)

Creates a new model object with the given resource manager and filename.

◆ ~deModel()

virtual deModel::~deModel ( )
protectedvirtual

Clean up model.

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

◆ AddBone()

void deModel::AddBone ( deModelBone bone)

Adds a new bone with the given name.

Referenced by GetBoneCount().

◆ AddLOD()

void deModel::AddLOD ( deModelLOD lod)

Adds a new LOD mesh.

Referenced by GetLODCount().

◆ AddTexture()

void deModel::AddTexture ( deModelTexture texture)

Adds a new texture with the given name and size.

Referenced by GetTextureCount().

◆ GetAudioModel()

deBaseAudioModel* deModel::GetAudioModel ( ) const
inline

Retrieves the physics system peer.

References SetAudioModel().

◆ GetBoneAt()

deModelBone* deModel::GetBoneAt ( int  index) const

Retrieves the bone at the given index.

Referenced by GetBoneCount().

◆ GetBoneCount()

int deModel::GetBoneCount ( ) const
inline

Retrieves the count of bones.

References AddBone(), GetBoneAt(), HasBoneNamed(), and IndexOfBoneNamed().

◆ GetGraphicModel()

deBaseGraphicModel* deModel::GetGraphicModel ( ) const
inline

Retrieves the graphic system peer.

References SetGraphicModel().

◆ GetHackWeightCount()

int deModel::GetHackWeightCount ( ) const
inline

References Prepare(), and Verify().

◆ GetHackWeights()

sHackWeight* deModel::GetHackWeights ( ) const
inline

◆ GetHasWeightlessExtends()

bool deModel::GetHasWeightlessExtends ( ) const
inline

Weightless extends are present.

◆ GetLODAt()

deModelLOD* deModel::GetLODAt ( int  index) const

Retrieves the LOD mesh at the given index.

Referenced by GetLODCount().

◆ GetLODCount()

int deModel::GetLODCount ( ) const
inline

Retrieves the count of LOD meshes.

References AddLOD(), and GetLODAt().

◆ GetMaximumExtend()

const decVector& deModel::GetMaximumExtend ( ) const
inline

Retrieves the maximum extends.

◆ GetMinimumExtend()

const decVector& deModel::GetMinimumExtend ( ) const
inline

Retrieves the minimum extends.

◆ GetNormalAt()

const decVector& deModel::GetNormalAt ( int  index) const

Referenced by GetNormalCount().

◆ GetNormalCount()

int deModel::GetNormalCount ( ) const
inline

References GetNormalAt().

◆ GetPhysicsModel()

deBasePhysicsModel* deModel::GetPhysicsModel ( ) const
inline

Retrieves the physics system peer.

References SetPhysicsModel().

◆ GetTangentAt()

const decVector& deModel::GetTangentAt ( int  index) const

Referenced by GetTangentCount().

◆ GetTangentCount()

int deModel::GetTangentCount ( ) const
inline

References GetTangentAt().

◆ GetTextureAt()

deModelTexture* deModel::GetTextureAt ( int  index) const

Retrieves the texture at the given index.

Referenced by GetTextureCount().

◆ GetTextureCoordinatesSetList() [1/2]

decStringList& deModel::GetTextureCoordinatesSetList ( )
inline

Retrieves the list of texture coordinates sets names.

◆ GetTextureCoordinatesSetList() [2/2]

const decStringList& deModel::GetTextureCoordinatesSetList ( ) const
inline

◆ GetTextureCount()

int deModel::GetTextureCount ( ) const
inline

Retrieves the count of textures.

References AddTexture(), GetTextureAt(), HasTextureNamed(), and IndexOfTextureNamed().

◆ GetWeightlessMaxExtend()

const decVector& deModel::GetWeightlessMaxExtend ( ) const
inline

maximum extend of vertices without weights.

◆ GetWeightlessMinExtend()

const decVector& deModel::GetWeightlessMinExtend ( ) const
inline

Minimum extend of vertices without weights.

◆ HasBoneNamed()

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

Determiens if a bone with the given name exists.

Referenced by GetBoneCount().

◆ HasTextureNamed()

bool deModel::HasTextureNamed ( const char *  name) const

Determiens if a texture with the given name exists.

Referenced by GetTextureCount().

◆ IndexOfBoneNamed()

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

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

Referenced by GetBoneCount().

◆ IndexOfTextureNamed()

int deModel::IndexOfTextureNamed ( const char *  name) const

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

Referenced by GetTextureCount().

◆ Prepare()

void deModel::Prepare ( )

Prepare model for later use.

Referenced by GetHackWeightCount().

◆ SetAudioModel()

void deModel::SetAudioModel ( deBaseAudioModel peer)

Sets the physics system peer.

Referenced by GetAudioModel().

◆ SetGraphicModel()

void deModel::SetGraphicModel ( deBaseGraphicModel peer)

Sets the graphic system peer.

Referenced by GetGraphicModel().

◆ SetPhysicsModel()

void deModel::SetPhysicsModel ( deBasePhysicsModel peer)

Sets the physics system peer.

Referenced by GetPhysicsModel().

◆ Verify()

bool deModel::Verify ( )

Verifies that the data in the model are valid.

Referenced by GetHackWeightCount().


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