I have been working on a 2D physics engine for my A Level computing project and I am having trouble calculating the angular velocity from a collision. I have managed to workout each objects linear velocity and create a collision manifold containing the collision points relative to each of the 2 objects involved in to collisions centre of mass (0, 0) along with the overlap etc. I also know each objects mass, speed etc. I have been looking for a couple weeks now at every equation I can find and non of them seem to work returning incredibly high numbers for normal collisions. My current algorithm pulled from an article in the game development section on tuts+ (linked here) is like so:
objectArray[i].angularVelocity += objectArray[i].inverseMass * CrossProduct(collisionInfo.collisionPointB, impulse);
objectArray[ii].angularVelocity += objectArray[ii].inverseMass * CrossProduct(collisionInfo.collisionPointA, impulse);
Could someone please explain how I can calculate the change in angular velocity and give me some example values for the equations as mine are probably in the wrong scale or something.
Thank you for any help, Andy A
Other things to note, this engine is written in C# for XNA so if there are any language specific optimisations they have to work with C#, thank you.
collosionInfo.collisionPointXvalues? They would each need to be in the local mass-centered system for their associated body. Otherwise they could yield too-high values. \$\endgroup\$