Disabling response for one of the colliders

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Disabling response for one of the colliders

Postby Crashy » Sun May 18, 2014 8:40 am

Hi,
I would like to do a tricky thing: I have two dynamic objects A and B colliding, but when colliding, I would like object B to be affected only by it's own forces, not by the collision response.
More clearly, I would like object B not to be affected when object A collide it.

Is this even possible to do?

thanks.
Crashy
 
Posts: 101
Joined: Fri Dec 03, 2010 6:30 am

Re: Disabling response for one of the colliders

Postby Julio Jerez » Sun May 18, 2014 11:02 am

you could do that by making object A kinematic object with mass. but you have to integrate yourself


integration the force and torque for a kinematic body is easy , you read the force and torque, and divide by the time step
an then you call this function to canculate the new velocity
Code: Select all
void NewtonBodyApplyImpulsePair (const NewtonBody* const body, dFloat* const linearImpulse, dFloat* const angularImpulse);

to calculate the new position and orientation is more trick because as the body move it inertia change, but the newton API provide this function for that.
Code: Select all
void NewtonBodyIntegrateVelocity (const NewtonBody* const body, dFloat timestep);


the import part is to make the body that you do no wan to be change by the engine solver, a Kinematic body with mass. this has the effect that the engine see it as a static body with non zero mass.
This means it is part of the collsion and all force calcutations calculations by it is not integrated.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Disabling response for one of the colliders

Postby Crashy » Mon May 19, 2014 4:14 am

Thank you very much, I'm going to test that. :)
Crashy
 
Posts: 101
Joined: Fri Dec 03, 2010 6:30 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest