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

SolveVelocityConstraints function does not work correctly

Topics: Developer Forum, User Forum
Aug 28, 2013 at 4:37 AM
I am experiencing a collision response issue in my game.
I have noticed that if the X and Y components of LinearVelocityInternal vector are between 1 and -1, then the collision response does not work correctly.

The function "SolveVelocityConstraints" ends up in setting the post-collision Y component of LinearVelocityInternal to 0 and thus the object loses the Y component of it movement post collision.

Following are the values I am seeing in SolveVelocityConstraints function:
LinearVelocityInternal at entry (0.99f, -0.99f)
Body's Inverted Mass : 1.0f
lambda while calculating normal impulse: 0.99
Normal Vector : (0,1)

The same code works fine if the velocity is increased so that the both X and Y LinearVelocityInternal are greater than 1 or less than -1.

Does anybody know why this is happening ?

Aug 29, 2013 at 3:55 AM
I found that VelocityThreshold was set to 1 that was causing this problem.
Setting it to 0.1 or 0 solves the immediate problem but once in a while gives strange collision results.

Not sure what will actually fix this issue.

Found another thread that mentions the same issue (

Apparently the issue is still unsolved.