Tuesday, 21 June 2011

Building my own Delphi Physics Engine part VII

After several weeks working on my TDPE I think I managed it to get the desired outcome and now the displayed items show more realistic features. In my previous versions, neither angular velocity nor mass was interacting in terms of moving an object and now, using different mathematical algorithms, the gravity and angular velocity are considered for every item. That means that as soon as a collision is originated, the resultant force will lean back or forward the object and it will be rotating or moving until the forces of the system reach a value close to zero.
This new approach has included a massive refactoring of the existing code to cope with this new behaviour that will deliver spectacular performances. During the following weeks I'm going to  focus on the cutting tool as now I only have to extent the 4-edges collision object to n-edges. Once I have the n-edges collision object then I would be able to generate small chunks of it and each piece would have its own behaviour giving you the feeling that the object has really been broken.

As it's shown in the image, when most or more than a half of the object is out of the base (in blue), the red box should lean forward and fall according to the laws of physics (falling using rotation instead of falling straight how it was before in previous versions).

The following video will show the results of applying the latest algorithms to my Engine:

Enjoy the video!.

Get the latest executable here: ThundaxBallDemo v1.349.
If you want to drop a box, press 'd' and a new red box will fall.

Related links:


Post a Comment