Struct MeshMorphEntry
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
VertexIndex
The vertex the deltas apply to.
[DataMember(0)]
public uint VertexIndex
Field Value
Properties
IsZero
Whether every delta is zero once packed; such entries are left out of MeshMorphData.
public readonly bool IsZero { get; }
Property Value
NormalDelta
The normal delta at full weight, added to the base normal before normalizing.
public readonly Vector3 NormalDelta { get; }
Property Value
PositionDelta
The position delta at full weight.
public readonly Vector3 PositionDelta { get; }
Property Value
ShapeIndex
The index of the target in TargetNames.
public readonly ushort ShapeIndex { get; }
Property Value
TangentDelta
The tangent delta at full weight, added to the base tangent before normalizing.
public readonly Vector3 TangentDelta { get; }
Property Value
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
vertexuintThe vertex index.
shapeushortThe target index.
positionVector3The position delta.
normalVector3The normal delta, or zero.
tangentVector3The 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).