Table of Contents

Class SkinnedMeshModel

Namespace
LibGFX.Graphics
Assembly
LibGFX.dll

Skinned mesh model with support for skeletal animation

public class SkinnedMeshModel : IModel, IFileAsset, IGraphicsResource, IIdentifier, ISerialization
Inheritance
SkinnedMeshModel
Implements
Inherited Members

Constructors

SkinnedMeshModel()

Initializes a new instance of the SkinnedMeshModel class. Used for deserialization purposes.

public SkinnedMeshModel()

SkinnedMeshModel(string)

Loads a skinned mesh model from the specified file.

public SkinnedMeshModel(string file)

Parameters

file string

Properties

Animations

Gets or sets the collection of 3D animations associated with this object.

public List<Animation3D> Animations { get; set; }

Property Value

List<Animation3D>

FilePath

Gets or sets the full path to the file associated with this instance.

public string FilePath { get; set; }

Property Value

string

HasTransparency

Gets a value indicating whether the current image contains any transparent pixels.

public bool HasTransparency { get; }

Property Value

bool

ID

Gets the unique identifier for this instance.

public Guid ID { get; }

Property Value

Guid

IsInitialized

Gets a value indicating whether the object has been successfully initialized.

public bool IsInitialized { get; }

Property Value

bool

Meshes

The meshes that make up the skinned mesh model.

public List<Mesh> Meshes { get; set; }

Property Value

List<Mesh>

Name

Gets or sets the name associated with the object.

public string Name { get; set; }

Property Value

string

NodeStructure

The node structure of the model as imported from Assimp.

public SceneNodeData NodeStructure { get; set; }

Property Value

SceneNodeData

Skeleton

The skeleton associated with the skinned mesh model.

public Skeleton Skeleton { get; set; }

Property Value

Skeleton

Methods

CreateBindPose(string, bool)

Creates a synthetic root bone to ensure a proper bind pose for the skeleton.

public bool CreateBindPose(string syntheticRootName = "Armature", bool force = false)

Parameters

syntheticRootName string
force bool

Returns

bool

Exceptions

InvalidOperationException

Deserialize(JObject, SerializationContext, Func<JObject, bool>)

Deserializes the specified JSON object into the corresponding object representation using the provided serialization context.

public void Deserialize(JObject obj, SerializationContext serializationContext, Func<JObject, bool> callback = null)

Parameters

obj JObject
serializationContext SerializationContext

The context that provides information and services required for the deserialization process. Cannot be null.

callback Func<JObject, bool>

Exceptions

NotImplementedException

Thrown in all cases as this method is not yet implemented.

Dispose(IRenderDevice)

Disposes the skinned mesh model with the specified render device.

public void Dispose(IRenderDevice renderer)

Parameters

renderer IRenderDevice

FindNodeByName(string, out SceneNodeData)

Searches for a node with the specified name in the scene graph.

public bool FindNodeByName(string name, out SceneNodeData node)

Parameters

name string

The name of the node to locate. The search is case-sensitive and cannot be null.

node SceneNodeData

When this method returns, contains the data for the found node if a node with the specified name exists; otherwise, contains the default value.

Returns

bool

true if a node with the specified name is found; otherwise, false.

FreeCPUResources()

Frees the CPU resources used by the skinned mesh model.

public void FreeCPUResources()

ImportAnimation(string)

Imports an animation from the specified file and adds it to the model's animations.

public void ImportAnimation(string file)

Parameters

file string

Init(IRenderDevice)

Initializes the skinned mesh model with the specified render device.

public void Init(IRenderDevice renderer)

Parameters

renderer IRenderDevice

Serialize(JsonWriter, SerializationContext, Action<JsonWriter>)

Serializes the current object to a JSON representation using the specified serialization context.

public void Serialize(JsonWriter writer, SerializationContext serializationContext, Action<JsonWriter> callback = null)

Parameters

writer JsonWriter
serializationContext SerializationContext

The context that provides configuration and state information for the serialization process.

callback Action<JsonWriter>

Exceptions

NotImplementedException

Thrown in all cases, as this method is not yet implemented.