2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 13:44:56 +00:00

ANCS PAS I/O fix

This commit is contained in:
Jack Andersen
2018-12-15 20:32:07 -10:00
parent dac8fc3eb5
commit f184291461
8 changed files with 22 additions and 15 deletions

View File

@@ -662,12 +662,12 @@ void CBooModel::UVAnimationBuffer::ProcessAnimation(u8*& bufOut, const UVAnimati
}
case UVAnimation::Mode::HStrip: {
float value = anim.vals[0] * anim.vals[2] * (anim.vals[3] + CGraphics::GetSecondsMod900());
texMtxOut.m[3].x() = (float)(short)(anim.vals[1] * fmod(value, 1.0f)) * anim.vals[2];
texMtxOut.m[3].x() = std::trunc(anim.vals[1] * fmod(value, 1.0f)) * anim.vals[2];
break;
}
case UVAnimation::Mode::VStrip: {
float value = anim.vals[0] * anim.vals[2] * (anim.vals[3] + CGraphics::GetSecondsMod900());
texMtxOut.m[3].y() = (float)(short)(anim.vals[1] * fmod(value, 1.0f)) * anim.vals[2];
texMtxOut.m[3].y() = std::trunc(anim.vals[1] * fmod(value, 1.0f)) * anim.vals[2];
break;
}
case UVAnimation::Mode::Model: {
@@ -685,9 +685,9 @@ void CBooModel::UVAnimationBuffer::ProcessAnimation(u8*& bufOut, const UVAnimati
const zeus::CVector3f& viewOrigin = CGraphics::g_ViewMatrix.origin;
float xy = (viewOrigin.x() + viewOrigin.y()) * 0.025f * anim.vals[1];
xy = (xy - (int)xy);
xy = (xy - std::trunc(xy));
float z = (viewOrigin.z()) * 0.05f * anim.vals[1];
z = (z - (int)z);
z = (z - std::trunc(z));
float halfA = anim.vals[0] * 0.5f;

View File

@@ -405,6 +405,9 @@ CSpacePirate::CSpacePirate(TUniqueId uid, std::string_view name, const CEntityIn
else if (GetDamageVulnerability()->WeaponHurts(CWeaponMode(EWeaponType::Wave), false))
x8cc_trooperColor = zeus::CColor(0.776f, 0.054f, 1.f, 1.f);
}
if (GetEditorId().Id() == 0x77)
SetActive(true);
}
void CSpacePirate::Accept(IVisitor& visitor) { visitor.Visit(this); }

View File

@@ -185,6 +185,8 @@ void CPhysicsActor::MoveToWR(const zeus::CVector3f& trans, float d) {
zeus::CAxisAngle CPhysicsActor::GetRotateToORAngularMomentumWR(const zeus::CQuaternion& q, float d) const {
if (q.w() > 0.99999976)
return zeus::CAxisAngle::skZero;
if (GetEditorId().Id() == 0x77)
printf("%f\n", q.yaw());
return (xf0_inertiaTensor *
(((2.f * std::acos(q.w())) * (1.f / d)) * x34_transform.rotate(q.getImaginary()).normalized()));
}