Today I started to study the basics of contact resolution for rotating rigidbodies, but I decided to stop for a moment in order to test a few of the system I've already implemented.
I started by creating a scene in which a few gameobjects are moved through their rigidbodies, and everything went fine. I also applied spring forces to them, and they work perfectly even if the attach points are not centers (which means that the integration of the torque is working as well).
I also implemented a InertiaTensorGenerator class that returns the tensor for the most common shapes (only box and sphere for now).
The main change I made today was moving the Primitive class inside the rigidbody as a vector. Basically each rigidbody now contains an array of primitives, while in the book I'm following it's up to the programmer to create both the bodies and the primitives, and handle them separately.
Tomorrow I'll probably test the collision system, which is the part that scares me the most. I will not test the BVH, because I've postponed that work to the end, along with the octrees. In the gif it is possible to see 2 springs that connects 3 cubes, and the corrent integration of both position and orientation.

Nessun commento:
Posta un commento