diff --git a/Runtime/Camera/CCameraManager.cpp b/Runtime/Camera/CCameraManager.cpp index d75d81982..c530d258b 100644 --- a/Runtime/Camera/CCameraManager.cpp +++ b/Runtime/Camera/CCameraManager.cpp @@ -155,8 +155,8 @@ const CGameCamera* CCameraManager::GetCurrentCamera(const CStateManager& stateMg float CCameraManager::sub80009148() const { const zeus::CVector3f uVec = x7c_fpCamera->GetTransform().upVector(); - return 1.f - std::min(std::fabs(std::min(std::fabs(uVec.dot(zeus::kUpVec)), 1.f) / std::cos(zeus::degToRad(30.f))), - 1.f); + return 1.f - std::min(std::fabs(std::min(std::fabs(uVec.dot(zeus::CVector3f::skUp)), 1.f) / + std::cos(zeus::degToRad(30.f))), 1.f); } void CCameraManager::sub800097AC(float, CStateManager& mgr) diff --git a/Runtime/Camera/CGameCamera.cpp b/Runtime/Camera/CGameCamera.cpp index 12a2dddf8..9017f0e35 100644 --- a/Runtime/Camera/CGameCamera.cpp +++ b/Runtime/Camera/CGameCamera.cpp @@ -79,7 +79,8 @@ zeus::CTransform CGameCamera::ValidateCameraTransform(const zeus::CTransform& a, if ((a.rightVector().magnitude() - 1.f) >= epsilon || (a.frontVector().magnitude() - 1.f) >= epsilon || (a.upVector().magnitude() - 1.f) >= epsilon) xfCpy.orthonormalize(); - float f2 = zeus::kUpVec.x + a.upVector().x * a.upVector().y * a.upVector().z * zeus::kUpVec.y + zeus::kUpVec.z; + float f2 = zeus::CVector3f::skUp.x + a.upVector().x * a.upVector().y * a.upVector().z * + zeus::CVector3f::skUp.y + zeus::CVector3f::skUp.z; if (std::fabs(f2) > 1.0f) f2 = (f2 >= -0.f ? -1.0f : 1.0f); if (std::fabs(f2) > 0.999f) diff --git a/Runtime/MP1/CSamusFaceReflection.cpp b/Runtime/MP1/CSamusFaceReflection.cpp index 40ffd632c..cad00d0f7 100644 --- a/Runtime/MP1/CSamusFaceReflection.cpp +++ b/Runtime/MP1/CSamusFaceReflection.cpp @@ -1,4 +1,5 @@ #include "CSamusFaceReflection.hpp" +#include "GameGlobalObjects.hpp" namespace urde { @@ -6,9 +7,13 @@ namespace MP1 { CSamusFaceReflection::CSamusFaceReflection(CStateManager& stateMgr) -: x4c_lights(8, zeus::CVector3f::skZero, 4, 4, false, 0, 0, 0.1f) +: x0_modelData(CAnimRes(g_ResFactory->GetResourceIdByName("ACS_SamusFace")->id, + 0, zeus::CVector3f::skOne, 0, true)), + x4c_lights(std::make_unique(8, zeus::CVector3f::skZero, 4, 4, false, 0, 0, 0.1f)) { - + x60_ = zeus::CVector3f::skForward; + CAnimPlaybackParms parms(0, -1, 1.f, true); + x0_modelData.AnimationData()->SetAnimation(parms, false); } } diff --git a/Runtime/MP1/CSamusFaceReflection.hpp b/Runtime/MP1/CSamusFaceReflection.hpp index 562eb5ff1..2a0536638 100644 --- a/Runtime/MP1/CSamusFaceReflection.hpp +++ b/Runtime/MP1/CSamusFaceReflection.hpp @@ -12,7 +12,11 @@ namespace MP1 class CSamusFaceReflection { CModelData x0_modelData; - CActorLights x4c_lights; + std::unique_ptr x4c_lights; + zeus::CQuaternion x50_; + zeus::CVector3f x60_; + u32 x6c_ = 0; + bool x70_ = true; public: CSamusFaceReflection(CStateManager& stateMgr); }; diff --git a/Runtime/World/CPlayerCameraBob.cpp b/Runtime/World/CPlayerCameraBob.cpp index f9dc86d9b..cea58c624 100644 --- a/Runtime/World/CPlayerCameraBob.cpp +++ b/Runtime/World/CPlayerCameraBob.cpp @@ -124,7 +124,7 @@ void CPlayerCameraBob::UpdateViewWander(float dt, CStateManager& mgr) xb0_wanderPitches[(xcc_wanderIndex + 2) & 3], xb0_wanderPitches[(xcc_wanderIndex + 3) & 3], dt) * x100_)); - xd0_viewWanderXf = zeus::lookAt(pt, zeus::CVector3f::skZero, zeus::kUpVec) * orient; + xd0_viewWanderXf = zeus::lookAt(pt, zeus::CVector3f::skZero, zeus::CVector3f::skUp) * orient; xc4_wanderTime = (xc8_viewWanderSpeed * xc4_wanderTime) + dt; if (xc4_wanderTime > 1.f) @@ -184,7 +184,7 @@ void CPlayerCameraBob::Update(float dt, CStateManager& mgr) x78_ = tmp; x2c_cameraBobTransform = GetViewWanderTransform() * CalculateCameraBobTransformation() * - zeus::lookAt(zeus::CVector3f::skZero, {0.f, 2.f, x78_}, zeus::kUpVec); + zeus::lookAt(zeus::CVector3f::skZero, {0.f, 2.f, x78_}, zeus::CVector3f::skUp); } zeus::CVector3f CPlayerCameraBob::CalculateRandomViewWanderPosition(CStateManager& mgr) diff --git a/Runtime/World/CWorldTransManager.cpp b/Runtime/World/CWorldTransManager.cpp index 37c68c9ac..4200dfeea 100644 --- a/Runtime/World/CWorldTransManager.cpp +++ b/Runtime/World/CWorldTransManager.cpp @@ -52,7 +52,7 @@ void CWorldTransManager::UpdateLights(float dt) x4_modelData->x1a0_lights.clear(); zeus::CVector3f lightPos(0.f, 10.f, 0.f); - CLight spot = CLight::BuildSpot(lightPos, zeus::kBackVec, zeus::CColor::skWhite, 90.f); + CLight spot = CLight::BuildSpot(lightPos, zeus::CVector3f::skBack, zeus::CColor::skWhite, 90.f); spot.SetAttenuation(1.f, 0.f, 0.f); CLight s1 = spot; diff --git a/Runtime/World/ScriptLoader.cpp b/Runtime/World/ScriptLoader.cpp index e51d0810f..2dbf692b0 100644 --- a/Runtime/World/ScriptLoader.cpp +++ b/Runtime/World/ScriptLoader.cpp @@ -1087,17 +1087,17 @@ u32 TransformDamagableTriggerFlags(CStateManager& mgr, TAreaId aId, u32 flags) u32 ret = 0; if (flags & 0x01) - ret |= ClassifyVector(rotation * zeus::kForwardVec); + ret |= ClassifyVector(rotation * zeus::CVector3f::skForward); if (flags & 0x02) - ret |= ClassifyVector(rotation * zeus::kBackVec); + ret |= ClassifyVector(rotation * zeus::CVector3f::skBack); if (flags & 0x04) - ret |= ClassifyVector(rotation * zeus::kLeftVec); + ret |= ClassifyVector(rotation * zeus::CVector3f::skLeft); if (flags & 0x08) - ret |= ClassifyVector(rotation * zeus::kRightVec); + ret |= ClassifyVector(rotation * zeus::CVector3f::skRight); if (flags & 0x10) - ret |= ClassifyVector(rotation * zeus::kUpVec); + ret |= ClassifyVector(rotation * zeus::CVector3f::skUp); if (flags & 0x20) - ret |= ClassifyVector(rotation * zeus::kDownVec); + ret |= ClassifyVector(rotation * zeus::CVector3f::skDown); return ret; } diff --git a/specter b/specter index 7cb049f09..03d074af1 160000 --- a/specter +++ b/specter @@ -1 +1 @@ -Subproject commit 7cb049f093f9d1d91c501fbabfd12009a5bb0995 +Subproject commit 03d074af13e902cebdf05d6f5ec5e4c2cbf569ee