Table of Contents

Class BoneSkinMeshNode

Namespace
HelixToolkit.SharpDX.Model.Scene
Assembly
HelixToolkit.SharpDX.dll
public class BoneSkinMeshNode : MeshNode, IDisposable, IComparable<SceneNode>, IAnimationNode, IHitable, IThrowingShadow, IInstancing, IBoundable, IApplyPostEffect, IDynamicReflectable, IBoneMatricesNode
Inheritance
BoneSkinMeshNode
Implements
Inherited Members
Extension Methods

Properties

BoneMatrices

Gets or sets the bone matrices.

public Matrix4x4[]? BoneMatrices { get; set; }

Property Value

Matrix4x4[]

The bone matrices.

Bones

Gets or sets the bones.

public Bone[]? Bones { get; set; }

Property Value

Bone[]

The bones.

HasBoneGroup

Gets or sets a value indicating whether this node has bone group. BoneGroupNode shares bones with multiple BoneSkinMeshNode

public bool HasBoneGroup { get; }

Property Value

bool

true if this instance has bone group; otherwise, false.

IsSkeletonNode

Gets or sets a value indicating whether this node is used to show skeleton. Only used as an indication.

public bool IsSkeletonNode { get; set; }

Property Value

bool

true if this node is used to show skeleton; otherwise, false.

MorphTargetWeights

Gets or sets the morph target weights.

public float[]? MorphTargetWeights { get; set; }

Property Value

float[]

The morph target weights.

Methods

CreateSkeletonNode(MaterialCore, string, float)

Creates the skeleton node.

public BoneSkinMeshNode CreateSkeletonNode(MaterialCore material, string effectName, float scale = 0.1)

Parameters

material MaterialCore

The material.

effectName string

Name of the effect.

scale float

The scale.

Returns

BoneSkinMeshNode

CreateSkeletonNode(BoneSkinMeshNode, MaterialCore, string, float)

Creates the skeleton node.

public static BoneSkinMeshNode CreateSkeletonNode(BoneSkinMeshNode node, MaterialCore material, string effectName, float scale)

Parameters

node BoneSkinMeshNode

The node.

material MaterialCore

The material.

effectName string

Name of the effect.

scale float

The scale.

Returns

BoneSkinMeshNode

InitializeMorphTargets(MorphTargetVertex[], int)

public bool InitializeMorphTargets(MorphTargetVertex[] mtv, int pitch)

Parameters

mtv MorphTargetVertex[]
pitch int

Returns

bool

InvalidateBoneMatrices()

public void InvalidateBoneMatrices()

InvalidateMorphTargetWeights()

public void InvalidateMorphTargetWeights()

OnCreateBufferModel(Guid, Geometry3D?)

Called when [create buffer model].

protected override IAttachableBufferModel OnCreateBufferModel(Guid modelGuid, Geometry3D? geometry)

Parameters

modelGuid Guid
geometry Geometry3D

Returns

IAttachableBufferModel

OnCreateRenderCore()

Called when [create render core].

protected override RenderCore OnCreateRenderCore()

Returns

RenderCore

OnHitTest(HitTestContext?, Matrix4x4, ref List<HitTestResult>)

Called when [hit test].

protected override bool OnHitTest(HitTestContext? context, Matrix4x4 totalModelMatrix, ref List<HitTestResult> hits)

Parameters

context HitTestContext

The context.

totalModelMatrix Matrix4x4

The total model matrix.

hits List<HitTestResult>

The hits.

Returns

bool

PreHitTestOnBounds(HitTestContext?)

protected override bool PreHitTestOnBounds(HitTestContext? context)

Parameters

context HitTestContext

Returns

bool

SetWeight(int, float)

Make sure to use SetWeight so that the mutation of elements can be seen

public void SetWeight(int i, float w)

Parameters

i int

index

w float

weight, typically 0-1

SetupIdentitySkeleton()

public void SetupIdentitySkeleton()

TestViewFrustum(ref BoundingFrustum)

Views the frustum test.

public override bool TestViewFrustum(ref BoundingFrustum viewFrustum)

Parameters

viewFrustum BoundingFrustum

The view frustum.

Returns

bool

TryGetSkinnedVertices(IEffectsManager)

Try to get skinned vertices. Skinned vertices are copied from GPU.

public Vector3[]? TryGetSkinnedVertices(IEffectsManager manager)

Parameters

manager IEffectsManager

Returns

Vector3[]

New array with vertex positions

TryGetSkinnedVertices(IEffectsManager, Vector3[])

Try to get skinned vertices. Skinned vertices are copied from GPU.

public int TryGetSkinnedVertices(IEffectsManager manager, Vector3[] array)

Parameters

manager IEffectsManager
array Vector3[]

Vertex positions will be copied into this array

Returns

int

TryGetSkinnedVerticesCache()

Get the skinned vertices cache used for hit test. This cache will only be updated after each hit test. To get latest skinned vertices, please use TryGetSkinnedVertices(IEffectsManager).

public Vector3[] TryGetSkinnedVerticesCache()

Returns

Vector3[]

UpdateBoneMatrices()

public void UpdateBoneMatrices()

WeightUpdated()

Tells the render core to update it's morph target weight buffer

public void WeightUpdated()