Class Bone
Represents a single bone of a mesh. A bone has a name which allows it to be found in the frame hierarchy and by which it can be addressed by animations. In addition it has a number of influences on vertices and a matrix relating the mesh position to the position of the bone at the time of binding.
Implements
Inherited Members
Namespace: SharpAssimp
Assembly: SharpAssimp.dll
Syntax
public sealed class Bone : IMarshalable<Bone, AiBone>
Constructors
| Edit this page View SourceBone()
Constructs a new instance of the Bone class.
Declaration
public Bone()
Bone(string, Matrix3x3, VertexWeight[])
Constructs a new instance of the Bone class.
Declaration
public Bone(string name, Matrix3x3 offsetMatrix, VertexWeight[] weights)
Parameters
Type | Name | Description |
---|---|---|
string | name | Name of the bone |
Matrix3x3 | offsetMatrix | Bone's offset matrix |
VertexWeight[] | weights | Vertex weights |
Properties
| Edit this page View SourceHasVertexWeights
Gets if the bone has vertex weights - this should always be true.
Declaration
public bool HasVertexWeights { get; }
Property Value
Type | Description |
---|---|
bool |
Name
Gets or sets the name of the bone.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
OffsetMatrix
Gets or sets the matrix that transforms from bone space to mesh space in bind pose. This matrix describes the position of the mesh in the local space of this bone when the skeleton was bound. Thus it can be used directly to determine a desired vertex position, given the world-space transform of the bone when animated, and the position of the vertex in mesh space.
It is sometimes called an inverse-bind matrix or inverse-bind pose matrix.
Declaration
public Matrix4x4 OffsetMatrix { get; set; }
Property Value
Type | Description |
---|---|
Matrix4x4 |
VertexWeightCount
Gets the number of vertex influences the bone contains.
Declaration
public int VertexWeightCount { get; }
Property Value
Type | Description |
---|---|
int |
VertexWeights
Gets the influence weights of this bone, by vertex index.
Declaration
public List<VertexWeight> VertexWeights { get; }
Property Value
Type | Description |
---|---|
List<VertexWeight> |
Methods
| Edit this page View SourceFreeNative(nint, bool)
Frees unmanaged memory created by ToNative(nint, out Native).
Declaration
public static void FreeNative(nint nativeValue, bool freeNative)
Parameters
Type | Name | Description |
---|---|---|
nint | nativeValue | Native value to free |
bool | freeNative | True if the unmanaged memory should be freed, false otherwise. |