Class SkinnedMeshModel
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
filestring
Properties
Animations
Gets or sets the collection of 3D animations associated with this object.
public List<Animation3D> Animations { get; set; }
Property Value
FilePath
Gets or sets the full path to the file associated with this instance.
public string FilePath { get; set; }
Property Value
HasTransparency
Gets a value indicating whether the current image contains any transparent pixels.
public bool HasTransparency { get; }
Property Value
ID
Gets the unique identifier for this instance.
public Guid ID { get; }
Property Value
IsInitialized
Gets a value indicating whether the object has been successfully initialized.
public bool IsInitialized { get; }
Property Value
Meshes
The meshes that make up the skinned mesh model.
public List<Mesh> Meshes { get; set; }
Property Value
Name
Gets or sets the name associated with the object.
public string Name { get; set; }
Property Value
NodeStructure
The node structure of the model as imported from Assimp.
public SceneNodeData NodeStructure { get; set; }
Property Value
Skeleton
The skeleton associated with the skinned mesh model.
public Skeleton Skeleton { get; set; }
Property Value
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
Returns
Exceptions
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
objJObjectserializationContextSerializationContextThe context that provides information and services required for the deserialization process. Cannot be null.
callbackFunc<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
rendererIRenderDevice
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
namestringThe name of the node to locate. The search is case-sensitive and cannot be null.
nodeSceneNodeDataWhen 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
filestring
Init(IRenderDevice)
Initializes the skinned mesh model with the specified render device.
public void Init(IRenderDevice renderer)
Parameters
rendererIRenderDevice
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
writerJsonWriterserializationContextSerializationContextThe context that provides configuration and state information for the serialization process.
callbackAction<JsonWriter>
Exceptions
- NotImplementedException
Thrown in all cases, as this method is not yet implemented.