Level Rotation

Princess_Conecloon

15-04-2006 22:19:43

I have a level that is set up with TreeCollision, so I can't apply any type of forces to it, but I want to be able to tilt the level from side to side and back and forth. I am able to do this, but the object on the level (a ball) either gets stuck and then pops back up into the level, or just falls through. I have tried to set collision to continuous, but it doesn't work. Is there any way I can make it so I can rotate the level around while keeping the ball object inside the levels collision barrier?

Princess_Conecloon

17-04-2006 05:24:34

Also, is there any way to set an object so that it won't accept a collision (allowing it to pass through) but will still return its collision if an object does hit it? For example, if I wanted to detect if an object is inside an area, such as a box, could OgreNewt do this? I can't find anything that allows to disable just the collision, without removing it all together.

walaber

17-04-2006 07:19:41

about the tree collision. if the entire world is supposed to be rotating, you can just change the gravity direction (and rotate the camera) to simulate rotating the world. if you really need to rotate a TreeCollision object (or move one), it is possible, but is pretty complicated. search the Newton forums, there are a few topics about moving static bodies.


as for the collision detection, have a look at ContactCallback. this class is the answer to your questions. please read closely the explanation of the userBegin, userProcess, and userEnd functions.

OvermindDL1

17-04-2006 08:48:49

I use a box for areas in my scenes, they are invisible (just the physics part is all that exists) and use callbacks to determine when something is inside, and I adjust their gravity accordingly by changing their functors (that is one reason why I was using functors walaber, they now work perfectly). One area is for water, I have other areas where right side up is actually to the right, wierd effects, Serious Engine'ish.

Princess_Conecloon

18-04-2006 01:02:22

Thanks for the help. Both ideas worked perfectly. Good idea for the shifting of gravity, never thought of that. :D