Objects passing through one another at high velocity

May 28, 2011 at 12:49 AM

I've got a method that applies a velocity based on how far a user is clicking from a starting position. The further away the higher the velocity.

I've noticed that when vector is above a certain number the object is passing through static objects (seems to be related to size, the smaller the more likely to pass thought).

If i decrease the velocity it will bounce off / interact as normal.

 

 

Coordinator
May 28, 2011 at 12:46 PM

You can try setting IsBullet="True" on the PhysicsObjectBehavior for the object that is passing thru stuff.

This is at the cost of performance. You can learn more about Bullets in the Farseer or Box2D docs.

May 29, 2011 at 4:52 AM

Hi Andy,

I did try setting IsBullet but it didn't seem to have an effect. Here is a demo project to show you what i mean. If you reduce the force applied it should stop at the first layer.

http://dl.dropbox.com/u/21073738/WindowsPhoneApplication3.zip

Nov 9, 2011 at 1:02 AM

Did anybody find a solution for this?

Sep 19, 2012 at 1:11 AM
Edited Sep 19, 2012 at 1:18 AM

Maybe you need to change the Settings.ContinuousPhysics to true.
Otherwish the IsBullet takes to effect.

try:

        public MainPage()
        {
            InitializeComponent();
            Settings.ContinuousPhysics = true;
            return;
        }
Sep 19, 2012 at 5:35 AM

I'm having same issue.  The oncollision event is firing it just isnt bouncing off the wall.

Sep 19, 2012 at 11:37 AM
Edited Sep 19, 2012 at 12:18 PM
conehead wrote:

I'm having same issue.  The oncollision event is firing it just isnt bouncing off the wall.

@conehead
What you are describing is entiry another problem and completly unrelated to high velocities. My quess is that you are telling farseer to ignore the collision inside the onCollision handler.
Please start a new thread and provide a sample project of how you hook the onCollision event. 

I don't know much about Physicshelper & SL, since i work directly on farseer in XNA. All I can tell you is that in farseer the onCollision handler returns a boolean, if your handler returns false then this tells farseer to ignore the collision. 


 
In order to not confuse others, let me sum that the problem described by @Spruce can be solved by:

A) enabling the Continues Collision Detection (CCD)

 Settings.ContinuousPhysics = true;

B) set IsBullet to every element with high velocities

<pb:PhysicsObjectBehavior IsBullet="True"/>

CCD will have an impact on performance, so you shouldn't use it if you  don't need it.


 

 

Coordinator
Sep 19, 2012 at 11:39 AM

For the oncollision event and no bouncing, try setting DebugMode="true" on the PhysicsController. This will show your object's boundaries (it's possible that one of the boundaries is not what you want/expect.

Sep 19, 2012 at 1:02 PM
nkast wrote:
conehead wrote:

I'm having same issue.  The oncollision event is firing it just isnt bouncing off the wall.

@conehead
What you are describing is entiry another problem and completly unrelated to high velocities. My quess is that you are telling farseer to ignore the collision inside the onCollision handler.
Please start a new thread and provide a sample project of how you hook the onCollision event. 

I don't know much about Physicshelper & SL, since i work directly on farseer in XNA. All I can tell you is that in farseer the onCollision handler returns a boolean, if your handler returns false then this tells farseer to ignore the collision. 


 
In order to not confuse others, let me sum that the problem described by @Spruce can be solved by:

A) enabling the Continues Collision Detection (CCD)

 Settings.ContinuousPhysics = true;

B) set IsBullet to every element with high velocities

<pb:PhysicsObjectBehavior IsBullet="True"/>

CCD will have an impact on performance, so you shouldn't use it if you  don't need it.


 

 


This seem to help.  It appears(before adding continuous physices) that when the collision fired it was already on the other side of my wall.