2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 02:27:40 -04:00

Keep dynamics asleep during init process

When we set the global pose and transform, we wake up dynamics. This can be
somewhat evil, so we put them back to sleep as they are supposed to be.
This commit is contained in:
2012-02-22 00:45:18 -05:00
parent ec216206dd
commit 027e830360

View File

@ -1220,8 +1220,9 @@ void plPXPhysical::GetSyncState(hsPoint3& pos, hsQuat& rot, hsVector3& linV, hsV
void plPXPhysical::SetSyncState(hsPoint3* pos, hsQuat* rot, hsVector3* linV, hsVector3* angV) void plPXPhysical::SetSyncState(hsPoint3* pos, hsQuat* rot, hsVector3* linV, hsVector3* angV)
{ {
bool initialSync = plNetClientApp::GetInstance()->IsLoadingInitialAgeState() && bool isLoading = plNetClientApp::GetInstance()->IsLoadingInitialAgeState();
plNetClientApp::GetInstance()->GetJoinOrder() == 0; bool isFirstIn = plNetClientApp::GetInstance()->GetJoinOrder() == 0;
bool initialSync = isLoading && isFirstIn;
// If the physical has fallen out of the sim, and this is initial age state, and we're // If the physical has fallen out of the sim, and this is initial age state, and we're
// the first person in, reset it to the original position. (ie, prop the default state // the first person in, reset it to the original position. (ie, prop the default state
@ -1243,6 +1244,11 @@ void plPXPhysical::SetSyncState(hsPoint3* pos, hsQuat* rot, hsVector3* linV, hsV
if (angV) if (angV)
SetAngularVelocitySim(*angV); SetAngularVelocitySim(*angV);
// If we're loading the age, then we should ensure the objects
// stay asleep if they're supposed to be asleep.
if (isLoading && GetProperty(plSimulationInterface::kStartInactive) && !fActor->readBodyFlag(NX_BF_KINEMATIC))
fActor->putToSleep();
SendNewLocation(false, true); SendNewLocation(false, true);
} }