Sign in to follow this  
jdub

PhysX: Boxes not staying where they are supposed to be

Recommended Posts

I am planning on hooking PhysX into my 2D game engine. First, however, I have been making a few little test demos. My current one takes 2 boxes and throws them at each other. I'm setting this one up to make sure collision detection is working how I want it to. Both actors are initiallized with 0 as Z rotation and position values. I then figured that I could keep them from moving around on the Z axis by changing the settings in the creation flags that freezes their rotation and position on this axis. However, when I run the program, the two boxes collide with each other and then, as they are flying backwards, they make a tiny dip into the z axis causing my rendering to be screwed up. Why is this happening even if I am setting them to be frozen in place at 0 on the z axis? [Edited by - jdub on September 12, 2009 11:56:18 AM]

Share this post


Link to post
Share on other sites
PhysX probably uses an internal inertial constraint solver to maintain the positions and orientations of "frozen" objects.

This means that these objects will not always have the proper positions and orientations if they receive a large impulse (from a collision). If you really want to always have the objects at z=0, set the Z coordinate yourself (or just ignore it and assume 0), though this might cause some physical inaccuracies.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this