A good physics engine


I am searching for a good physics engine, which is free to use. I want to create a littel game and have already build a good graphics engine, using dirertx 11. I am using Visual studio 2012 and c++. I really want to avoid to write my own physics engine, because it is very complicated and why should I reinvent things, that already exists.

I tried to use Physx, but I am not able to set it up, so I am searching for a other good physics engine.
Please post your ideas.


did you already gave up?

PhysX is one of the most advanced physic engine around.
Of course, there are many open source physic engines, and commercially engines.

But you should think about what you need for your game.
How little is it? What ecspecailly do you need the physics for?
Does a simple raycast meet the needs?
Or do you need a complex joint / vehicle / or what ever collision detection?

You know that PhysX is completly free for Windows PCs - COMPLETLY! That means that you dont have
to pay a fee, or something else to use it under this platform. Good. You have to mention that
you use PhysX in your game, but everybody like to do this. -> For more infos: Take a look at the licence.

I did a response on your question about the linking error - it seems to me that you dont have
much time to think about what you did or what you what to achieve.

PhysX is really easy to handle - and its incredible fast.
(Take a look into the benchmarks of 3.2 to 3.3 - nvidia did a great job there :D )

So. I dont want to mention other physics libs, but most of them are out of date - uncompleted,
receives no updates anymore or isnt well coded.

Thus PhysX great OO design, its really esay to code with it and every line of code make sense.
Of course, the “best” open source physic engine is also well coded and fast, but as my last look
into it, it wasnt OO designed - and confused me.
But I must say that I used PhysX a lot and dont want to change to another physic engine anymore.
Thus of course I’m biased of PhysX. :D

Really, the other physic engines have other benefits and are also great
its widley used - in games, movies, modeling software …, but I prefer PhysX.
( Which also have similar references…)

I am realy trying to to set up Physx. I have read a lot of articels about how greate Physx is and, because of this reason, I want to use Physx.

The game I want to program is a simulation of a neuronal network. This network should contain one thousand
neurons. And in average every neuron should have one hundret connections to other neurons. Because the neurons should be visualized, I want to program, when a new connections is created, an animated growth of the connection. But when a connection is growing, the connection has to find a way through the network, which is created, by all the other connections. To program this, I need a good collision engine.


I guess you dont need much of physics - the AI part are the main part of the game.
Google for A* algorithm, or for navigation meshs - there are one popular open source navigation
mesh with steering behaviour lib - which uses many game engines like Unity …

You also could think to do this in a binary tree or search tree - just google for it and read
about these topic. There are different trees - with different benefits.

This is a search tree - (visualized)

© www.computergraphica.com

Its only a visual example. Due to the fact that you want to create your network dynamic -
it would be a real pain when search for a free spot I think.
Even when you try to search for a node in your network - without a tree it would take huge amount of time. An easy way to implement this is to set a offset for each node - so you dont have to worry about
a way finding algorithm. ( You also could use the lib I mention above, I´m going to use it too )

I want to visualize the network. The network without graphics is already working, and, you are right, I am using Binary Searchtrees. To be exact, I am using Red-Black-trees. But the difficulty is to visualize it.
I have to create a graphics engine and I need a collision engine. And this is the reason I am needing physx. I have read a hole book about collision. It was very complicated. But I know, that this was only a small pice of a really good collision engine.


I like the Red Black trees - and their special behaviour about the O(log n).
Okay I guess there are other trees which may be faster, but these are already fast I think.
(When I remember corrtly, the RBT are a little bit uneven - thus not comptly optimized)

Hm. Why should you reinvent the wheel by coding a own graphic engine?
(Okay. It will be faster and much smaller than other engines - its custom made for your network visual.)

If you really need to reinvent it - you probably look at directX or even openGL - depends on
which platform(s) you want to release it.

But if you want to create fast and easy a visualation of it - you may think about open source
3D renderer like Irrlicht ( very easy, powerful ) or Ogre (extremly powerful - I use it:) ).

Irrlicht is good for 2D and 3D - its fast, easy and of course, open source.
Ogre is awesome and much better than Irrlicht - but its mostly for 3D applications.
I didnt use Panda or something else - I think that Ogre is one of the best open source
3D renderer which receives lots of updates - have tools and a great community.

Depends how detailed the graphics need to be - you could pick one of the options.

Hm. Offtopic I think.


I guess it wouldnt be so hard to create a visual from a tree which is completed -
just I said above, each node have a small space between athoer nodes - (leafes) and connections.

Maybe the hardest part of it will be add / removing of data in runtime.
But even that dont need a special physic library like PhysX I think - its only an algorithm which
moves the nodes / leafes so they dont touch each other.

But when you really want to use a phsyic engine for it (which makes atm no sense for me)
you should think about the huge amount of possible actors - when you create a node at a position from the root node - the actor of the new node (or entry) call every single time when he “moves” something like a AABB test - (overlap)… … and think about how much RAM you need for it …

Or another way you maybe archieve it: You store each position of your actors (which repesents nodes)
in a big list and iterates throu it - until you found a position which have enough room for your node.

Or using raycasts … .Omg :)

Another option: Waypoints I think. But … yeah… you know.

I dont want to say more about it. Maybe you get the point.

But if you reaaaally want to use a physically way… You should read more about navigation meshs - you
could feed your node as an obstacle - and the navigation mesh builder will build a new way around the
obstacle - in a few ms!!!

© zach.in.tu-clausthal.de

The grey spots could be a node - (Think about an “inifity” plane - you set each node / leafe as obstacle, and build the navmesh from it. On the blue polygons, you could add new nodes / leafes.
-> Or even moves with a character on the grey shapes. Without touching nodes of course.

But … Maybe this is good idea - or not. I really think that a few alogrithm could solve your problem.
( Of the positioning …)