Javascript Physics Engine
This is my latest javascript project, using the canvas object. I have posted about making a 2D and 3D lindenmayer system earlier on. I don’t really like the flash platform mainly because you have to pay for flash and I also don’t really like the way the movie clips are handled in the script from when I have used it as my school. This means that javascript is the only other option really for anything web based (Microsoft silverlight isn’t popular enough currently).
I found that some people have used native features of internet explorer to create a canvas object that works in internet explorer. Unfortunately this is terribly slow currently but there is nothing which can be done about that. This means that my example script does with with internet explorer and amazingly no modifications were needed other than including the explorer canvas script.
At the moment my physics engine is woefully incomplete. At the moment there is no collision detection other than with the floor and both walls. I am going to be working on the collision detection next since it is a pretty major part. I am still playing around with different algorithms currently, looking for a high speed routine. The system for adding dynamic and static objects to the world works well enough for now but I will expand this as features are needed. I haven’t put any static features in the demo because they are not very exciting since they just stay there and don’t even collide with things. Gravity is implemented.
I have only put in a small number of objects because I felt sorry for the people with internet explorer. Hopefully the final release will be feasible for IE because there shouldn’t be too many dynamic objects to be drawn and I should be able to get a pre-rendered scene for the static objects. The rest is done in plain javascript which doesn’t take a big performance hit.