mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-22 20:15:17 +00:00
Disable accurate interpolation on 32 bit
This commit is contained in:
parent
14e80106c4
commit
f82f5149f4
2 changed files with 14 additions and 7 deletions
|
@ -164,7 +164,7 @@ f32 vec3f_dot(Vec3f a, Vec3f b)
|
||||||
|
|
||||||
/// takes respective scales of vecA and vecB, and sums them
|
/// takes respective scales of vecA and vecB, and sums them
|
||||||
void vec3f_combine(Vec3f dest, Vec3f vecA, Vec3f vecB, f32 sclA, f32 sclB) {
|
void vec3f_combine(Vec3f dest, Vec3f vecA, Vec3f vecB, f32 sclA, f32 sclB) {
|
||||||
register int i;
|
int i = 0;
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
for (i = 0; i < 3; ++i) {
|
||||||
dest[i] = vecA[i] * sclA + vecB[i] * sclB;
|
dest[i] = vecA[i] * sclA + vecB[i] * sclB;
|
||||||
|
|
|
@ -215,7 +215,7 @@ static void rot_mat_to_rot_quat(Vec4f q, Vec3f a[3]) {
|
||||||
|
|
||||||
// adjust signs of coefficients; base on greatest magnitude to improve float accuracy
|
// adjust signs of coefficients; base on greatest magnitude to improve float accuracy
|
||||||
switch (maxCompoMagCase) {
|
switch (maxCompoMagCase) {
|
||||||
f32 divFactor;
|
f32 divFactor = 0;
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
divFactor = 0.25f / q[0];
|
divFactor = 0.25f / q[0];
|
||||||
|
@ -270,7 +270,11 @@ static void rot_quat_slerp(Vec4f out, Vec4f a, Vec4f b, f32 t) {
|
||||||
// Martin John Baker
|
// Martin John Baker
|
||||||
// https://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/index.htm
|
// https://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/index.htm
|
||||||
|
|
||||||
f32 halfTh, halfSin, st, sat, halfCos = a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
|
f32 halfTh = 0;
|
||||||
|
f32 halfSin = 0;
|
||||||
|
f32 st = 0;
|
||||||
|
f32 sat = 0;
|
||||||
|
f32 halfCos = a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
|
||||||
|
|
||||||
memcpy(out, b, sizeof(f32) * 4);
|
memcpy(out, b, sizeof(f32) * 4);
|
||||||
|
|
||||||
|
@ -477,7 +481,7 @@ static void rematrix(Mtx * mat, f32 tranfs[13]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void delta_interpolate_mtx_accurate(Mtx* out, Mtx* a, Mtx* b, f32 delta) {
|
void delta_interpolate_mtx_accurate(Mtx* out, Mtx* a, Mtx* b, f32 delta) {
|
||||||
int i;
|
int i = 0;
|
||||||
f32 matTranfsA[13] = { 0 };
|
f32 matTranfsA[13] = { 0 };
|
||||||
f32 matTranfsB[13] = { 0 };
|
f32 matTranfsB[13] = { 0 };
|
||||||
|
|
||||||
|
@ -500,10 +504,13 @@ void delta_interpolate_mtx_accurate(Mtx* out, Mtx* a, Mtx* b, f32 delta) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void delta_interpolate_mtx(Mtx* out, Mtx* a, Mtx* b, f32 delta) {
|
void delta_interpolate_mtx(Mtx* out, Mtx* a, Mtx* b, f32 delta) {
|
||||||
|
// HACK: Limit accurate interpolation to 64-bit builds
|
||||||
|
if (sizeof(int) > 4) {
|
||||||
if (configInterpolationMode) {
|
if (configInterpolationMode) {
|
||||||
delta_interpolate_mtx_accurate(out, a, b, delta);
|
delta_interpolate_mtx_accurate(out, a, b, delta);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// this isn't the right way to do things.
|
// this isn't the right way to do things.
|
||||||
f32 antiDelta = 1.0f - delta;
|
f32 antiDelta = 1.0f - delta;
|
||||||
|
|
Loading…
Reference in a new issue