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

A mesh loaded from an .X file. More...

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

Public Member Functions

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...
 

Static Public Member Functions

static XMesh Get (Engine engine, string id)
 Returns a cached XMesh or creates a new one if the requested ID is not cached. More...
 

Public Attributes

readonly XMaterial [] Materials
 Materials (diffuse/normal/height/specular map, lighting settings) associated with the mesh More...
 
Mesh Mesh => _mesh
 

Protected Member Functions

 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...
 

Properties

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

A mesh loaded from an .X file.

See also
Model

Constructor & Destructor Documentation

◆ XMesh()

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

Loads a static 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 mesh.

This should only be called by Get to prevent unnecessary duplicates.

Member Function Documentation

◆ Dispose()

override void OmegaEngine.Assets.XMesh.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 XMesh OmegaEngine.Assets.XMesh.Get ( Engine  engine,
string  id 
)
inlinestatic

Returns a cached XMesh 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 mesh.

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

Member Data Documentation

◆ Materials

readonly XMaterial [] OmegaEngine.Assets.XMesh.Materials

Materials (diffuse/normal/height/specular map, lighting settings) associated with the mesh

Property Documentation

◆ BoundingBox

BoundingBox OmegaEngine.Assets.XMesh.BoundingBox
getprotected set

A bounding box surrounding this mesh

◆ BoundingSphere

BoundingSphere OmegaEngine.Assets.XMesh.BoundingSphere
getprotected set

A bounding sphere surrounding this mesh


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