2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 05:47:42 +00:00

Various CActorContraption fixes

This commit is contained in:
Jack Andersen
2019-06-14 14:39:20 -10:00
parent 6679f6de72
commit 37307e1cf6
17 changed files with 82 additions and 34 deletions

View File

@@ -37,6 +37,9 @@ size_t ComputeBitstreamSize(size_t keyFrameCount, const std::vector<Channel>& ch
static inline QuantizedRot QuantizeRotation(const Value& quat, atUint32 div) {
float q = M_PIF / 2.0f / float(div);
zeus::simd_floats f(quat.simd);
assert(std::abs(f[1]) <= 1.f && "Out of range quat X component");
assert(std::abs(f[2]) <= 1.f && "Out of range quat Y component");
assert(std::abs(f[3]) <= 1.f && "Out of range quat Z component");
return {{
atInt32(std::asin(f[1]) / q),
atInt32(std::asin(f[2]) / q),