mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
Merge pull request #142 from Hoikas/physx
Really fix those bizarre panic links, and a memory leak, and those f*****g gira baskets
This commit is contained in:
@ -827,7 +827,12 @@ void plPXPhysical::ApplyHitForce()
|
|||||||
void plPXPhysical::ISetTransformGlobal(const hsMatrix44& l2w)
|
void plPXPhysical::ISetTransformGlobal(const hsMatrix44& l2w)
|
||||||
{
|
{
|
||||||
hsAssert(fActor->isDynamic(), "Shouldn't move a static actor");
|
hsAssert(fActor->isDynamic(), "Shouldn't move a static actor");
|
||||||
fActor->wakeUp();
|
|
||||||
|
// If we wake up normal dynamic actors, they might explode.
|
||||||
|
// However, kinematics won't update if they are asleep. Thankfully, kinematics don't
|
||||||
|
// explode, move, or cause spontaneous nuclear warfare.
|
||||||
|
if (fActor->readBodyFlag(NX_BF_KINEMATIC))
|
||||||
|
fActor->wakeUp();
|
||||||
|
|
||||||
NxMat34 mat;
|
NxMat34 mat;
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|||||||
#include "pnSceneObject/plCoordinateInterface.h"
|
#include "pnSceneObject/plCoordinateInterface.h"
|
||||||
#include "pnNetCommon/plSDLTypes.h"
|
#include "pnNetCommon/plSDLTypes.h"
|
||||||
#include "plMessage/plCollideMsg.h"
|
#include "plMessage/plCollideMsg.h"
|
||||||
|
#include "plMessage/plAgeLoadedMsg.h"
|
||||||
|
|
||||||
#include "plModifier/plDetectorLog.h"
|
#include "plModifier/plDetectorLog.h"
|
||||||
|
|
||||||
@ -357,7 +358,7 @@ void plSimulationMgr::Init()
|
|||||||
if (gTheInstance->InitSimulation())
|
if (gTheInstance->InitSimulation())
|
||||||
{
|
{
|
||||||
gTheInstance->RegisterAs(kSimulationMgr_KEY);
|
gTheInstance->RegisterAs(kSimulationMgr_KEY);
|
||||||
gTheInstance->GetKey()->RefObject();
|
plgDispatch::Dispatch()->RegisterForExactType(plAgeLoadedMsg::Index(), gTheInstance->GetKey());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -374,10 +375,8 @@ void plSimulationMgr::Shutdown()
|
|||||||
hsAssert(gTheInstance, "Simulation manager missing during shutdown.");
|
hsAssert(gTheInstance, "Simulation manager missing during shutdown.");
|
||||||
if (gTheInstance)
|
if (gTheInstance)
|
||||||
{
|
{
|
||||||
// UnRef to match our Ref in Init(). Unless something strange is
|
plgDispatch::Dispatch()->UnRegisterForExactType(plAgeLoadedMsg::Index(), gTheInstance->GetKey());
|
||||||
// going on, this should destroy the instance and set gTheInstance to nil.
|
gTheInstance->UnRegisterAs(kSimulationMgr_KEY); // this will destroy the instance
|
||||||
// gTheInstance->GetKey()->UnRefObject();
|
|
||||||
gTheInstance->UnRegister(); // this will destroy the instance
|
|
||||||
gTheInstance = nil;
|
gTheInstance = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -756,6 +755,13 @@ void plSimulationMgr::ISendUpdates()
|
|||||||
|
|
||||||
hsBool plSimulationMgr::MsgReceive(plMessage *msg)
|
hsBool plSimulationMgr::MsgReceive(plMessage *msg)
|
||||||
{
|
{
|
||||||
|
// Suspend/resume the simulation based on whether or not we're in an age...
|
||||||
|
if (plAgeLoadedMsg* aMsg = plAgeLoadedMsg::ConvertNoRef(msg))
|
||||||
|
{
|
||||||
|
fSuspended = !aMsg->fLoaded;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return hsKeyedObject::MsgReceive(msg);
|
return hsKeyedObject::MsgReceive(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user