Table of Contents

Struct MeshMorphEntry

Namespace
Stride.Rendering
Assembly
Stride.Rendering.dll

The deltas of one morph target at one vertex of a MeshMorphData: position, normal and tangent.

[DataContract]
public struct MeshMorphEntry
Inherited Members
Extension Methods

Remarks

Packed for the GPU, with the same bytes on the CPU: the vertex index, then the target index and the nine delta components as 16-bit floats. Build entries with Create(uint, ushort, Vector3, Vector3, Vector3) and read them through ShapeIndex, PositionDelta, NormalDelta and TangentDelta. The packed words are internal, so the packing can change without breaking user code.

Fields

SizeInBytes

Six 32-bit words: the vertex, then the shape and nine binary16 components packed two per word.

public const int SizeInBytes = 24

Field Value

int

VertexIndex

The vertex the deltas apply to.

[DataMember(0)]
public uint VertexIndex

Field Value

uint

Properties

IsZero

Whether every delta is zero once packed; such entries are left out of MeshMorphData.

public readonly bool IsZero { get; }

Property Value

bool

NormalDelta

The normal delta at full weight, added to the base normal before normalizing.

public readonly Vector3 NormalDelta { get; }

Property Value

Vector3

PositionDelta

The position delta at full weight.

public readonly Vector3 PositionDelta { get; }

Property Value

Vector3

ShapeIndex

The index of the target in TargetNames.

public readonly ushort ShapeIndex { get; }

Property Value

ushort

TangentDelta

The tangent delta at full weight, added to the base tangent before normalizing.

public readonly Vector3 TangentDelta { get; }

Property Value

Vector3

Methods

Create(uint, ushort, Vector3, Vector3, Vector3)

Packs the deltas of a target at a vertex, rounding each component to a 16-bit float.

public static MeshMorphEntry Create(uint vertex, ushort shape, Vector3 position, Vector3 normal, Vector3 tangent)

Parameters

vertex uint

The vertex index.

shape ushort

The target index.

position Vector3

The position delta.

normal Vector3

The normal delta, or zero.

tangent Vector3

The tangent delta, or zero.

Returns

MeshMorphEntry

The packed entry.

Exceptions

ArgumentException

A component is not finite or is beyond the 16-bit float range (65504).