Skip to main content
gamedev.net
🔒 Locked

Physics Engine Benchmark

Started by shywho 0 replies 1.3k views
Original Post
shywho
shywho
I am investigating the possibility of benchmarking the various physics engines available. I have a few questions in this regard.

1. Is there any such benchmark available already?
2. What features should I consider for this? Collision detection, rag-doll simulation, fluid physics are the ones that come to my mind.

Let me know your thoughts on this.
Dirk Gregorius
Dirk Gregorius
I would test first:
- Simulation quality (stacking, friction, restitution)
- Performance
- Memory consumption (!!!)
- Contact creation (expecially for convex hulls)
- Penetration recovery
- Raycasting (short casts against shapes and long shapes through the world)
- Containment queries
- Ragdolls (throw ragdolls down some stair, some ragdolls on a pile, etc)

Later:
- Continuous Collision Detection (CCD)
- Continuous Physics (CP)


Make your live simple and DONT write an abstract physic engine. Just abstract your test scene and populate it. E.g.

class Scene
{
public:
// ...

virtual int AddSphere( ... ) = 0;
virtual int AddBox( ... ) = 0;
// ...

virtual void AddSphericalJoint( int, int ) = 0;
// ...

virtual void CastRay( ... ) = 0;
virtual void Contains( ... ) = 0;
// ...

virtual void Draw( void ) = 0;
virtual void Step( float dt ) = 0;

};


class HavokScene : public Scene
{
public:
// ...
};


The Add*() functions return some handle (e.g. index) which you pass into the joint functions. Again - keep your life simple!

I don't like the idea of making an abstract physic engine. It forces you to use the least common devisor. With this approach you can use the strengths of exach engine and expose it in a small GUI. Make also sure you can interact with these scenes and switch engines at runtime.

Also make sure that you can force boxes through the general convex hull collider. The engines use different approaches favoring performance over quality. It would be great to show these difference explicitely.

I have such a comparison suite which implements most festures. Still I think it would be great to have an open source version. I can post a demo here to give you an idea and guide you through your process if you want.

The source code that comes with OpenGL Distilled is a great start to implement cameras and rendering quickly and easily. You can find it here:

www.opengldistilled.com

A simple to use GUI is available here:

http://www.antisphere.com/Wiki/tools:anttweakbar




Cheers,
-Dirk

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.