OmegaEngine API  1.0.3
Static Public Member Functions | Protected Member Functions | List of all members
OmegaEngine.Assets.XAnimatedMesh Class Reference

An animated mesh loaded from an .X file. More...

Inheritance diagram for OmegaEngine.Assets.XAnimatedMesh:
OmegaEngine.Assets.XMesh OmegaEngine.Assets.Asset OmegaEngine.Assets.IReferenceCount NanoByte.Common.INamed< Asset >

Static Public Member Functions

static new XAnimatedMesh Get (Engine engine, string id)
 Returns a cached XAnimatedMesh or creates a new one if the requested ID is not cached. More...
 
- Static Public Member Functions inherited from OmegaEngine.Assets.XMesh
static XMesh Get (Engine engine, string id)
 Returns a cached XMesh or creates a new one if the requested ID is not cached. More...
 

Protected Member Functions

 XAnimatedMesh (Engine engine, Stream stream, string meshName)
 Loads an animated mesh from an .X file. More...
 
override void Dispose (bool disposing)
 To be called by IDisposable.Dispose and the object destructor. More...
 
- Protected Member Functions inherited from OmegaEngine.Assets.XMesh
 XMesh (Engine engine, Stream stream, string meshName)
 Loads a static mesh from an .X file. More...
 
override void Dispose (bool disposing)
 To be called by IDisposable.Dispose and the object destructor. More...
 

Additional Inherited Members

- Public Member Functions inherited from OmegaEngine.Assets.XMesh
override void HoldReference ()
 Increments the ReferenceCount by one.
 
override void ReleaseReference ()
 Decrements the ReferenceCount by one.
 
- Public Member Functions inherited from OmegaEngine.Assets.Asset
override string ToString ()
 
void Dispose ()
 Disposes the internal DirectX resources of this asset. More...
 
- Public Attributes inherited from OmegaEngine.Assets.XMesh
readonly XMaterial [] Materials
 Materials (diffuse/normal/height/specular map, lighting settings) associated with the mesh More...
 
Mesh Mesh => _mesh
 
- Properties inherited from OmegaEngine.Assets.XMesh
BoundingSphere BoundingSphere [get, protected set]
 A bounding sphere surrounding this mesh More...
 
BoundingBox BoundingBox [get, protected set]
 A bounding box surrounding this mesh More...
 
- Properties inherited from OmegaEngine.Assets.Asset
string Name [get, set]
 The filename More...
 
int ReferenceCount [get]
 How many Renderables use this asset More...
 
bool Disposed [get]
 Was this asset already disposed? More...
 
- Properties inherited from NanoByte.Common.INamed< Asset >
string Name
 

Detailed Description

An animated mesh loaded from an .X file.

See also
AnimatedModel

Constructor & Destructor Documentation

◆ XAnimatedMesh()

OmegaEngine.Assets.XAnimatedMesh.XAnimatedMesh ( Engine  engine,
Stream  stream,
string  meshName 
)
inlineprotected

Loads an animated mesh from an .X file.

Parameters
engineThe Engine providing rendering capabilities.
streamThe .X file to load the mesh from.
meshNameThe name of the mesh. This is used for finding associated textures.
Exceptions
InvalidDataExceptionstream does not contain a valid animated mesh.

This should only be called from within Get to prevent unnecessary duplicates.

Member Function Documentation

◆ Dispose()

override void OmegaEngine.Assets.XAnimatedMesh.Dispose ( bool  disposing)
inlineprotectedvirtual

To be called by IDisposable.Dispose and the object destructor.

Parameters
disposingtrue if called manually and not by the garbage collector.

Reimplemented from OmegaEngine.Assets.Asset.

◆ Get()

static new XAnimatedMesh OmegaEngine.Assets.XAnimatedMesh.Get ( Engine  engine,
string  id 
)
inlinestatic

Returns a cached XAnimatedMesh or creates a new one if the requested ID is not cached.

Parameters
engineThe Engine providing the cache and rendering capabilities.
idThe ID of the asset to be returned.
Returns
The requested asset; null if id was empty.
Exceptions
FileNotFoundExceptionThe specified file could not be found.
IOExceptionThere was an error reading the file.
UnauthorizedAccessExceptionRead access to the file is not permitted.
InvalidDataExceptionThe file does not contain a valid animated mesh.

Remember to call CacheManager.Clean when done, otherwise this object will never be released.


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