|
resonance 1.0.1
|
One keyframe of the translation or the scale channel. More...
#include <transanim.h>
Public Member Functions | |
| void | ComputeSplineTangents (const TransKey *pPrev, const TransKey *pNext) |
| Build the two Kochanek-Bartels tangents of this keyframe from its neighbours. | |
| void | EvaluateSpline (const TransKey *pNext, float *pOut, float flT) const |
| Evaluate the cubic Hermite segment from this keyframe to pNext. | |
| Vector3 | EvaluateSplineDerivative (const TransKey *pNext, float flT) const |
| Evaluate the derivative of the segment EvaluateSpline() traces. | |
| bool | operator< (const TransKey &other) const |
| Order keyframes by frame. | |
Public Attributes | |
| float | mValue [kXfmRowFloatCount] |
| float | mTangentIn [kXfmRowFloatCount] |
| float | mTangentOut [kXfmRowFloatCount] |
| float | mShape [kXfmRowFloatCount] |
| float | mFrame |
One keyframe of the translation or the scale channel.
The keyframe is 0x50 bytes, and the enclosing std::list node is 0x60 with the value at +0x10, both of which follow from the 16-byte alignment the padded vectors impose. mFrame lands at +0x40 rather than at +0x3c for the same reason, which is what makes the shape triple a padded vector rather than three loose floats.
The assignment of the shape triple is settled by the arithmetic of the tangent builder at 0x00552748, which forms 1 - tension, (1 +- continuity) / 2, and 1 +- bias. That is the Kochanek-Bartels weighting, and it agrees with the "t:", "c:", and "b:" titles the dumper writes in that order.
| void Rnd::TransAnim::TransKey::ComputeSplineTangents | ( | const TransKey * | pPrev, |
| const TransKey * | pNext ) |
Build the two Kochanek-Bartels tangents of this keyframe from its neighbours.
With both neighbours, toPrev is (value - pPrev->value) * (bias + 1) and toNext is (pNext->value - value) * (1 - bias). mTangentOut is then toPrev + (toNext - toPrev) * (0.5 - continuity / 2) weighted 1 - tension, and mTangentIn the same with 0.5 + continuity / 2. A keyframe with no previous neighbour writes only mTangentOut, as ((pNext->value - value) * 1.5 - pNext->mTangentIn * 0.5 * (bias + 1)) * (1 - tension), and one with no next neighbour writes only mTangentIn, as ((value - pPrev->value) * 1.5 - pPrev->mTangentOut * 0.5 * (bias + 1)) * (1 - tension). Every tangent written ends in a padding float of 1.0. A keyframe with neither neighbour is unchanged.
| pPrev | The preceding keyframe, or null at the start of the channel. |
| pNext | The following keyframe, or null at the end of the channel. |
| void Rnd::TransAnim::TransKey::EvaluateSpline | ( | const TransKey * | pNext, |
| float * | pOut, | ||
| float | flT ) const |
Evaluate the cubic Hermite segment from this keyframe to pNext.
The segment leaves mValue along mTangentOut and arrives at pNext->mValue along pNext->mTangentIn. A parameter of exactly zero or exactly one copies the matching value quadword, padding float included. Any other parameter writes a padding float of 1.0.
| pNext | The keyframe that ends the segment. |
| pOut | Receives the position, four floats. |
| flT | The segment parameter, zero at this keyframe and one at pNext. |
| Vector3 Rnd::TransAnim::TransKey::EvaluateSplineDerivative | ( | const TransKey * | pNext, |
| float | flT ) const |
Evaluate the derivative of the segment EvaluateSpline() traces.
Neither end of the segment is special cased. The result returns through the hidden pointer in a0, ahead of this object in a1, and its padding float is 1.0.
| pNext | The keyframe that ends the segment. |
| flT | The segment parameter, zero at this keyframe and one at pNext. |
|
inline |
Order keyframes by frame.
The list sort the loader calls inlines it in its merge step.
| other | The keyframe to compare against. |
| float Rnd::TransAnim::TransKey::mValue[kXfmRowFloatCount] |
x, y, and z, then one padding float. +0x00
| float Rnd::TransAnim::TransKey::mTangentIn[kXfmRowFloatCount] |
Tangent entering the key. +0x10
| float Rnd::TransAnim::TransKey::mTangentOut[kXfmRowFloatCount] |
Tangent leaving the key. +0x20
| float Rnd::TransAnim::TransKey::mShape[kXfmRowFloatCount] |
See ShapeComponent, then padding. +0x30
| float Rnd::TransAnim::TransKey::mFrame |
Frame this key lands on. +0x40