Browse Source

Merge pull request #159 from Hoikas/physx

More PhysX
Branan Purvine-Riley 13 years ago
parent
commit
6c94a90d9c
  1. 10
      Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp
  2. 2
      Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp

10
Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp

@ -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)
{
bool initialSync = plNetClientApp::GetInstance()->IsLoadingInitialAgeState() &&
plNetClientApp::GetInstance()->GetJoinOrder() == 0;
bool isLoading = plNetClientApp::GetInstance()->IsLoadingInitialAgeState();
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
// 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)
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);
}

2
Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp

@ -276,12 +276,14 @@ void plCameraRegionDetector::ISendSavedTriggerMsgs()
if (fSavedMsgEnterFlag)
{
fMessages[i]->SetCmd(plCameraMsg::kEntering);
fMessages[i]->ClearCmd(plCameraMsg::kPop);
DetectorLog("Entering cameraRegion: %s - Evals=%d -msg %d of %d\n", GetKeyName().c_str(),fNumEvals,i+1,fMessages.size());
fIsInside = true;
}
else
{
fMessages[i]->ClearCmd(plCameraMsg::kEntering);
fMessages[i]->SetCmd(plCameraMsg::kPop); // for spawnpoints with a camera stack
DetectorLog("Exiting cameraRegion: %s - Evals=%d -msg %d of %d\n", GetKeyName().c_str(),fNumEvals,i+1,fMessages.size());
fIsInside = false;
}

Loading…
Cancel
Save