Trigger Problem

ANdys

29-07-2007 20:01:26

I use the Trigger to be a check point.
If i want to destroy a Trigger ,does the Trigger can't have any Bodys or Actors in it ?

betajaen

29-07-2007 20:04:35

You can destroy a trigger if there are bodies in it.

ANdys

29-07-2007 20:21:36

I tried many times.
But I got a crash whan I destroy a trigger if there are bodies in it. :(




bool FixedSceneController::Simulate(NxReal deltaTime) {

mTiming_CurrentStep += deltaTime;

if (mTiming_CurrentStep < mTiming_MaxStep) {
mRenderFrame = false;
return false;
}

mNxScene->simulate(mTiming_MaxStep - (mTiming_MaxStep - mTiming_CurrentStep));

mNxScene->flushStream();
mNxScene->fetchResults(NX_RIGID_BODY_FINISHED, false); <<============================================== Stop here
mRenderFrame = true;
mTiming_CurrentStep=0;

return true;
}


I using NxOgre 0.9-32.
thanks!
________________________________________
You are really a robot . :shock:

betajaen

29-07-2007 20:50:06

When/Where are you deleting it?

ANdys

30-07-2007 02:47:20

When/Where are you deleting it?
My first idea,On bodies enter trigger ,calling mScene to destroy this trigger.

I also tried another way.

1.Usng bool in callback, and listening the bool on update.If true and destroy.
2.On enter, temp the trigger. And enter next trigger,destroy last trigger.

ANdys

30-07-2007 04:54:44

I find a reason,the problem is not the bodies.
The crash only happen when i turn on the DebugRenderer.
so,I think the problem is I delete the trigger , but DebugRenderer still get this trigger data and rendering the trigger Wire Frame.

At last I understand why you dislike the DebugRenderer. Now, me too :wink:

betajaen

30-07-2007 09:48:38

Indeed, I don't like it either. Use the remote debugger instead.