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
engineEngineThe Engine providing rendering capabilities.
streamStreamThe .X file to load the mesh from.
meshNamestringThe 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
streamdoes 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
disposingbooltrueif 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
engineEngineThe Engine providing the cache and rendering capabilities.
idstringThe ID of the asset to be returned.
Returns
- XAnimatedMesh
The requested asset;
nullifidwas 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.