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

@ -48,15 +48,15 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::Enumer
case DataType::UInt32:
case DataType::Enum:
writer.writeUint32Big(range[0].uint32);
writer.writeUint32Big(range[0].uint32);
writer.writeUint32Big(range[1].uint32);
break;
case DataType::Float:
writer.writeFloatBig(range[0].float32);
writer.writeFloatBig(range[0].float32);
writer.writeFloatBig(range[1].float32);
break;
case DataType::Bool:
writer.writeBool(range[0].bool1);
writer.writeBool(range[0].bool1);
writer.writeBool(range[1].bool1);
break;
}
}
@ -124,15 +124,15 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::Enumer
case DataType::UInt32:
case DataType::Enum:
writer.writeUint32(nullptr, range[0].uint32);
writer.writeUint32(nullptr, range[0].uint32);
writer.writeUint32(nullptr, range[1].uint32);
break;
case DataType::Float:
writer.writeFloat(nullptr, range[0].float32);
writer.writeFloat(nullptr, range[0].float32);
writer.writeFloat(nullptr, range[1].float32);
break;
case DataType::Bool:
writer.writeBool(nullptr, range[0].bool1);
writer.writeBool(nullptr, range[0].bool1);
writer.writeBool(nullptr, range[1].bool1);
break;
}
}

View File

@ -84,8 +84,10 @@ void ViewManager::TestGameView::think() {
" Roll: %f, Pitch: %f, Yaw: %f\n"
"Camera Position: x %f, y %f, z %f\n"
" Roll: %f, Pitch: %f, Yaw: %f\n",
pl.GetTranslation().x(), pl.GetTranslation().y(), pl.GetTranslation().z(), plQ.roll(), plQ.pitch(), plQ.yaw(),
camXf.origin.x(), camXf.origin.y(), camXf.origin.z(), camQ.roll(), camQ.pitch(), camQ.yaw());
pl.GetTranslation().x(), pl.GetTranslation().y(), pl.GetTranslation().z(),
zeus::radToDeg(plQ.roll()), zeus::radToDeg(plQ.pitch()), zeus::radToDeg(plQ.yaw()),
camXf.origin.x(), camXf.origin.y(), camXf.origin.z(),
zeus::radToDeg(camQ.roll()), zeus::radToDeg(camQ.pitch()), zeus::radToDeg(camQ.yaw()));
}
if (worldInfo && worldInfo->toBoolean()) {
TLockedToken<CStringTable> tbl =

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()));
}

2
hecl

@ -1 +1 @@
Subproject commit 40d23980dec1cf5addab4b0dbd2539d460c37fe0
Subproject commit ce11625af079a4449796b129b463f7d78d6a39d5

@ -1 +1 @@
Subproject commit f126245eeffa5df2f755949843cf850dd748384e
Subproject commit 3a6ee9a70cc7cd015a9dccef18852c434103988a

@ -1 +1 @@
Subproject commit e86cce5a6f6ad0182d9d2e01fb31bac47f4df882
Subproject commit 9ea12bded618ec4ac3198e86cb1937dece17239b