|
@@ -53,7 +53,8 @@ void PxPlayer::_releaseController()
|
|
|
if ( mController )
|
|
|
{
|
|
|
mController->getActor()->userData = NULL;
|
|
|
- mWorld->releaseController( *mController );
|
|
|
+ mWorld->getStaticChangedSignal().remove( this, &PxPlayer::_onStaticChanged );
|
|
|
+ mWorld->releaseController( *mController );
|
|
|
mController = NULL;
|
|
|
}
|
|
|
}
|
|
@@ -99,6 +100,8 @@ void PxPlayer::init( const char *type,
|
|
|
//mOriginOffset = 1.0f;
|
|
|
}
|
|
|
|
|
|
+ mWorld->getStaticChangedSignal().notify( this, &PxPlayer::_onStaticChanged );
|
|
|
+
|
|
|
// Put the kinematic actor on group 29.
|
|
|
NxActor *kineActor = mController->getActor();
|
|
|
kineActor->setGroup( 29 );
|
|
@@ -110,6 +113,11 @@ void PxPlayer::init( const char *type,
|
|
|
kineActor->userData = &mUserData;
|
|
|
}
|
|
|
|
|
|
+void PxPlayer::_onStaticChanged()
|
|
|
+{
|
|
|
+ mController->reportSceneChanged();
|
|
|
+}
|
|
|
+
|
|
|
void PxPlayer::_onPhysicsReset( PhysicsResetEvent reset )
|
|
|
{
|
|
|
// The PhysX controller will crash out if it doesn't clear its
|