This project has moved. For the latest updates, please go here.

Assertion failed at ApplyTorque()

Topics: User Forum
Jun 28, 2013 at 9:10 AM
Edited Jun 28, 2013 at 9:12 AM

I'm using the Buoyancy Controller to simulate a water surface repulsion, but as soon as I add the controller to my world, I get an assertion failed at startup.


There is any error when I comment the ApplyTorque() in the Buoyancy Update function, but the effect is not as good as it could be.
Vector2 buoyancyForce = -Density * area * _gravity;
body.ApplyForce(buoyancyForce, massc);

//Linear drag
Vector2 dragForce = body.GetLinearVelocityFromWorldPoint(areac) - Velocity;
dragForce *= -LinearDragCoefficient * area;
body.ApplyForce(dragForce, areac);

//Angular drag
//body.ApplyTorque(-body.Inertia / body.Mass * area * body.AngularVelocity * AngularDragCoefficient);
Any known fix for this issue plz ?
Jul 4, 2013 at 8:58 AM
Hello Domort,
the only way I could reproduce this error was to set the Body type to 'kinematic', so mass gets zero and the ApplyTorque (1/mass) fails.
If this doesn't help, put a breakpoint at 'body.ApplyTorque(-body.Inertia / body.Mass...' and trace down the error.
Jul 5, 2013 at 4:32 PM
That is probably correct. I'll implement a fix for 3.5.
Jul 6, 2013 at 8:42 AM
I was using a Kinematic body in the water area to detect bodies colliding in order to make my wave effect.
I changed it to a static body and this does the trick !

Thanks :)