How do I constrain Ogre to only modify one axis?

theTrav

08-04-2009 05:55:49

Within my physics space, there are many items that I only want to simulate movement along the Y axis.
That's pretty much just gravity and collision with other objects.

This means I need to prevent all rotation, and also prevent movement along the X and Z axis.

So far I've tried doing this with body.setPosition() in the collide function, but that seems to make the body stop moving completely after a collision... I'm considering doing it in a frame listener, but that seems a bit crazy.

Is there a more 'proper' way of achieving the behavior I'm describing?

theTrav

11-04-2009 01:22:38

well, for the record I got it behaving more or less how I wanted by setting the angular velocity to zero and the linear velocity to zero on the X and Z axis every frame with a frame listener.

The problem with changing the position was probably that I would have been moving the collision geometries inside each other.

My problem now is that it slows to a crawl when I have a few physics elements (a stack of 5x3x5 barrels, 75 of em in total) freaks it right out.
Is Ode supposed to be capable of running simulations with lots of blocks? I'd expect it to do better than 75, which implies that I'm doing something wrong myself.
I was planning on using it to model up to 30x30x8 block geom's which is like 7200... Is that out of the question then?