Class XAnimatedMesh
- Namespace
- OmegaEngine.Assets
- Assembly
- OmegaEngine.dll
An animated mesh loaded from an .X file.
public class XAnimatedMesh : XMesh, IReferenceCount, IDisposable, INamed, IComparable<Asset>
- Inheritance
-
XAnimatedMesh
- Implements
- Inherited Members
- Extension Methods
Constructors
XAnimatedMesh(Engine, Stream, string)
Loads an animated mesh from an .X file.
protected XAnimatedMesh(Engine engine, Stream stream, string meshName)
Parameters
engine
EngineThe Engine providing rendering capabilities.
stream
StreamThe .X file to load the mesh from.
meshName
stringThe name of the mesh. This is used for finding associated textures.
Remarks
This should only be called from within Get(Engine, string) to prevent unnecessary duplicates.
Exceptions
- InvalidDataException
stream
does not contain a valid animated mesh.
Methods
Dispose(bool)
To be called by Dispose() and the object destructor.
protected override void Dispose(bool disposing)
Parameters
disposing
booltrue
if called manually and not by the garbage collector.
Get(Engine, string)
Returns a cached XAnimatedMesh or creates a new one if the requested ID is not cached.
public static XAnimatedMesh Get(Engine engine, string id)
Parameters
engine
EngineThe Engine providing the cache and rendering capabilities.
id
stringThe ID of the asset to be returned.
Returns
- XAnimatedMesh
The requested asset;
null
ifid
was empty.
Remarks
Remember to call Clean() when done, otherwise this object will never be released.
Exceptions
- FileNotFoundException
The specified file could not be found.
- IOException
There was an error reading the file.
- UnauthorizedAccessException
Read access to the file is not permitted.
- InvalidDataException
The file does not contain a valid animated mesh.