mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 11:19:10 +00:00
Merge pull request #419 from Hoikas/physx_sleep
Fix long-standing physical sleep issue.
This commit is contained in:
@ -1059,10 +1059,13 @@ 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
|
// If we're loading the age, then we should ensure the objects stay asleep if they're supposed to be asleep.
|
||||||
// stay asleep if they're supposed to be asleep.
|
// NOTE: We should only do this if the objects are not at their initial locations. Otherwise, they might
|
||||||
if (isLoading && GetProperty(plSimulationInterface::kStartInactive) && !fActor->readBodyFlag(NX_BF_KINEMATIC))
|
// sleep inside each other and explode or float randomly in midair
|
||||||
fActor->putToSleep();
|
if (isLoading && GetProperty(plSimulationInterface::kStartInactive) && !fActor->readBodyFlag(NX_BF_KINEMATIC)) {
|
||||||
|
if (!pos && !rot)
|
||||||
|
fActor->putToSleep();
|
||||||
|
}
|
||||||
|
|
||||||
SendNewLocation(false, true);
|
SendNewLocation(false, true);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user