Odd bounces on flat surfaces

Jul 23, 2011 at 3:35 AM

I'm getting odd bounces on completely flat surfaces, does anyone else get this and does anyone know a way to solve it? My setup is simply a rectangle physics object set to static and an ellipse 60 by 60 physics object with 1.0 restitution.

Coordinator
Jul 23, 2011 at 11:03 AM

a couple of things to try -

- set DebugMode="true" on the PhysicsController behavior and check out the boundary locations (maybe a transform threw them off?)

- can you create a video of the behavior so we can take a look?

 

Jul 23, 2011 at 5:11 PM

Threw debug mode on and found the problem. Didn't think I had to set the boundary element to the ellipse for the user control. It took the canvas as the object otherwise. Thanks for the response though, always forget about that debug mode :(

Jul 23, 2011 at 7:40 PM
Edited Jul 23, 2011 at 8:58 PM

One more question. Is there a way to determine weather a physics object is at rest. Let's say a bouncy ball. Is there a way I can detect that it is now at rest and is not moving? I tried creating a timer between the bounces to determine weather it is at rest or not but sometimes it is unreliable and is a lot of work.

Jul 24, 2011 at 4:05 PM

Bump. I'm also interested in a good way to determine if an object is at rest. I tried different things with positioning and timing but they aren't reliable all the time.

Jul 24, 2011 at 4:26 PM
Edited Jul 24, 2011 at 4:27 PM

Bump. I'm also interested in a good way to determine if an object is at rest. I tried different things with positioning and timing but they aren't reliable all the time.

What I did was create 2 class variables (Vector2 currentPosition, Vector2 previousPosition) and then created a timer that ticks every second that looks like this:

 

        void bounceTimer_Tick(object sender, EventArgs e)
        {
            currentPosition = ball.Position;

                if (currentPosition == previousPosition)
                {
                    // Object at rest
                }
                else
                {
                   // Object moving
                }
            }

            previousPosition = currentPosition;
        }