mirror of https://github.com/AxioDL/metaforce.git
Initial CScriptPlatform collision
This commit is contained in:
parent
4ddec7e10c
commit
186acae5d8
|
@ -98,17 +98,19 @@ u16 CSfxManager::CSfxWrapper::GetSfxId() const
|
|||
|
||||
void CSfxManager::CSfxWrapper::UpdateEmitterSilent()
|
||||
{
|
||||
x1c_voiceHandle->setVolume(1.f / 127.f);
|
||||
if (x1c_voiceHandle)
|
||||
x1c_voiceHandle->setVolume(1.f / 127.f);
|
||||
}
|
||||
|
||||
void CSfxManager::CSfxWrapper::UpdateEmitter()
|
||||
{
|
||||
x1c_voiceHandle->setVolume(x20_vol);
|
||||
if (x1c_voiceHandle)
|
||||
x1c_voiceHandle->setVolume(x20_vol);
|
||||
}
|
||||
|
||||
void CSfxManager::CSfxWrapper::SetReverb(float rev)
|
||||
{
|
||||
if (IsAuxProcessingEnabled() && UseAcoustics())
|
||||
if (x1c_voiceHandle && IsAuxProcessingEnabled() && UseAcoustics())
|
||||
x1c_voiceHandle->setReverbVol(rev);
|
||||
}
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@ void CAutoMapper::SAutoMapperRenderState::InterpolateWithClamp(const SAutoMapper
|
|||
{
|
||||
float easeB = eases[int(b.x44_viewportEase)];
|
||||
float easeA = 1.f - easeB;
|
||||
zeus::CVector2i vpA = a.m_getViewportSize();
|
||||
zeus::CVector2i vpB = b.m_getViewportSize();
|
||||
zeus::CVector2i vpA = a.GetViewportSize();
|
||||
zeus::CVector2i vpB = b.GetViewportSize();
|
||||
out.x0_viewportSize = zeus::CVector2i(vpB.x * easeB + vpA.x * easeA,
|
||||
vpB.y * easeB + vpA.y * easeA);
|
||||
}
|
||||
|
@ -1451,14 +1451,8 @@ void CAutoMapper::Draw(const CStateManager& mgr, const zeus::CTransform& xf, flo
|
|||
alphaInterp = 1.f;
|
||||
}
|
||||
|
||||
float aspect;
|
||||
if (xa8_renderStates[0].m_getViewportSize)
|
||||
{
|
||||
zeus::CVector2i vp = xa8_renderStates[0].m_getViewportSize();
|
||||
aspect = vp.x / float(vp.y);
|
||||
}
|
||||
else
|
||||
aspect = xa8_renderStates[0].x0_viewportSize.x / float(xa8_renderStates[0].x0_viewportSize.y);
|
||||
zeus::CVector2i vp = xa8_renderStates[0].GetViewportSize();
|
||||
float aspect = vp.x / float(vp.y);
|
||||
if (aspect > 1.78f)
|
||||
aspect = 1.78f;
|
||||
float yScale = xa8_renderStates[0].x18_camDist /
|
||||
|
|
|
@ -85,6 +85,14 @@ public:
|
|||
x54_depth2Ease = Ease::None;
|
||||
x58_alphaEase = Ease::None;
|
||||
}
|
||||
|
||||
zeus::CVector2i GetViewportSize() const
|
||||
{
|
||||
if (m_getViewportSize)
|
||||
return m_getViewportSize();
|
||||
else
|
||||
return x0_viewportSize;
|
||||
}
|
||||
};
|
||||
|
||||
struct SAutoMapperHintStep
|
||||
|
|
|
@ -2006,7 +2006,7 @@ CFrontEndUI::CFrontEndUI()
|
|||
|
||||
m->ResetGameState();
|
||||
g_GameState->SetCurrentWorldId(g_ResFactory->TranslateOriginalToNew(g_DefaultWorldTag.id));
|
||||
g_GameState->CurrentWorldState().SetAreaId(4);
|
||||
g_GameState->CurrentWorldState().SetAreaId(6);
|
||||
g_GameState->GameOptions().ResetToDefaults();
|
||||
g_GameState->WriteBackupBuf();
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ float CPhysicsActor::GetWeight() const { return 24.525002f * xe8_mass; }
|
|||
|
||||
void CPhysicsActor::SetPrimitiveOffset(const zeus::CVector2f& offset) { x1e8_primitiveOffset = offset; }
|
||||
|
||||
zeus::CVector3f CPhysicsActor::GetPrimitiveOffset() { return x1e8_primitiveOffset; }
|
||||
zeus::CVector3f CPhysicsActor::GetPrimitiveOffset() const { return x1e8_primitiveOffset; }
|
||||
|
||||
void CPhysicsActor::MoveCollisionPrimitive(const zeus::CVector3f& offset) { x1e8_primitiveOffset = offset; }
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ public:
|
|||
|
||||
float GetMass() const { return xe8_mass; }
|
||||
void SetPrimitiveOffset(const zeus::CVector2f& offset);
|
||||
zeus::CVector3f GetPrimitiveOffset();
|
||||
zeus::CVector3f GetPrimitiveOffset() const;
|
||||
void MoveCollisionPrimitive(const zeus::CVector3f& offset);
|
||||
void SetBoundingBox(const zeus::CAABox& box);
|
||||
zeus::CAABox GetMotionVolume(float dt) const;
|
||||
|
|
|
@ -196,6 +196,20 @@ std::experimental::optional<zeus::CAABox> CScriptPlatform::GetTouchBounds() cons
|
|||
return {CPhysicsActor::GetBoundingBox()};
|
||||
}
|
||||
|
||||
zeus::CTransform CScriptPlatform::GetPrimitiveTransform() const
|
||||
{
|
||||
zeus::CTransform ret = GetTransform();
|
||||
ret.origin += GetPrimitiveOffset();
|
||||
return ret;
|
||||
}
|
||||
|
||||
const CCollisionPrimitive* CScriptPlatform::GetCollisionPrimitive() const
|
||||
{
|
||||
if (!x314_treeGroup)
|
||||
return CPhysicsActor::GetCollisionPrimitive();
|
||||
return x314_treeGroup.get();
|
||||
}
|
||||
|
||||
bool CScriptPlatform::IsRider(TUniqueId id) const
|
||||
{
|
||||
for (const SRiders& rider : x318_riders)
|
||||
|
|
|
@ -71,6 +71,8 @@ public:
|
|||
void PreThink(float, CStateManager&);
|
||||
void Think(float, CStateManager&);
|
||||
std::experimental::optional<zeus::CAABox> GetTouchBounds() const;
|
||||
zeus::CTransform GetPrimitiveTransform() const;
|
||||
const CCollisionPrimitive* GetCollisionPrimitive() const;
|
||||
bool IsRider(TUniqueId id) const;
|
||||
bool IsSlave(TUniqueId id) const;
|
||||
std::vector<SRiders>& GetX328() { return x328_slaves1; }
|
||||
|
|
|
@ -17,6 +17,7 @@ CScriptSpawnPoint::CScriptSpawnPoint(TUniqueId uid, std::string_view name, const
|
|||
x64_itemCounts[int(CPlayerState::EItemType::XRayVisor)] = 1;
|
||||
x64_itemCounts[int(CPlayerState::EItemType::GrappleBeam)] = 1;
|
||||
x64_itemCounts[int(CPlayerState::EItemType::BoostBall)] = 1;
|
||||
x64_itemCounts[int(CPlayerState::EItemType::ChargeBeam)] = 1;
|
||||
x10c_24_firstSpawn = defaultSpawn;
|
||||
x10c_25_morphed = morphed;
|
||||
}
|
||||
|
|
2
specter
2
specter
|
@ -1 +1 @@
|
|||
Subproject commit 1b3e19f74ccb55d4c20a8caf2f9c2a4ca06de335
|
||||
Subproject commit 550955b07c86724ba27000ed230713f8e4f2f711
|
Loading…
Reference in New Issue