13 uint32_t delta = (uint32_t)sample - current;
15 return (int32_t)((uint32_t)current + step);
30 int32_t start, int32_t end, int32_t out_tangent, int32_t in_tangent)
49 if ((uintptr_t)keys == UINT32_MAX)
77 int mid = (next + high) / 2;
84 start = &keys[next - 1];
90 bool at_last_key = time == end_time;
92 if (at_last_key || time >= end_time)
95 if (!at_last_key && (vec3_track->
channel_flags & wrap) == wrap)
113static int32_t
quadratic_ease(int32_t elapsed, int32_t shape, int32_t coefficient, int32_t reciprocal)
122 uint8_t next_ease_index, uint8_t *keyframe_data)
125 uint32_t frames = (next_key_time - start_time) >> 6;
127 int32_t elapsed = (int32_t)((sample_time - start_time) << 6);
128 uint8_t prev_ease_index = (uint8_t)prev_key_packed;
129 if (!prev_ease_index && !next_ease_index)
135 int32_t shape = ((prev_key_packed >> 8) & 0xfff) + 0x800;
139 if (prev_ease_index && elapsed < start_end)
143 int32_t remaining = (int32_t)((uint32_t)duration - elapsed);
146 else if (!next_ease_index && elapsed >= duration)
150 int32_t doubled = (int32_t)(2u * elapsed);
#define ANIMATION_SPLINE_REPEAT_ENDPOINT
#define ANIMATION_SPLINE_VEC3_COMBINED_32BIT_PRODUCTS
#define ANIMATION_SPLINE_VEC3_WIDE_ENDPOINT_PRODUCTS
#define ANIMATION_SPLINE_WRAP_SAMPLE_TIME
#define animationReciprocalQ20
int32_t Animation_CalculateSplineParameter(uint32_t sample_time, uint32_t next_key_time, uint32_t prev_key_packed, uint8_t next_ease_index, uint8_t *keyframe_data)
static int32_t blend_vector_component(int32_t current, int32_t sample, int32_t weight)
void Animation_InterpolateVec3(uint32_t frame_time, struct Animation_SplineChannelVec3 *vec3_track, struct Math_Vec3I32 *out_vec3)
static int32_t interpolate_vector_component(struct HermiteWeights w, uint16_t flags, int32_t start, int32_t end, int32_t out_tangent, int32_t in_tangent)
void Animation_InterpolateSpline(uint32_t sample_time, struct Animation_SplineChannelScalar *channel, int16_t *out_value)
static int32_t quadratic_ease(int32_t elapsed, int32_t shape, int32_t coefficient, int32_t reciprocal)
void Animation_InterpolateKeyframeVec3Blend(uint32_t frame_time, int32_t blend_weight_q12, struct Animation_SplineChannelVec3 *track, struct Math_Vec3I32 *vector)
static int32_t sample_scalar_keys(uint32_t frame_time, struct Animation_SplineChannelScalar *channel, bool signed_time)
static uint32_t spline_key_time(uint32_t packed)
static struct HermiteWeights spline_weights(int32_t t)
static int32_t spline_mul_q12(int32_t a, int32_t b)
int32_t start_curve_coefficient_q12
int32_t end_curve_coefficient_q12
int16_t start_curve_end_q12
int16_t end_curve_start_q12
struct Animation_ScalarKeyframe * keyframes_or_minus_one_sentinel
int32_t packed_time_bias_and_end_time
struct Math_Vec3I16 value_q12
int32_t packed_time_bias_and_end_time
Animation_SplineChannelFlags channel_flags
struct Animation_Vec3Keyframe * keyframes_or_minus_one_sentinel
struct Math_Vec3I32 value
struct Math_Vec3I32 tangent_out
struct Math_Vec3I32 tangent_in
union Animation_KeyframeTiming timing