...
 
Commits (2)
......@@ -102,8 +102,8 @@ void ViewManager::TestGameView::think() {
}
const urde::TAreaId aId = g_GameState->CurrentWorldState().GetCurrentAreaId();
if (areaInfo && areaInfo->toBoolean() && g_StateManager->WorldNC() &&
g_StateManager->WorldNC()->DoesAreaExist(aId)) {
if (areaInfo && areaInfo->toBoolean() && g_StateManager->GetWorld() &&
g_StateManager->GetWorld()->DoesAreaExist(aId)) {
const auto& layerStates = g_GameState->CurrentWorldState().GetLayerState();
std::string layerBits;
u32 totalActive = 0;
......@@ -117,7 +117,7 @@ void ViewManager::TestGameView::think() {
overlayText += fmt::format(fmt(
"Area AssetId: 0x{}, Total Objects: {}\n"
"Active Layer bits: {}\n"),
g_StateManager->WorldNC()->GetArea(aId)->GetAreaAssetId(),
g_StateManager->GetWorld()->GetArea(aId)->GetAreaAssetId(),
g_StateManager->GetAllObjectList().size(), layerBits);
}
......
......@@ -42,7 +42,7 @@ void CMapWorld::SetWhichMapAreasLoaded(const IWorld& wld, int start, int count)
for (int i = 0; i < 2; ++i) {
for (CMapAreaData* data = x10_listHeads[i]; data;) {
CMapAreaData* nextData = data->NextMapAreaData();
CMapAreaData* nextData = data->GetNextMapAreaData();
if (!IsMapAreaInBFSInfoVector(data, bfsInfos)) {
data->Unlock();
MoveMapAreaToList(data, EMapAreaList::Unloaded);
......@@ -64,11 +64,11 @@ bool CMapWorld::IsMapAreasStreaming() const {
CMapAreaData* data = x10_listHeads[1];
while (data != nullptr) {
if (data->IsLoaded()) {
CMapAreaData* next = data->NextMapAreaData();
CMapAreaData* next = data->GetNextMapAreaData();
const_cast<CMapWorld*>(this)->MoveMapAreaToList(data, EMapAreaList::Loaded);
data = next;
} else {
data = data->NextMapAreaData();
data = data->GetNextMapAreaData();
ret = true;
}
}
......@@ -78,13 +78,13 @@ bool CMapWorld::IsMapAreasStreaming() const {
void CMapWorld::MoveMapAreaToList(CMapWorld::CMapAreaData* data, CMapWorld::EMapAreaList list) {
CMapAreaData* last = nullptr;
for (CMapAreaData* head = x10_listHeads[int(data->GetContainingList())];;
last = head, head = head->NextMapAreaData()) {
last = head, head = head->GetNextMapAreaData()) {
if (head != data)
continue;
if (!last)
x10_listHeads[int(data->GetContainingList())] = head->NextMapAreaData();
x10_listHeads[int(data->GetContainingList())] = head->GetNextMapAreaData();
else
last->SetNextMapArea(head->NextMapAreaData());
last->SetNextMapArea(head->GetNextMapAreaData());
break;
}
data->SetNextMapArea(x10_listHeads[int(list)]);
......
......@@ -67,9 +67,9 @@ public:
void Unlock() { x0_area.Unlock(); }
bool IsLoaded() const { return x0_area.IsLoaded(); }
const CMapArea* GetMapArea() const { return x0_area.GetObj(); }
CMapAreaData* GetNextMapAreaData() { return x14_next; }
const CMapAreaData* GetNextMapAreaData() const { return x14_next; }
EMapAreaList GetContainingList() const { return x10_list; }
CMapAreaData* NextMapAreaData() { return x14_next; }
void SetContainingList(EMapAreaList list) { x10_list = list; }
void SetNextMapArea(CMapAreaData* next) { x14_next = next; }
};
......
......@@ -36,7 +36,7 @@ void CRelayTracker::RemoveRelay(TEditorId id) {
}
void CRelayTracker::SendMsgs(TAreaId areaId, CStateManager& stateMgr) {
const CWorld* world = stateMgr.WorldNC();
const CWorld* world = stateMgr.GetWorld();
u32 relayCount = world->GetRelayCount();
bool hasActiveRelays = false;
......
......@@ -381,7 +381,7 @@ public:
CEnvFxManager* GetEnvFxManager() { return x880_envFxManager; }
const CEnvFxManager* GetEnvFxManager() const { return x880_envFxManager; }
CWorld* WorldNC() { return x850_world.get(); }
CWorld* GetWorld() { return x850_world.get(); }
const CWorld* GetWorld() const { return x850_world.get(); }
CRelayTracker* GetRelayTracker() { return x8bc_relayTracker.get(); }
const CRelayTracker* GetRelayTracker() const { return x8bc_relayTracker.get(); }
......@@ -391,7 +391,8 @@ public:
const std::shared_ptr<CMapWorldInfo>& MapWorldInfo() const { return x8c0_mapWorldInfo; }
const std::shared_ptr<CWorldTransManager>& WorldTransManager() const { return x8c4_worldTransManager; }
const std::shared_ptr<CWorldLayerState>& LayerState() const { return x8c8_worldLayerState; }
const std::shared_ptr<CWorldLayerState>& WorldLayerState() const { return x8c8_worldLayerState; }
std::shared_ptr<CWorldLayerState>& WorldLayerState() { return x8c8_worldLayerState; }
CPlayer& GetPlayer() const { return *x84c_player; }
CPlayer* Player() const { return x84c_player.get(); }
......@@ -442,7 +443,6 @@ public:
void SetPlayerActorHead(TUniqueId id) { xf6c_playerActorHead = id; }
std::list<TUniqueId>& GetActiveFlickerBats() { return xf3c_activeFlickerBats; }
std::list<TUniqueId>& GetActiveParasites() { return xf54_activeParasites; }
std::shared_ptr<CWorldLayerState>& WorldLayerStateNC() { return x8c8_worldLayerState; }
static float g_EscapeShakeCountdown;
static bool g_EscapeShakeCountdownInit;
......
......@@ -46,7 +46,7 @@ pas::EAnimationState CABSAim::UpdateBody(float dt, CBodyController& bc, CStateMa
if (st == pas::EAnimationState::Invalid) {
const zeus::CVector3f& target = bc.GetCommandMgr().GetAdditiveTargetVector();
if (target.canBeNormalized()) {
CAnimData& animData = *bc.GetOwner().ModelData()->AnimationData();
CAnimData& animData = *bc.GetOwner().GetModelData()->GetAnimationData();
float hAngle = zeus::clamp(-x18_angles[0], std::atan2(target.x(), target.y()), x18_angles[1]);
hAngle *= 0.63661975f;
......@@ -85,7 +85,7 @@ pas::EAnimationState CABSAim::UpdateBody(float dt, CBodyController& bc, CStateMa
}
void CABSAim::Shutdown(CBodyController& bc) {
CAnimData& animData = *bc.GetOwner().ModelData()->AnimationData();
CAnimData& animData = *bc.GetOwner().GetModelData()->GetAnimationData();
if (x28_hWeight != 0.f)
animData.DelAdditiveAnimation(x8_anims[x28_hWeight < 0.f ? 0 : 1]);
......@@ -102,7 +102,7 @@ void CABSFlinch::Start(CBodyController& bc, CStateManager& mgr) {
std::pair<float, s32> best = bc.GetPASDatabase().FindBestAnimation(parms, *mgr.GetActiveRandom(), -1);
x8_anim = best.second;
CAnimData& animData = *bc.GetOwner().ModelData()->AnimationData();
CAnimData& animData = *bc.GetOwner().GetModelData()->GetAnimationData();
animData.AddAdditiveAnimation(x8_anim, x4_weight, false, true);
}
......@@ -115,7 +115,7 @@ pas::EAnimationState CABSFlinch::GetBodyStateTransition(float dt, CBodyControlle
pas::EAnimationState CABSFlinch::UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) {
const pas::EAnimationState st = GetBodyStateTransition(dt, bc);
if (st == pas::EAnimationState::Invalid) {
CAnimData& animData = *bc.GetOwner().ModelData()->AnimationData();
CAnimData& animData = *bc.GetOwner().GetModelData()->GetAnimationData();
CCharAnimTime rem = animData.GetAdditiveAnimationTree(x8_anim)->VGetTimeRemaining();
if (std::fabs(rem.GetSeconds()) < 0.00001f)
return pas::EAnimationState::AdditiveIdle;
......@@ -149,7 +149,7 @@ void CABSReaction::Start(CBodyController& bc, CStateManager& mgr) {
x8_anim = best.second;
if (x8_anim != -1) {
CAnimData& animData = *bc.GetOwner().ModelData()->AnimationData();
CAnimData& animData = *bc.GetOwner().GetModelData()->GetAnimationData();
animData.AddAdditiveAnimation(x8_anim, x4_weight, x10_active, false);
}
}
......@@ -166,7 +166,7 @@ pas::EAnimationState CABSReaction::UpdateBody(float dt, CBodyController& bc, CSt
if (x8_anim == -1)
return pas::EAnimationState::AdditiveIdle;
CAnimData& animData = *bc.GetOwner().ModelData()->AnimationData();
CAnimData& animData = *bc.GetOwner().GetModelData()->GetAnimationData();
if (x10_active) {
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::StopReaction)) {
StopAnimation(bc);
......@@ -190,7 +190,7 @@ pas::EAnimationState CABSReaction::UpdateBody(float dt, CBodyController& bc, CSt
void CABSReaction::StopAnimation(CBodyController& bc) {
if (x8_anim != -1) {
CAnimData& animData = *bc.GetOwner().ModelData()->AnimationData();
CAnimData& animData = *bc.GetOwner().GetModelData()->GetAnimationData();
animData.DelAdditiveAnimation(x8_anim);
x8_anim = -1;
}
......
......@@ -15,7 +15,7 @@ CBodyController::CBodyController(CActor& actor, float turnSpeed, EBodyType bodyT
x2a4_bodyStateInfo.x18_bodyController = this;
}
void CBodyController::EnableAnimation(bool e) { x0_actor.ModelData()->AnimationData()->EnableAnimation(e); }
void CBodyController::EnableAnimation(bool e) { x0_actor.GetModelData()->GetAnimationData()->EnableAnimation(e); }
void CBodyController::Activate(CStateManager& mgr) {
x300_25_active = true;
......@@ -77,8 +77,8 @@ void CBodyController::Update(float dt, CStateManager& mgr) {
bool CBodyController::HasBodyState(pas::EAnimationState s) const { return GetPASDatabase().HasState(s32(s)); }
void CBodyController::SetCurrentAnimation(const CAnimPlaybackParms& parms, bool loop, bool noTrans) {
x0_actor.ModelData()->AnimationData()->SetAnimation(parms, noTrans);
x0_actor.ModelData()->EnableLooping(loop);
x0_actor.GetModelData()->GetAnimationData()->SetAnimation(parms, noTrans);
x0_actor.GetModelData()->EnableLooping(loop);
x2f8_curAnim = parms.GetAnimationId();
}
......@@ -86,13 +86,13 @@ float CBodyController::GetAnimTimeRemaining() const {
return x0_actor.GetModelData()->GetAnimationData()->GetAnimTimeRemaining("Whole Body");
}
void CBodyController::SetPlaybackRate(float r) { x0_actor.ModelData()->AnimationData()->SetPlaybackRate(r); }
void CBodyController::SetPlaybackRate(float r) { x0_actor.GetModelData()->GetAnimationData()->SetPlaybackRate(r); }
const CPASDatabase& CBodyController::GetPASDatabase() const {
return x0_actor.GetModelData()->GetAnimationData()->GetCharacterInfo().GetPASDatabase();
}
void CBodyController::MultiplyPlaybackRate(float r) { x0_actor.ModelData()->AnimationData()->MultiplyPlaybackRate(r); }
void CBodyController::MultiplyPlaybackRate(float r) { x0_actor.GetModelData()->GetAnimationData()->MultiplyPlaybackRate(r); }
void CBodyController::FaceDirection(const zeus::CVector3f& v0, float dt) {
if (x300_26_frozen)
......
......@@ -133,7 +133,7 @@ public:
void DisintegrateDraw(EWhichModel which, const zeus::CTransform& xf, const CTexture& tex,
const zeus::CColor& addColor, float t);
CAnimData* AnimationData() { return x10_animData.get(); }
CAnimData* GetAnimationData() { return x10_animData.get(); }
const CAnimData* GetAnimationData() const { return x10_animData.get(); }
const TLockedToken<CModel>& GetNormalModel() const { return x1c_normalModel; }
const TLockedToken<CModel>& GetXRayModel() const { return x2c_xrayModel; }
......
......@@ -305,7 +305,7 @@ void CRagDoll::Update(CStateManager& mgr, float dt, float waterTop) {
void CRagDoll::Prime(CStateManager& mgr, const zeus::CTransform& xf, CModelData& mData) {
zeus::CVector3f scale = mData.GetScale();
CAnimData* aData = mData.AnimationData();
CAnimData* aData = mData.GetAnimationData();
aData->BuildPose();
for (auto& particle : x4_particles)
if (particle.x0_id != 0xff)
......
......@@ -186,7 +186,7 @@ void CMFGame::Touch() {
if (gunVisible)
player.GetPlayerGun()->TouchModel(*x14_stateManager);
if (samusVisible)
player.ModelData()->Touch(*x14_stateManager, 0);
player.GetModelData()->Touch(*x14_stateManager, 0);
if (ballVisible)
player.GetMorphBall()->TouchModel(*x14_stateManager);
}
......
......@@ -107,7 +107,7 @@ CModelData CSamusDoll::BuildSuitModelData1(CPlayerState::EPlayerSuit suit) {
CModelData ret(CAnimRes(g_ResFactory->GetResourceIdByName("ANCS_ItemScreenSamus")->id, Character1Idxs[int(suit)],
zeus::skOne3f, 2, true));
CAnimPlaybackParms parms(2, -1, 1.f, true);
ret.AnimationData()->SetAnimation(parms, false);
ret.GetAnimationData()->SetAnimation(parms, false);
return ret;
}
......@@ -115,7 +115,7 @@ CModelData CSamusDoll::BuildSuitModelDataBoots(CPlayerState::EPlayerSuit suit) {
CModelData ret(CAnimRes(g_ResFactory->GetResourceIdByName("ANCS_ItemScreenSamus")->id, CharacterBootsIdxs[int(suit)],
zeus::skOne3f, 2, true));
CAnimPlaybackParms parms(2, -1, 1.f, true);
ret.AnimationData()->SetAnimation(parms, false);
ret.GetAnimationData()->SetAnimation(parms, false);
return ret;
}
......@@ -177,8 +177,8 @@ void CSamusDoll::Update(float dt, CRandom16& rand) {
if (x54_remTransitionTime == 0.f) {
x4c_completedMorphball = x4d_selectedMorphball;
if (!x4d_selectedMorphball) {
xc8_suitModel0->AnimationData()->SetAnimation(CAnimPlaybackParms(2, -1, 1.f, true), false);
x134_suitModelBoots->AnimationData()->SetAnimation(CAnimPlaybackParms(2, -1, 1.f, true), false);
xc8_suitModel0->GetAnimationData()->SetAnimation(CAnimPlaybackParms(2, -1, 1.f, true), false);
x134_suitModelBoots->GetAnimationData()->SetAnimation(CAnimPlaybackParms(2, -1, 1.f, true), false);
}
}
}
......@@ -293,10 +293,10 @@ void CSamusDoll::Draw(const CStateManager& mgr, float alpha) {
for (size_t i = 0; i <= x118_suitModel1and2.size(); ++i) {
TCachedToken<CSkinnedModel> backupModelData = xc8_suitModel0->GetAnimationData()->GetModelData();
if (i < x118_suitModel1and2.size())
xc8_suitModel0->AnimationData()->SubstituteModelData(x118_suitModel1and2[i]);
xc8_suitModel0->GetAnimationData()->SubstituteModelData(x118_suitModel1and2[i]);
xc8_suitModel0->InvSuitDraw(CModelData::EWhichModel::Normal, zeus::CTransform(), x24c_actorLights.get(),
zeus::CColor(1.f, alpha), zeus::CColor(1.f, alpha * suitPulse));
xc8_suitModel0->AnimationData()->SubstituteModelData(backupModelData);
xc8_suitModel0->GetAnimationData()->SubstituteModelData(backupModelData);
}
x134_suitModelBoots->InvSuitDraw(CModelData::EWhichModel::Normal, zeus::CTransform(),
......@@ -522,9 +522,9 @@ void CSamusDoll::Draw(const CStateManager& mgr, float alpha) {
void CSamusDoll::Touch() {
if (!CheckLoadComplete())
return;
xc8_suitModel0->AnimationData()->PreRender();
x134_suitModelBoots->AnimationData()->PreRender();
x184_ballModelData->AnimationData()->PreRender();
xc8_suitModel0->GetAnimationData()->PreRender();
x134_suitModelBoots->GetAnimationData()->PreRender();
x184_ballModelData->GetAnimationData()->PreRender();
xc8_suitModel0->Touch(CModelData::EWhichModel::Normal, 0);
x134_suitModelBoots->Touch(CModelData::EWhichModel::Normal, 0);
x184_ballModelData->Touch(CModelData::EWhichModel::Normal, 0);
......@@ -547,13 +547,13 @@ void CSamusDoll::SetInMorphball(bool morphball) {
void CSamusDoll::SetTransitionAnimation() {
if (!x4c_completedMorphball) {
/* Into morphball */
xc8_suitModel0->AnimationData()->SetAnimation(CAnimPlaybackParms{0, -1, 1.f, true}, false);
x134_suitModelBoots->AnimationData()->SetAnimation(CAnimPlaybackParms{0, -1, 1.f, true}, false);
xc8_suitModel0->GetAnimationData()->SetAnimation(CAnimPlaybackParms{0, -1, 1.f, true}, false);
x134_suitModelBoots->GetAnimationData()->SetAnimation(CAnimPlaybackParms{0, -1, 1.f, true}, false);
x50_totalTransitionTime = x54_remTransitionTime = xc8_suitModel0->GetAnimationData()->GetAnimationDuration(0);
} else if (!x4d_selectedMorphball) {
/* Outta morphball */
xc8_suitModel0->AnimationData()->SetAnimation(CAnimPlaybackParms{1, -1, 1.f, true}, false);
x134_suitModelBoots->AnimationData()->SetAnimation(CAnimPlaybackParms{1, -1, 1.f, true}, false);
xc8_suitModel0->GetAnimationData()->SetAnimation(CAnimPlaybackParms{1, -1, 1.f, true}, false);
x134_suitModelBoots->GetAnimationData()->SetAnimation(CAnimPlaybackParms{1, -1, 1.f, true}, false);
x50_totalTransitionTime = x54_remTransitionTime = xc8_suitModel0->GetAnimationData()->GetAnimationDuration(1);
}
}
......
......@@ -15,7 +15,7 @@ CSamusFaceReflection::CSamusFaceReflection(CStateManager& stateMgr)
, x4c_lights(std::make_unique<CActorLights>(8, zeus::skZero3f, 4, 4, false, false, false, 0.1f)) {
x60_lookDir = zeus::skForward;
CAnimPlaybackParms parms(0, -1, 1.f, true);
x0_modelData.AnimationData()->SetAnimation(parms, false);
x0_modelData.GetAnimationData()->SetAnimation(parms, false);
}
void CSamusFaceReflection::PreDraw(const CStateManager& mgr) {
......@@ -24,7 +24,7 @@ void CSamusFaceReflection::PreDraw(const CStateManager& mgr) {
x70_hidden = true;
} else {
x70_hidden = false;
x0_modelData.AnimationData()->PreRender();
x0_modelData.GetAnimationData()->PreRender();
}
}
}
......
......@@ -59,7 +59,7 @@ CBabygoth::CBabygoth(TUniqueId uid, std::string_view name, const CEntityInfo& in
, x6ec_pathSearch(nullptr, 1, pInfo.GetPathfindingIndex(), 1.f, 1.f)
, x7d0_approachPathSearch(nullptr, 1, pInfo.GetPathfindingIndex(), 1.f, 1.f)
, x8d0_initialSpeed(x3b4_speed)
, x8f0_boneTracking(*ModelData()->AnimationData(), "Head_1"sv, zeus::degToRad(80.f), zeus::degToRad(180.f),
, x8f0_boneTracking(*GetModelData()->GetAnimationData(), "Head_1"sv, zeus::degToRad(80.f), zeus::degToRad(180.f),
EBoneTrackingFlags::None)
, x930_aabox(GetBoundingBox(), GetMaterialList())
, x958_iceProjectile(babyData.x8_fireballWeapon, babyData.xc_fireballDamage)
......@@ -72,7 +72,7 @@ CBabygoth::CBabygoth(TUniqueId uid, std::string_view name, const CEntityInfo& in
TLockedToken<CSkinRules> skin = g_SimplePool->GetObj({SBIG('CSKR'), babyData.x13c_noShellSkin});
xa08_noShellModel =
CToken(TObjOwnerDerivedFromIObj<CSkinnedModel>::GetNewDerivedObject(std::make_unique<CSkinnedModel>(
model, skin, x64_modelData->AnimationData()->GetModelData()->GetLayoutInfo(), 1, 1)));
model, skin, x64_modelData->GetAnimationData()->GetModelData()->GetLayoutInfo(), 1, 1)));
xa14_crackOneParticle = g_SimplePool->GetObj({SBIG('PART'), babyData.x14c_crackOneParticle});
xa20_crackTwoParticle = g_SimplePool->GetObj({SBIG('PART'), babyData.x150_crackTwoParticle});
xa2c_destroyShellParticle = g_SimplePool->GetObj({SBIG('PART'), babyData.x154_destroyShellParticle});
......@@ -218,9 +218,9 @@ void CBabygoth::Think(float dt, CStateManager& mgr) {
if (x450_bodyController->IsElectrocuting())
x8f0_boneTracking.SetActive(false);
UpdateTimers(dt);
ModelData()->AnimationData()->PreRender();
GetModelData()->GetAnimationData()->PreRender();
x8f0_boneTracking.Update(dt);
x8f0_boneTracking.PreRender(mgr, *ModelData()->AnimationData(), GetTransform(), GetModelData()->GetScale(),
x8f0_boneTracking.PreRender(mgr, *GetModelData()->GetAnimationData(), GetTransform(), GetModelData()->GetScale(),
*x450_bodyController);
x928_colActMgr->Update(dt, mgr, CCollisionActorManager::EUpdateOptions(!xa49_29_objectSpaceCollision));
xa49_29_objectSpaceCollision = true;
......@@ -1094,7 +1094,7 @@ bool CBabygoth::IsDestinationObstructed(CStateManager& mgr) {
}
void CBabygoth::DestroyShell(CStateManager& mgr) {
ModelData()->AnimationData()->SubstituteModelData(xa08_noShellModel);
GetModelData()->GetAnimationData()->SubstituteModelData(xa08_noShellModel);
for (TUniqueId uid : x9f8_shellIds) {
if (TCastToPtr<CCollisionActor> colAct = mgr.ObjectById(uid)) {
......
......@@ -79,11 +79,11 @@ static std::string_view sFireEffects[3] = {
};
void CBloodFlower::TurnEffectsOn(u32 effect, CStateManager& mgr) {
ModelData()->AnimationData()->SetParticleEffectState(sFireEffects[effect], true, mgr);
GetModelData()->GetAnimationData()->SetParticleEffectState(sFireEffects[effect], true, mgr);
}
void CBloodFlower::TurnEffectsOff(u32 effect, CStateManager& mgr) {
ModelData()->AnimationData()->SetParticleEffectState(sFireEffects[effect], false, mgr);
GetModelData()->GetAnimationData()->SetParticleEffectState(sFireEffects[effect], false, mgr);
}
void CBloodFlower::Think(float dt, CStateManager& mgr) {
......
......@@ -97,8 +97,8 @@ void CEyeball::Think(float dt, CStateManager& mgr) {
x5a8_targetPosition = player.GetTranslation() - (0.5f * player.GetVelocity());
x570_boneTracking.SetTargetPosition(x5a8_targetPosition);
x570_boneTracking.Update(dt);
ModelData()->AnimationData()->PreRender();
x570_boneTracking.PreRender(mgr, *ModelData()->AnimationData(), GetTransform(), GetModelData()->GetScale(),
GetModelData()->GetAnimationData()->PreRender();
x570_boneTracking.PreRender(mgr, *GetModelData()->GetAnimationData(), GetTransform(), GetModelData()->GetScale(),
*x450_bodyController.get());
} else
x570_boneTracking.SetActive(false);
......@@ -232,7 +232,7 @@ void CEyeball::FireBeam(CStateManager& mgr, const zeus::CTransform& xf) {
void CEyeball::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) {
CPatterned::PreRender(mgr, frustum);
x570_boneTracking.PreRender(mgr, *ModelData()->AnimationData(), GetTransform(), GetModelData()->GetScale(),
x570_boneTracking.PreRender(mgr, *GetModelData()->GetAnimationData(), GetTransform(), GetModelData()->GetScale(),
*x450_bodyController);
}
......
......@@ -61,7 +61,7 @@ CFireFlea::CFireFlea(TUniqueId uid, std::string_view name, const CEntityInfo& in
filter.ExcludeList().Add(EMaterialTypes::Character);
SetMaterialFilter(filter);
ModelData()->AnimationData()->SetParticleLightIdx(sLightIdx);
GetModelData()->GetAnimationData()->SetParticleLightIdx(sLightIdx);
++sLightIdx;
}
......
......@@ -119,7 +119,7 @@ void CFlaahgra::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateM
switch (msg) {
case EScriptObjectMessage::InitializedInArea: {
if (!x8e4_25_loading && !x8e4_24_loaded) {
const_cast<CGameArea::CPostConstructed*>(mgr.WorldNC()->GetAreaAlways(GetAreaIdAlways())->GetPostConstructed())
const_cast<CGameArea::CPostConstructed*>(mgr.GetWorld()->GetAreaAlways(GetAreaIdAlways())->GetPostConstructed())
->x113c_playerActorsLoading++;
x8e4_25_loading = true;
}
......@@ -396,7 +396,7 @@ void CFlaahgra::LoadTokens(CStateManager& mgr) {
void CFlaahgra::FinalizeLoad(CStateManager& mgr) {
x8e4_24_loaded = true;
if (x8e4_25_loading) {
const_cast<CGameArea::CPostConstructed*>(mgr.WorldNC()->GetAreaAlways(GetAreaIdAlways())->GetPostConstructed())
const_cast<CGameArea::CPostConstructed*>(mgr.GetWorld()->GetAreaAlways(GetAreaIdAlways())->GetPostConstructed())
->x113c_playerActorsLoading--;
x8e4_25_loading = false;
}
......@@ -411,7 +411,7 @@ void CFlaahgra::Think(float dt, CStateManager& mgr) {
CPatterned::Think(dt, mgr);
x6cc_boneTracking->Update(dt);
UpdateCollisionManagers(dt, mgr);
x6cc_boneTracking->PreRender(mgr, *ModelData()->AnimationData(), GetTransform(), GetModelData()->GetScale(),
x6cc_boneTracking->PreRender(mgr, *GetModelData()->GetAnimationData(), GetTransform(), GetModelData()->GetScale(),
*x450_bodyController);
UpdateSmallScaleReGrowth(dt);
UpdateHealthInfo(mgr);
......@@ -508,7 +508,7 @@ void CFlaahgra::SetupCollisionManagers(CStateManager& mgr) {
{EMaterialTypes::CollisionActor, EMaterialTypes::AIPassthrough, EMaterialTypes::Player}));
AddMaterial(EMaterialTypes::ProjectilePassthrough, EMaterialTypes::Target, EMaterialTypes::Orbit, mgr);
RemoveMaterial(EMaterialTypes::Solid, mgr);
ModelData()->SetScale(oldScale);
GetModelData()->SetScale(oldScale);
x7a4_sphereCollision->AddMaterial(mgr, {EMaterialTypes::AIJoint, EMaterialTypes::CameraPassthrough});
x79c_leftArmCollision->AddMaterial(mgr, {EMaterialTypes::AIJoint, EMaterialTypes::CameraPassthrough});
x7a0_rightArmCollision->AddMaterial(mgr, {EMaterialTypes::AIJoint, EMaterialTypes::CameraPassthrough});
......@@ -797,7 +797,7 @@ void CFlaahgra::SetCollisionActorBounds(CStateManager& mgr, const std::unique_pt
}
void CFlaahgra::UpdateScale(float t, float min, float max) {
float scale = (t * (max - min) + min);
ModelData()->SetScale(zeus::skOne3f * scale);
GetModelData()->SetScale(zeus::skOne3f * scale);
}
float CFlaahgra::GetEndActionTime() const {
......
......@@ -12,7 +12,7 @@ CFlaahgraTentacle::CFlaahgraTentacle(TUniqueId uid, std::string_view name, const
: CPatterned(ECharacter::FlaahgraTentacle, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
EMovementType::Flyer, EColliderType::One, EBodyType::Restricted, actParms, EKnockBackVariant::Large) {
x58e_24_ = false;
ActorLights()->SetCastShadows(false);
GetActorLights()->SetCastShadows(false);
x460_knockBackController.SetAutoResetImpulse(false);
CreateShadow(false);
}
......
......@@ -214,10 +214,10 @@ void CNewIntroBoss::Think(float dt, CStateManager& mgr) {
if (x63c_attackTime > 0.f)
x63c_attackTime -= dt;
ModelData()->AnimationData()->PreRender();
GetModelData()->GetAnimationData()->PreRender();
if (x400_25_alive)
x574_boneTracking.PreRender(mgr, *ModelData()->AnimationData(), x34_transform, ModelData()->GetScale(),
x574_boneTracking.PreRender(mgr, *GetModelData()->GetAnimationData(), x34_transform, GetModelData()->GetScale(),
*x450_bodyController);
x5ec_collisionManager->Update(dt, mgr, CCollisionActorManager::EUpdateOptions::ObjectSpace);
......
......@@ -72,7 +72,7 @@ CParasite::CParasite(TUniqueId uid, std::string_view name, EFlavorType flavor, c
TLockedToken<CModel> skin = g_SimplePool->GetObj({FOURCC('CSKR'), skinRes});
x624_extraModel =
CToken(TObjOwnerDerivedFromIObj<CSkinnedModel>::GetNewDerivedObject(std::make_unique<CSkinnedModel>(
model, skin, x64_modelData->AnimationData()->GetModelData()->GetLayoutInfo(), 1, 1)));
model, skin, x64_modelData->GetAnimationData()->GetModelData()->GetLayoutInfo(), 1, 1)));
break;
}
default:
......@@ -205,7 +205,7 @@ void CParasite::UpdateCollisionActors(float dt, CStateManager& mgr) {
AddMaterial(EMaterialTypes::Solid, mgr);
RemoveMaterial(EMaterialTypes::ProjectilePassthrough, mgr);
DestroyActorManager(mgr);
x64_modelData->AnimationData()->SubstituteModelData(x624_extraModel);
x64_modelData->GetAnimationData()->SubstituteModelData(x624_extraModel);
}
}
}
......@@ -219,7 +219,7 @@ void CParasite::Think(float dt, CStateManager& mgr) {
UpdateCollisionActors(dt, mgr);
x5d6_26_playerObstructed = false;
CGameArea* area = mgr.WorldNC()->GetArea(GetAreaIdAlways());
CGameArea* area = mgr.GetWorld()->GetArea(GetAreaIdAlways());
CGameArea::EOcclusionState r6 = CGameArea::EOcclusionState::Occluded;
if (area->IsPostConstructed())
......
......@@ -64,7 +64,7 @@ CPirateRagDoll::CPirateRagDoll(CStateManager& mgr, CSpacePirate* sp, u16 thudSfx
SetNumLengthConstraints(47);
SetNumJointConstraints(4);
zeus::CVector3f scale = x6c_spacePirate->GetModelData()->GetScale();
CAnimData* aData = x6c_spacePirate->ModelData()->AnimationData();
CAnimData* aData = x6c_spacePirate->GetModelData()->GetAnimationData();
aData->BuildPose();
zeus::CVector3f center = x6c_spacePirate->GetBoundingBox().center();
for (int i = 0; i < 14; ++i) {
......@@ -139,7 +139,7 @@ CPirateRagDoll::CPirateRagDoll(CStateManager& mgr, CSpacePirate* sp, u16 thudSfx
void CPirateRagDoll::PreRender(const zeus::CVector3f& v, CModelData& mData) {
if (!x68_25_over || x68_27_continueSmallMovements) {
CAnimData* aData = mData.AnimationData();
CAnimData* aData = mData.GetAnimationData();
for (CSegId id : aData->GetCharLayoutInfo().GetSegIdList().GetList())
if (aData->GetCharLayoutInfo().GetRootNode()->GetBoneMap()[id].x10_children.size() > 1)
aData->PoseBuilder().GetTreeMap()[id].x4_rotation = zeus::CQuaternion();
......@@ -341,7 +341,7 @@ CSpacePirate::CSpacePirate(TUniqueId uid, std::string_view name, const CEntityIn
, x568_pirateData(in, propCount)
, x660_pathFindSearch(nullptr, 0x1, pInfo.GetPathfindingIndex(), 1.f, 1.f)
, x750_initialHP(pInfo.GetHealthInfo().GetHP())
, x764_boneTracking(*x64_modelData->AnimationData(), "Head_1"sv, 1.22173f, 3.14159f, EBoneTrackingFlags::None)
, x764_boneTracking(*x64_modelData->GetAnimationData(), "Head_1"sv, 1.22173f, 3.14159f, EBoneTrackingFlags::None)
, x7c4_burstFire(skBursts, x568_pirateData.xac_firstBurstCount)
, x8b8_minCloakAlpha(x568_pirateData.xb0_CloakOpacity)
, x8bc_maxCloakAlpha(x568_pirateData.xb4_MaxCloakOpacity)
......@@ -548,7 +548,7 @@ bool CSpacePirate::FireProjectile(float dt, CStateManager& mgr) {
auto bestAnim = x450_bodyController->GetPASDatabase().FindBestAnimation({24, CPASAnimParm::FromEnum(2)},
*mgr.GetActiveRandom(), -1);
if (bestAnim.first > 0.f)
x64_modelData->AnimationData()->AddAdditiveAnimation(bestAnim.second, 1.f, false, true);
x64_modelData->GetAnimationData()->AddAdditiveAnimation(bestAnim.second, 1.f, false, true);
CSfxManager::AddEmitter(x568_pirateData.x48_Sound_Projectile, GetTranslation(), zeus::skZero3f, true,
false, 0x7f, kInvalidAreaId);
}
......@@ -801,9 +801,9 @@ void CSpacePirate::SetEyeParticleActive(CStateManager& mgr, bool active) {
if (!x636_24_trooper) {
if (!x634_29_onlyAttackInRange || x635_26_seated) {
if (!x635_27_shadowPirate)
x64_modelData->AnimationData()->SetParticleEffectState("TwoEyes"sv, active, mgr);
x64_modelData->GetAnimationData()->SetParticleEffectState("TwoEyes"sv, active, mgr);
} else {
x64_modelData->AnimationData()->SetParticleEffectState("OneEye"sv, active, mgr);
x64_modelData->GetAnimationData()->SetParticleEffectState("OneEye"sv, active, mgr);
}
}
}
......@@ -978,9 +978,9 @@ void CSpacePirate::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum)
x85c_ragDoll->PreRender(GetTranslation(), *x64_modelData);
CPatterned::PreRender(mgr, frustum);
if (!x85c_ragDoll || !x85c_ragDoll->IsPrimed()) {
x764_boneTracking.PreRender(mgr, *x64_modelData->AnimationData(), x34_transform, x64_modelData->GetScale(),
x764_boneTracking.PreRender(mgr, *x64_modelData->GetAnimationData(), x34_transform, x64_modelData->GetScale(),
*x450_bodyController);
x860_ikChain.PreRender(*x64_modelData->AnimationData(), x34_transform, x64_modelData->GetScale());
x860_ikChain.PreRender(*x64_modelData->GetAnimationData(), x34_transform, x64_modelData->GetScale());
}
}
......@@ -1043,7 +1043,7 @@ void CSpacePirate::DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node
CSegId lctrId = x64_modelData->GetAnimationData()->GetLocatorSegId(node.GetLocatorName());
if (lctrId != 3) {
zeus::CTransform xf = GetLctrTransform(lctrId);
x860_ikChain.Activate(*x64_modelData->AnimationData(), lctrId, xf);
x860_ikChain.Activate(*x64_modelData->GetAnimationData(), lctrId, xf);
x639_28_satUp = true;
}
}
......
......@@ -25,7 +25,7 @@ CSpankWeed::CSpankWeed(TUniqueId uid, std::string_view name, const CEntityInfo&
if (modelScale.x() != modelScale.y() || modelScale.x() != modelScale.z()) {
float scale = modelScale.magnitude() / std::sqrt(3.f);
ModelData()->SetScale(zeus::CVector3f(scale));
GetModelData()->SetScale(zeus::CVector3f(scale));
SpankLog.report(logvisor::Level::Warning,
fmt("WARNING: Non-uniform scale {} applied to Spank Weed"
"...changing scale to ({} {} {})\n"),
......
......@@ -116,42 +116,42 @@ void CGrappleArm::SetAnimState(EArmState state) {
if (x334_animState == state)
return;
x0_grappleArmModel->AnimationData()->EnableLooping(false);
x0_grappleArmModel->GetAnimationData()->EnableLooping(false);
x3b2_28_isGrappling = true;
switch (state) {
case EArmState::IntoGrapple: {
ResetAuxParams(true);
CAnimPlaybackParms parms(0, -1, 1.f, true);
x0_grappleArmModel->AnimationData()->SetAnimation(parms, false);
x0_grappleArmModel->GetAnimationData()->SetAnimation(parms, false);
x3b2_25_beamActive = false;
x3b2_24_active = true;
break;
}
case EArmState::IntoGrappleIdle: {
CAnimPlaybackParms parms(1, -1, 1.f, true);
x0_grappleArmModel->AnimationData()->EnableLooping(true);
x0_grappleArmModel->AnimationData()->SetAnimation(parms, false);
x0_grappleArmModel->GetAnimationData()->EnableLooping(true);
x0_grappleArmModel->GetAnimationData()->SetAnimation(parms, false);
break;
}
case EArmState::FireGrapple: {
CAnimPlaybackParms parms(2, -1, 1.f, true);
x0_grappleArmModel->AnimationData()->SetAnimation(parms, false);
x0_grappleArmModel->GetAnimationData()->SetAnimation(parms, false);
break;
}
case EArmState::ConnectGrapple: {
CAnimPlaybackParms parms(3, -1, 1.f, true);
x0_grappleArmModel->AnimationData()->SetAnimation(parms, false);
x0_grappleArmModel->GetAnimationData()->SetAnimation(parms, false);
break;
}
case EArmState::Connected: {
CAnimPlaybackParms parms(3, -1, 1.f, true);
x0_grappleArmModel->AnimationData()->SetAnimation(parms, false);
x0_grappleArmModel->GetAnimationData()->SetAnimation(parms, false);
break;
}
case EArmState::OutOfGrapple: {
CAnimPlaybackParms parms(4, -1, 1.f, true);
x0_grappleArmModel->AnimationData()->SetAnimation(parms, false);
x0_grappleArmModel->GetAnimationData()->SetAnimation(parms, false);
DisconnectGrappleBeam();
break;
}
......@@ -465,9 +465,9 @@ void CGrappleArm::Update(float grappleSwingT, float dt, CStateManager& mgr) {
void CGrappleArm::PreRender(const CStateManager& mgr, const zeus::CFrustum& frustum, const zeus::CVector3f& camPos) {
if (x3b2_24_active && !x3b2_29_suitLoading) {
x0_grappleArmModel->AnimationData()->PreRender();
x0_grappleArmModel->GetAnimationData()->PreRender();
if (x50_grappleArmSkeletonModel)
x50_grappleArmSkeletonModel->AnimationData()->PreRender();
x50_grappleArmSkeletonModel->GetAnimationData()->PreRender();
}
}
......@@ -478,7 +478,7 @@ void CGrappleArm::RenderXRayModel(const CStateManager& mgr, const zeus::CTransfo
// g_Renderer->SetAmbientColor(zeus::skWhite);
CSkinnedModel& model = const_cast<CSkinnedModel&>(*x50_grappleArmSkeletonModel->GetAnimationData()->GetModelData());
model.GetModelInst()->ActivateLights({CLight::BuildLocalAmbient({}, zeus::skWhite)});
const_cast<CGrappleArm*>(this)->x0_grappleArmModel->AnimationData()->Render(model, flags, {}, nullptr);
const_cast<CGrappleArm*>(this)->x0_grappleArmModel->GetAnimationData()->Render(model, flags, {}, nullptr);
// g_Renderer->SetAmbientColor(zeus::skWhite);
// CGraphics::DisableAllLights();
}
......
......@@ -6,17 +6,17 @@
namespace urde {
void CGunController::LoadFidgetAnimAsync(CStateManager& mgr, s32 type, s32 gunId, s32 animSet) {
x30_fidget.LoadAnimAsync(*x0_modelData.AnimationData(), type, gunId, animSet, mgr);
x30_fidget.LoadAnimAsync(*x0_modelData.GetAnimationData(), type, gunId, animSet, mgr);
}
void CGunController::EnterFidget(CStateManager& mgr, s32 type, s32 gunId, s32 animSet) {
x54_curAnimId = x30_fidget.SetAnim(*x0_modelData.AnimationData(), type, gunId, animSet, mgr);
x54_curAnimId = x30_fidget.SetAnim(*x0_modelData.GetAnimationData(), type, gunId, animSet, mgr);
x50_gunState = EGunState::Fidget;
}
void CGunController::EnterFreeLook(CStateManager& mgr, s32 gunId, s32 setId) {
if (x50_gunState != EGunState::ComboFire && !x58_25_enteredComboFire)
x54_curAnimId = x4_freeLook.SetAnim(*x0_modelData.AnimationData(), gunId, setId, 0, mgr, 0.f);
x54_curAnimId = x4_freeLook.SetAnim(*x0_modelData.GetAnimationData(), gunId, setId, 0, mgr, 0.f);
else
x4_freeLook.SetLoopState(x1c_comboFire.GetLoopState());
x50_gunState = EGunState::FreeLook;
......@@ -24,7 +24,7 @@ void CGunController::EnterFreeLook(CStateManager& mgr, s32 gunId, s32 setId) {
void CGunController::EnterComboFire(CStateManager& mgr, s32 gunId) {
if (x50_gunState != EGunState::FreeLook)
x54_curAnimId = x1c_comboFire.SetAnim(*x0_modelData.AnimationData(), gunId, 0, mgr, 0.f);
x54_curAnimId = x1c_comboFire.SetAnim(*x0_modelData.GetAnimationData(), gunId, 0, mgr, 0.f);
else
x1c_comboFire.SetLoopState(x4_freeLook.GetLoopState());
x50_gunState = EGunState::ComboFire;
......@@ -46,13 +46,13 @@ void CGunController::EnterStruck(CStateManager& mgr, float angle, bool bigStrike
break;
}
const CPASDatabase& pasDatabase = x0_modelData.AnimationData()->GetCharacterInfo().GetPASDatabase();
const CPASDatabase& pasDatabase = x0_modelData.GetAnimationData()->GetCharacterInfo().GetPASDatabase();
CPASAnimParmData parms(2, CPASAnimParm::FromInt32(x4_freeLook.GetGunId()), CPASAnimParm::FromReal32(angle),
CPASAnimParm::FromBool(bigStrike), CPASAnimParm::FromBool(b2));
std::pair<float, s32> anim = pasDatabase.FindBestAnimation(parms, *mgr.GetActiveRandom(), -1);
x0_modelData.AnimationData()->EnableLooping(false);
x0_modelData.GetAnimationData()->EnableLooping(false);
CAnimPlaybackParms aparms(anim.second, -1, 1.f, true);
x0_modelData.AnimationData()->SetAnimation(aparms, false);
x0_modelData.GetAnimationData()->SetAnimation(aparms, false);
x54_curAnimId = anim.second;
x58_25_enteredComboFire = false;
x50_gunState = bigStrike ? EGunState::BigStrike : EGunState::Strike;
......@@ -73,19 +73,19 @@ void CGunController::EnterIdle(CStateManager& mgr) {
return;
}
const CPASDatabase& pasDatabase = x0_modelData.AnimationData()->GetCharacterInfo().GetPASDatabase();
const CPASDatabase& pasDatabase = x0_modelData.GetAnimationData()->GetCharacterInfo().GetPASDatabase();
CPASAnimParmData parms(5, parm);
std::pair<float, s32> anim = pasDatabase.FindBestAnimation(parms, *mgr.GetActiveRandom(), -1);
x0_modelData.AnimationData()->EnableLooping(false);
x0_modelData.GetAnimationData()->EnableLooping(false);
CAnimPlaybackParms aparms(anim.second, -1, 1.f, true);
x0_modelData.AnimationData()->SetAnimation(aparms, false);
x0_modelData.GetAnimationData()->SetAnimation(aparms, false);
x54_curAnimId = anim.second;
x50_gunState = EGunState::Idle;
x58_25_enteredComboFire = false;
}
bool CGunController::Update(float dt, CStateManager& mgr) {
CAnimData& animData = *x0_modelData.AnimationData();
CAnimData& animData = *x0_modelData.GetAnimationData();
switch (x50_gunState) {
case EGunState::FreeLook: {
x58_24_animDone = x4_freeLook.Update(animData, dt, mgr);
......@@ -126,7 +126,7 @@ bool CGunController::Update(float dt, CStateManager& mgr) {
}
void CGunController::ReturnToDefault(CStateManager& mgr, float dt, bool setState) {
CAnimData& animData = *x0_modelData.AnimationData();
CAnimData& animData = *x0_modelData.GetAnimationData();
switch (x50_gunState) {
case EGunState::Strike:
......@@ -159,11 +159,11 @@ void CGunController::ReturnToDefault(CStateManager& mgr, float dt, bool setState
}
void CGunController::ReturnToBasePosition(CStateManager& mgr, float) {
const CPASDatabase& pasDatabase = x0_modelData.AnimationData()->GetCharacterInfo().GetPASDatabase();
const CPASDatabase& pasDatabase = x0_modelData.GetAnimationData()->GetCharacterInfo().GetPASDatabase();
std::pair<float, s32> anim = pasDatabase.FindBestAnimation(CPASAnimParmData(6), *mgr.GetActiveRandom(), -1);
x0_modelData.AnimationData()->EnableLooping(false);
x0_modelData.GetAnimationData()->EnableLooping(false);
CAnimPlaybackParms parms(anim.second, -1, 1.f, true);
x0_modelData.AnimationData()->SetAnimation(parms, false);
x0_modelData.GetAnimationData()->SetAnimation(parms, false);
x54_curAnimId = anim.second;
x58_25_enteredComboFire = false;
}
......
......@@ -12,7 +12,7 @@ CGunMotion::CGunMotion(CAssetId ancsId, const zeus::CVector3f& scale)
}
void CGunMotion::LoadAnimations() {
NWeaponTypes::get_token_vector(*x0_modelData.AnimationData(), 0, 14, xa8_anims, true);
NWeaponTypes::get_token_vector(*x0_modelData.GetAnimationData(), 0, 14, xa8_anims, true);
}
bool CGunMotion::PlayPasAnim(SamusGun::EAnimationState state, CStateManager& mgr, float angle, bool bigStrike) {
......@@ -52,9 +52,9 @@ bool CGunMotion::PlayPasAnim(SamusGun::EAnimationState state, CStateManager& mgr
}
if (animId != -1) {
x0_modelData.AnimationData()->EnableLooping(loop);
x0_modelData.GetAnimationData()->EnableLooping(loop);
CAnimPlaybackParms aparms(animId, -1, 1.f, true);
x0_modelData.AnimationData()->SetAnimation(aparms, false);
x0_modelData.GetAnimationData()->SetAnimation(aparms, false);
}
return loop;
......@@ -65,9 +65,9 @@ void CGunMotion::ReturnToDefault(CStateManager& mgr, bool setState) {
}
void CGunMotion::BasePosition(bool bigStrikeReset) {
x0_modelData.AnimationData()->EnableLooping(false);
x0_modelData.GetAnimationData()->EnableLooping(false);
CAnimPlaybackParms aparms(bigStrikeReset ? 6 : 0, -1, 1.f, true);
x0_modelData.AnimationData()->SetAnimation(aparms, false);
x0_modelData.GetAnimationData()->SetAnimation(aparms, false);
}
void CGunMotion::EnterFidget(CStateManager& mgr, SamusGun::EFidgetType type, s32 parm2) {
......
......@@ -104,7 +104,7 @@ void CGunWeapon::Reset(CStateManager& mgr) {
if (!x218_26_loaded)
return;
x10_solidModelData->AnimationData()->EnableLooping(false);
x10_solidModelData->GetAnimationData()->EnableLooping(false);
if (x218_25_enableCharge)
x218_25_enableCharge = false;
else
......@@ -116,9 +116,9 @@ static const s32 skAnimTypeList[] = {0, 4, 1, 2, 3, 5, 6, 7, 8, 9, 10};
void CGunWeapon::PlayAnim(NWeaponTypes::EGunAnimType type, bool loop) {
if (x218_26_loaded && type >= NWeaponTypes::EGunAnimType::BasePosition &&
type <= NWeaponTypes::EGunAnimType::ToBeam) {
x10_solidModelData->AnimationData()->EnableLooping(loop);
x10_solidModelData->GetAnimationData()->EnableLooping(loop);
CAnimPlaybackParms parms(skAnimTypeList[int(type)], -1, 1.f, true);
x10_solidModelData->AnimationData()->SetAnimation(parms, false);
x10_solidModelData->GetAnimationData()->SetAnimation(parms, false);
}
}
......@@ -173,9 +173,9 @@ void CGunWeapon::Fire(bool underwater, float dt, EChargeState chargeState, const
mgr.GetCameraManager()->AddCameraShaker(CCameraShakeData::skChargedShotCameraShakeData, false);
}
x10_solidModelData->AnimationData()->EnableLooping(false);
x10_solidModelData->GetAnimationData()->EnableLooping(false);
CAnimPlaybackParms parms(skShootAnim[int(chargeState)], -1, 1.f, true);
x10_solidModelData->AnimationData()->SetAnimation(parms, false);
x10_solidModelData->GetAnimationData()->SetAnimation(parms, false);
}
void CGunWeapon::EnableFx(bool enable) {
......@@ -304,7 +304,7 @@ void CGunWeapon::LoadGunModels(CStateManager& mgr) {
x10_solidModelData.emplace(CAnimRes(x214_ancsId, 0, x4_scale, defaultAnim, false));
x60_holoModelData.emplace(CAnimRes(x214_ancsId, 1, x4_scale, defaultAnim, false));
CAnimPlaybackParms parms(defaultAnim, -1, 1.f, true);
x10_solidModelData->AnimationData()->SetAnimation(parms, true);
x10_solidModelData->GetAnimationData()->SetAnimation(parms, true);
LoadSuitArm(mgr);
x10_solidModelData->SetSortThermal(true);
x60_holoModelData->SetSortThermal(true);
......@@ -478,7 +478,7 @@ void CGunWeapon::DrawHologram(const CStateManager& mgr, const zeus::CTransform&
// g_Renderer->SetAmbientColor(zeus::skWhite);
CSkinnedModel& model = const_cast<CSkinnedModel&>(*x60_holoModelData->GetAnimationData()->GetModelData());
model.GetModelInst()->ActivateLights({CLight::BuildLocalAmbient({}, zeus::skWhite)});
const_cast<CGunWeapon*>(this)->x10_solidModelData->AnimationData()->Render(model, flags, {}, nullptr);
const_cast<CGunWeapon*>(this)->x10_solidModelData->GetAnimationData()->Render(model, flags, {}, nullptr);
// g_Renderer->SetAmbientColor(zeus::skWhite);
// CGraphics::DisableAllLights();
}
......
......@@ -28,7 +28,7 @@ CPhazonBeam::CPhazonBeam(CAssetId characterId, EWeaponType type, TUniqueId playe
void CPhazonBeam::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager& mgr) {
TAreaId aid = mgr.GetPlayer().GetAreaIdAlways();
if (msg == EScriptObjectMessage::Deleted && aid != kInvalidAreaId)
mgr.WorldNC()->GetArea(aid)->SetWeaponWorldLighting(4.f, 1.f);
mgr.GetWorld()->GetArea(aid)->SetWeaponWorldLighting(4.f, 1.f);
}
void CPhazonBeam::StopBeam(CStateManager& mgr, bool b1) {
......@@ -102,7 +102,7 @@ void CPhazonBeam::Update(float dt, CStateManager& mgr) {
x278_fireTime += dt;
TAreaId aid = mgr.GetPlayer().GetAreaIdAlways();
if (aid != kInvalidAreaId) {
CGameArea* area = mgr.WorldNC()->GetArea(aid);
CGameArea* area = mgr.GetWorld()->GetArea(aid);
if (x278_fireTime > 1.f / 6.f)
area->SetWeaponWorldLighting(4.f, 1.f);
else
......
......@@ -21,7 +21,7 @@ void CPlasmaBeam::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CS
void CPlasmaBeam::SetWorldLighting(CStateManager& mgr, TAreaId aid, float speed, float target) {
if (x22c_25_worldLighingDim && x23c_stateArea != aid && x23c_stateArea != kInvalidAreaId) {
CGameArea* area = mgr.WorldNC()->GetArea(x23c_stateArea);
CGameArea* area = mgr.GetWorld()->GetArea(x23c_stateArea);
if (area->IsPostConstructed())
area->SetWeaponWorldLighting(2.f, 1.f);
}
......@@ -30,7 +30,7 @@ void CPlasmaBeam::SetWorldLighting(CStateManager& mgr, TAreaId aid, float speed,
x22c_25_worldLighingDim = target != 1.f;
if (x23c_stateArea != kInvalidAreaId) {
CGameArea* area = mgr.WorldNC()->GetArea(x23c_stateArea);
CGameArea* area = mgr.GetWorld()->GetArea(x23c_stateArea);
if (area->IsPostConstructed())
area->SetWeaponWorldLighting(speed, target);
}
......
......@@ -216,7 +216,7 @@ void CPlayerGun::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CSt
x72c_currentBeam->SetRainSplashGenerator(x748_rainSplashGenerator.get());
x744_auxWeapon->Load(x310_currentBeam, mgr);
CAnimPlaybackParms parms(skBeamAnimIds[int(mgr.GetPlayerState()->GetCurrentBeam())], -1, 1.f, true);
x6e0_rightHandModel.AnimationData()->SetAnimation(parms, false);
x6e0_rightHandModel.GetAnimationData()->SetAnimation(parms, false);
break;
}
case EScriptObjectMessage::Deleted:
......@@ -489,7 +489,7 @@ void CPlayerGun::ResetBeamParams(CStateManager& mgr, const CPlayerState& playerS
if (playerState.ItemEnabled(CPlayerState::EItemType::ChargeBeam))
ResetCharge(mgr, false);
CAnimPlaybackParms parms(skBeamAnimIds[int(x314_nextBeam)], -1, 1.f, true);
x6e0_rightHandModel.AnimationData()->SetAnimation(parms, false);
x6e0_rightHandModel.GetAnimationData()->SetAnimation(parms, false);
Reset(mgr, false);
if (playSelectionSfx)
CSfxManager::SfxStart(SFXwpn_morph_out_wipe, 1.f, 0.f, true, 0x7f, false, kInvalidAreaId);
......@@ -2018,7 +2018,7 @@ void CPlayerGun::PreRender(const CStateManager& mgr, const zeus::CFrustum& frust
x740_grappleArm->PreRender(mgr, frustum, camPos);
if (x678_morph.GetGunState() != CGunMorph::EGunState::OutWipeDone || activeVisor == CPlayerState::EPlayerVisor::XRay)
x6e0_rightHandModel.AnimationData()->PreRender();
x6e0_rightHandModel.GetAnimationData()->PreRender();
if (x833_28_phazonBeamActive)
g_Renderer->AllocatePhazonSuitMaskTexture();
......
......@@ -76,8 +76,8 @@ void CWaveBeam::Fire(bool underwater, float dt, EChargeState chargeState, const
NWeaponTypes::play_sfx(kSoundId[int(chargeState)], underwater, false, 0.165f);
CAnimPlaybackParms parms(skShootAnim[int(chargeState)], -1, 1.f, true);
x10_solidModelData->AnimationData()->EnableLooping(false);
x10_solidModelData->AnimationData()->SetAnimation(parms, false);
x10_solidModelData->GetAnimationData()->EnableLooping(false);
x10_solidModelData->GetAnimationData()->SetAnimation(parms, false);
}
void CWaveBeam::EnableSecondaryFx(ESecondaryFxType type) {
......
......@@ -80,7 +80,7 @@ void CActor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateMana
{
RemoveEmitter();
if (HasModelData() && !x64_modelData->IsNull())
if (CAnimData* aData = x64_modelData->AnimationData())
if (CAnimData* aData = x64_modelData->GetAnimationData())
aData->GetParticleDB().DeleteAllLights(mgr);
break;
}
......@@ -91,9 +91,9 @@ void CActor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateMana
else
RemoveMaterial(EMaterialTypes::Scannable, mgr);
if (HasModelData() && x64_modelData->AnimationData()) {
if (HasModelData() && x64_modelData->GetAnimationData()) {
TAreaId aid = GetAreaId();
x64_modelData->AnimationData()->InitializeEffects(mgr, aid, x64_modelData->GetScale());
x64_modelData->GetAnimationData()->InitializeEffects(mgr, aid, x64_modelData->GetScale());
}
break;
}
......@@ -161,7 +161,7 @@ void CActor::PreRender(CStateManager& mgr, const zeus::CFrustum& planes) {
}
if (x64_modelData->HasAnimData())
x64_modelData->AnimationData()->PreRender();
x64_modelData->GetAnimationData()->PreRender();
} else {
if (xe4_29_actorLightsDirty) {
xe4_29_actorLightsDirty = false;
......@@ -254,7 +254,7 @@ void CActor::Render(const CStateManager& mgr) const {
if (x64_modelData && !x64_modelData->IsNull()) {
bool renderPrePostParticles = xe6_29_renderParticleDBInside && x64_modelData && x64_modelData->HasAnimData();
if (renderPrePostParticles)
x64_modelData->AnimationData()->GetParticleDB().RenderSystemsToBeDrawnFirst();
x64_modelData->GetAnimationData()->GetParticleDB().RenderSystemsToBeDrawnFirst();
if (xe7_27_enableRender) {
if (xe5_31_pointGeneratorParticles)
......@@ -274,7 +274,7 @@ void CActor::Render(const CStateManager& mgr) const {
}
if (renderPrePostParticles)
x64_modelData->AnimationData()->GetParticleDB().RenderSystemsToBeDrawnLast();
x64_modelData->GetAnimationData()->GetParticleDB().RenderSystemsToBeDrawnLast();
}
DrawTouchBounds();
}
......@@ -289,7 +289,7 @@ bool CActor::CanRenderUnsorted(const CStateManager& mgr) const {
}
void CActor::CalculateRenderBounds() {
if (x64_modelData && (x64_modelData->AnimationData() || x64_modelData->GetNormalModel()))
if (x64_modelData && (x64_modelData->GetAnimationData() || x64_modelData->GetNormalModel()))
x9c_renderBounds = x64_modelData->GetBounds(x34_transform);
else
x9c_renderBounds = zeus::CAABox(x34_transform.origin, x34_transform.origin);
......@@ -636,7 +636,7 @@ SAdvancementDeltas CActor::UpdateAnimation(float dt, CStateManager& mgr, bool ad
if (poi.GetCharacterIndex() != -1 &&
x64_modelData->GetAnimationData()->GetCharacterIndex() != poi.GetCharacterIndex())
continue;
x64_modelData->AnimationData()->GetParticleDB().SetParticleEffectState(poi.GetString(), true, mgr);
x64_modelData->GetAnimationData()->GetParticleDB().SetParticleEffectState(poi.GetString(), true, mgr);
}
}
return deltas;
......
......@@ -166,7 +166,7 @@ public:
float GetPitch() const;
float GetYaw() const;
const CModelData* GetModelData() const { return x64_modelData.get(); }
CModelData* ModelData() { return x64_modelData.get(); }
CModelData* GetModelData() { return x64_modelData.get(); }
void EnsureRendered(const CStateManager&) const;
void EnsureRendered(const CStateManager&, const zeus::CVector3f&, const zeus::CAABox&) const;
void ProcessSoundEvent(u32 sfxId, float weight, u32 flags, float falloff, float maxDist, float minVol, float maxVol,
......@@ -175,7 +175,7 @@ public:
SAdvancementDeltas UpdateAnimation(float, CStateManager&, bool);
void SetActorLights(std::unique_ptr<CActorLights>&& lights);
const CActorLights* GetActorLights() const { return x90_actorLights.get(); }
CActorLights* ActorLights() { return x90_actorLights.get(); }
CActorLights* GetActorLights() { return x90_actorLights.get(); }
bool CanDrawStatic() const;
bool IsDrawEnabled() const { return xe7_29_drawEnabled; }
void SetWorldLightingDirty(bool b) { xe7_28_worldLightingDirty = b; }
......
......@@ -309,8 +309,8 @@ bool CActorModelParticles::CItem::UpdateIcePop(float dt, CActor* actor, CStateMa
bool CActorModelParticles::CItem::Update(float dt, CStateManager& mgr) {
CActor* act = static_cast<CActor*>(mgr.ObjectById(x0_id));
if (act && act->HasModelData() && !act->ModelData()->IsNull()) {
xec_particleOffsetScale = act->ModelData()->GetScale();
if (act && act->HasModelData() && !act->GetModelData()->IsNull()) {
xec_particleOffsetScale = act->GetModelData()->GetScale();
xf8_iceXf = act->GetTransform();
x4_areaId = act->GetAreaIdAlways();
} else {
......
......@@ -18,7 +18,7 @@ CAmbientAI::CAmbientAI(TUniqueId uid, std::string_view name, const CEntityInfo&
, x2dc_defaultAnim(GetModelData()->GetAnimationData()->GetDefaultAnimation())
, x2e0_alertAnim(alertAnim)
, x2e4_impactAnim(impactAnim) {
ModelData()->AnimationData()->EnableLooping(true);
GetModelData()->GetAnimationData()->EnableLooping(true);
}
void CAmbientAI::Accept(IVisitor& visitor) { visitor.Visit(this); }
......@@ -51,8 +51,8 @@ void CAmbientAI::Think(float dt, CStateManager& mgr) {
case EAnimationState::Ready: {
if (inAlertRange) {
x2d0_animState = EAnimationState::Alert;
ModelData()->AnimationData()->SetAnimation(CAnimPlaybackParms(x2e0_alertAnim, -1, 1.f, true), false);
ModelData()->EnableLooping(true);
GetModelData()->GetAnimationData()->SetAnimation(CAnimPlaybackParms(x2e0_alertAnim, -1, 1.f, true), false);
GetModelData()->EnableLooping(true);
RandomizePlaybackRate(mgr);
}
break;
......@@ -60,8 +60,8 @@ void CAmbientAI::Think(float dt, CStateManager& mgr) {
case EAnimationState::Alert: {
if (!inAlertRange) {
x2d0_animState = EAnimationState::Ready;
ModelData()->AnimationData()->SetAnimation(CAnimPlaybackParms(x2dc_defaultAnim, -1, 1.f, true), false);
ModelData()->EnableLooping(true);
GetModelData()->GetAnimationData()->SetAnimation(CAnimPlaybackParms(x2dc_defaultAnim, -1, 1.f, true), false);
GetModelData()->EnableLooping(true);
RandomizePlaybackRate(mgr);
} else if (inImpactRange) {
SendScriptMsgs(EScriptObjectState::Dead, mgr, EScriptObjectMessage::None);
......@@ -72,8 +72,8 @@ void CAmbientAI::Think(float dt, CStateManager& mgr) {
case EAnimationState::Impact: {
if (!x2e8_25_animating) {
x2d0_animState = EAnimationState::Ready;
ModelData()->AnimationData()->SetAnimation(CAnimPlaybackParms(x2dc_defaultAnim, -1, 1.f, true), false);
ModelData()->EnableLooping(true);
GetModelData()->GetAnimationData()->SetAnimation(CAnimPlaybackParms(x2dc_defaultAnim, -1, 1.f, true), false);
GetModelData()->EnableLooping(true);
RandomizePlaybackRate(mgr);
}
break;
......@@ -97,8 +97,8 @@ void CAmbientAI::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CState
if (!GetActive())
SetActive(true);
x2d0_animState = EAnimationState::Ready;
ModelData()->AnimationData()->SetAnimation(CAnimPlaybackParms(x2dc_defaultAnim, -1, 1.f, true), false);
ModelData()->AnimationData()->EnableLooping(true);
GetModelData()->GetAnimationData()->SetAnimation(CAnimPlaybackParms(x2dc_defaultAnim, -1, 1.f, true), false);
GetModelData()->GetAnimationData()->EnableLooping(true);
RandomizePlaybackRate(mgr);
x2e8_24_dead = false;
x260_healthInfo = x258_initialHealthInfo;
......@@ -107,8 +107,8 @@ void CAmbientAI::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CState
case EScriptObjectMessage::Damage: {
if (GetActive()) {
x2d0_animState = EAnimationState::Impact;
ModelData()->AnimationData()->SetAnimation(CAnimPlaybackParms(x2e4_impactAnim, -1, 1.f, true), false);
ModelData()->AnimationData()->EnableLooping(false);
GetModelData()->GetAnimationData()->SetAnimation(CAnimPlaybackParms(x2e4_impactAnim, -1, 1.f, true), false);
GetModelData()->GetAnimationData()->EnableLooping(false);
RandomizePlaybackRate(mgr);
}
break;
......@@ -129,7 +129,7 @@ std::optional<zeus::CAABox> CAmbientAI::GetTouchBounds() const {
}
void CAmbientAI::RandomizePlaybackRate(CStateManager& mgr) {
ModelData()->AnimationData()->MultiplyPlaybackRate(0.4f * mgr.GetActiveRandom()->Float() + 0.8f);
GetModelData()->GetAnimationData()->MultiplyPlaybackRate(0.4f * mgr.GetActiveRandom()->Float() + 0.8f);
}
} // namespace urde
......@@ -433,7 +433,7 @@ void CFishCloud::Think(float dt, CStateManager& mgr) {
}
if (x250_27_validModel) {
for (auto& m : x1b0_models) {
m->AnimationData()->SetPlaybackRate(1.f);
m->GetAnimationData()->SetPlaybackRate(1.f);
m->AdvanceAnimation(dt, mgr, x4_areaId, true);
}
}
......@@ -449,7 +449,7 @@ void CFishCloud::AllocateSkinnedModels(CStateManager& mgr, CModelData::EWhichMod
for (auto& m : x1b0_models) {
m->EnableLooping(true);
m->AdvanceAnimation(
m->AnimationData()->GetAnimTimeRemaining("Whole Body"sv) * 0.25f * idx, mgr, x4_areaId, true);
m->GetAnimationData()->GetAnimTimeRemaining("Whole Body"sv) * 0.25f * idx, mgr, x4_areaId, true);
++idx;
}
x230_whichModel = which;
......@@ -487,7 +487,7 @@ void CFishCloud::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) {
CActor::PreRender(mgr, frustum);
if (x250_27_validModel) {
for (auto& m : x1b0_models) {
m->AnimationData()->PreRender();
m->GetAnimationData()->PreRender();
}
}
xe4_30_outOfFrustum = false;
......@@ -508,7 +508,7 @@ void CFishCloud::RenderBoid(int idx, const CBoid& boid, u32& drawMask,
u32 thisDrawMask = 1u << modelIndex;
if (drawMask & thisDrawMask) {
drawMask &= ~thisDrawMask;
mData.AnimationData()->BuildPose();
mData.GetAnimationData()->BuildPose();
}
model.GetModelInst()->SetAmbientColor(zeus::skWhite);
CGraphics::SetModelMatrix(zeus::lookAt(boid.x0_pos, boid.x0_pos + boid.xc_vel));
......@@ -516,7 +516,7 @@ void CFishCloud::RenderBoid(int idx, const CBoid& boid, u32& drawMask,
CModelFlags thermFlags(0, 0, 3, zeus::skWhite);
mData.RenderThermal(zeus::skWhite, zeus::CColor(0.f, 0.25f), thermFlags);
} else {
mData.AnimationData()->Render(model, flags, {}, nullptr);
mData.GetAnimationData()->Render(model, flags, {}, nullptr);
}
}
......
......@@ -860,7 +860,7 @@ void CGameArea::Validate(CStateManager& mgr) {
PostConstructArea();
if (x4_selfIdx != kInvalidAreaId)
mgr.WorldNC()->MoveAreaToAliveChain(x4_selfIdx);
mgr.GetWorld()->MoveAreaToAliveChain(x4_selfIdx);
LoadScriptObjects(mgr);
......@@ -882,7 +882,7 @@ void CGameArea::Validate(CStateManager& mgr) {
}
void CGameArea::LoadScriptObjects(CStateManager& mgr) {
CWorldLayerState& layerState = *mgr.LayerState();
CWorldLayerState& layerState = *mgr.WorldLayerState();
u32 layerCount = layerState.GetAreaLayerCount(x4_selfIdx);
std::vector<TEditorId> objIds;
for (u32 i = 0; i < layerCount; ++i) {
......@@ -1113,7 +1113,7 @@ void CGameArea::VerifyTokenList(CStateManager& stateMgr) {
auto end = xac_deps2.end();
for (int lidx = int(xbc_layerDepOffsets.size() - 1); lidx >= 0; --lidx) {
auto begin = xac_deps2.begin() + xbc_layerDepOffsets[lidx];
if (stateMgr.LayerState()->IsLayerActive(x4_selfIdx, lidx)) {
if (stateMgr.WorldLayerState()->IsLayerActive(x4_selfIdx, lidx)) {
for (auto it = begin; it != end; ++it) {
xdc_tokens.push_back(g_SimplePool->GetObj(*it));
xdc_tokens.back().Lock();
......
......@@ -288,7 +288,7 @@ public:
CAssetId GetAreaAssetId() const { return x84_mrea; }
const CAreaFog* GetAreaFog() const { return GetPostConstructed()->x10c4_areaFog.get(); }
CAreaFog* AreaFog() { return const_cast<CAreaFog*>(GetAreaFog()); }
CAreaFog* GetAreaFog() { return const_cast<CAreaFog*>(GetAreaFog()); }
float GetXRayFogDistance() const;
EEnvFxType DoesAreaNeedEnvFx() const;
bool DoesAreaNeedSkyNow() const;
......@@ -338,8 +338,8 @@ public:
const std::vector<Dock>& GetDocks() const { return xcc_docks; }
const Dock* GetDock(s32 dock) const { return &xcc_docks[dock]; }
Dock* GetDock(s32 dock) { return &xcc_docks[dock]; }
s32 GetDockCount() const { return xcc_docks.size(); }
Dock* DockNC(s32 dock) { return &xcc_docks[dock]; }
bool IsPostConstructed() const { return xf0_24_postConstructed; }
const CPostConstructed* GetPostConstructed() const {
......
......@@ -396,7 +396,7 @@ bool CKnockBackController::TickDeferredTimer(float dt) {
}
EKnockBackCharacterState CKnockBackController::GetKnockBackCharacterState(CPatterned& parent) {
if (parent.BodyController()->IsFrozen())
if (parent.GetBodyController()->IsFrozen())
return parent.IsAlive() ? EKnockBackCharacterState::FrozenAlive : EKnockBackCharacterState::FrozenDead;
return parent.IsAlive() ? EKnockBackCharacterState::Alive : EKnockBackCharacterState::Dead;
}
......@@ -409,23 +409,23 @@ void CKnockBackController::ValidateState(CPatterned& parent) {
EKnockBackAnimationState useState = EKnockBackAnimationState::Invalid;
if (parent.IsAlive()) {
if (parent.BodyController()->HasBodyState(pas::EAnimationState::Hurled) && x80_availableStates.test(3) &&
if (parent.GetBodyController()->HasBodyState(pas::EAnimationState::Hurled) && x80_availableStates.test(3) &&
x4_activeParms.x0_animState >= EKnockBackAnimationState::Hurled) {
useState = EKnockBackAnimationState::Hurled;
} else if (parent.BodyController()->HasBodyState(pas::EAnimationState::KnockBack) && x80_availableStates.test(2) &&
} else if (parent.GetBodyController()->HasBodyState(pas::EAnimationState::KnockBack) && x80_availableStates.test(2) &&
x4_activeParms.x0_animState >= EKnockBackAnimationState::KnockBack) {
useState = EKnockBackAnimationState::KnockBack;
} else if (parent.BodyController()->HasBodyState(pas::EAnimationState::AdditiveFlinch) &&
} else if (parent.GetBodyController()->HasBodyState(pas::EAnimationState::AdditiveFlinch) &&
x80_availableStates.test(1) && x4_activeParms.x0_animState >= EKnockBackAnimationState::Flinch) {
useState = EKnockBackAnimationState::Flinch;
}
} else {
if (parent.BodyController()->HasBodyState(pas::EAnimationState::Fall) && x80_availableStates.test(4) &&
if (parent.GetBodyController()->HasBodyState(pas::EAnimationState::Fall) && x80_availableStates.test(4) &&
(x4_activeParms.x0_animState >= EKnockBackAnimationState::Fall ||
(!parent.BodyController()->HasBodyState(pas::EAnimationState::Hurled) &&
(!parent.GetBodyController()->HasBodyState(pas::EAnimationState::Hurled) &&
x4_activeParms.x0_animState >= EKnockBackAnimationState::Hurled))) {
useState = EKnockBackAnimationState::Fall;
} else if (parent.BodyController()->HasBodyState(pas::EAnimationState::Hurled) && x80_availableStates.test(3) &&
} else if (parent.GetBodyController()->HasBodyState(pas::EAnimationState::Hurled) && x80_availableStates.test(3) &&
x4_activeParms.x0_animState >= EKnockBackAnimationState::Hurled) {
useState = EKnockBackAnimationState::Hurled;
}
......@@ -483,26 +483,26 @@ void CKnockBackController::DoKnockBackAnimation(const zeus::CVector3f& backVec,
hurlVel = std::sqrt(parent.GetGravityConstant() * 0.5f * hurlVel);
zeus::CVector3f backUpVec = backVec + backVec.magnitude() * zeus::skUp;
if (backUpVec.canBeNormalized()) {
parent.BodyController()->GetCommandMgr().DeliverCmd(CBCHurledCmd(-backVec, backUpVec.normalized() * hurlVel));
parent.GetBodyController()->GetCommandMgr().DeliverCmd(CBCHurledCmd(-backVec, backUpVec.normalized() * hurlVel));
parent.SetMomentumWR({0.f, 0.f, parent.GetGravityConstant() * -parent.GetMass()});
}
break;
}
case EKnockBackAnimationState::Fall: {
parent.BodyController()->GetCommandMgr().DeliverCmd(CBCKnockDownCmd(-backVec, x7c_severity));
parent.GetBodyController()->GetCommandMgr().DeliverCmd(CBCKnockDownCmd(-backVec, x7c_severity));
break;
}
case EKnockBackAnimationState::KnockBack: {
parent.BodyController()->GetCommandMgr().DeliverCmd(CBCKnockBackCmd(-backVec, x7c_severity));
parent.GetBodyController()->GetCommandMgr().DeliverCmd(CBCKnockBackCmd(-backVec, x7c_severity));
break;
}
case EKnockBackAnimationState::Flinch: {
std::pair<float, s32> bestAnim =
parent.BodyController()->GetPASDatabase().FindBestAnimation(CPASAnimParmData(23), *mgr.GetActiveRandom(), -1);
parent.GetBodyController()->GetPASDatabase().FindBestAnimation(CPASAnimParmData(23), *mgr.GetActiveRandom(), -1);
if (bestAnim.first > 0.f) {
parent.ModelData()->AnimationData()->AddAdditiveAnimation(bestAnim.second, 1.f, false, true);
parent.GetModelData()->GetAnimationData()->AddAdditiveAnimation(bestAnim.second, 1.f, false, true);
x64_flinchRemTime =
std::max(parent.ModelData()->AnimationData()->GetAnimationDuration(bestAnim.second), x64_flinchRemTime);
std::max(parent.GetModelData()->GetAnimationData()->GetAnimationDuration(bestAnim.second), x64_flinchRemTime);
}
break;
}
......@@ -562,8 +562,8 @@ void CKnockBackController::Update(float dt, CStateManager& mgr, CPatterned& pare
x64_flinchRemTime -= dt;
if (TickDeferredTimer(dt))
DoDeferredKnockBack(mgr, parent);
if (x82_26_locomotionDuringElectrocution && parent.BodyController()->IsElectrocuting())
parent.BodyController()->GetCommandMgr().DeliverCmd(CBodyStateCmd(EBodyStateCmd::Locomotion));
if (x82_26_locomotionDuringElectrocution && parent.GetBodyController()->IsElectrocuting())
parent.GetBodyController()->GetCommandMgr().DeliverCmd(CBodyStateCmd(EBodyStateCmd::Locomotion));
}
EKnockBackWeaponType CKnockBackController::GetKnockBackWeaponType(const CDamageInfo& info, EWeaponType wType,
......
......@@ -985,7 +985,7 @@ void CMorphBall::EnterMorphBallState(CStateManager& mgr) {
UpdateEffects(0.f, mgr);
x187c_spiderBallState = ESpiderBallState::Inactive;
CAnimPlaybackParms parms(0, -1, 1.f, true);
x58_ballModel->AnimationData()->SetAnimation(parms, false);
x58_ballModel->GetAnimationData()->SetAnimation(parms, false);
x1e20_ballAnimIdx = 0;
StopEffects();
x1c30_boostOverLightFactor = 0.f;