Archive for the 'ODE' Category

Refining Physics and Inspecting Objects

January 13th, 2008
Spencer Nielsen Follow snielsen42 on Twitter

After a long time tweaking and puttering with the physics engine I think I have finally gotten close to the kind of settings that are needed for the kind of simulation that I want (dContactApprox is the flag that finally fixed a lot of my problems). I have also introduced projectiles into the mix by adding the “Shell” class. The Shell class is actually just an Actor and is treated the same was as any other tank or other object in the game. It just so happens that tanks create shells and they initially have a great force exerted on them.

I have also put a lot more work into NSObjectInspector (probably to be renamed in the future) so as to be able to support more debugging of the plugins at runtime. I am getting the hankering to spin it off as a general debugging tool for developers because it is just so darn useful.


The idea behind NSObjectInspector is that when you debug a program sometimes you want to just change a value in an object while you are debugging your program at runtime instead of recompiling or writing some sort of user interface to interact with an object’s value. Because the Objective-C runtime affords us a lot of information about what instance variables an object has or what methods it has implementations to, we can provide a general class that can inspect other objects and provide a user interface with which to poke at them with.

Currently it provides interfaces to object instance variables, accessors (method or method pairs in the form of -(void)setMethod:(type)a and -(type)method) and commands (methods in the form of -(void)method). It currently excludes anything in the class NSObject and well known methods that have substantial peripheral effects such as -(id)init, -(void)dealloc and -(void)finalize. Currently supported values are any sort of number type and ids of type NSString. Eventually I plan on creation of class specific exemption lists as well as control hookups.

ODE for the win

December 29th, 2007
Spencer Nielsen Follow snielsen42 on Twitter


After doing a lot more research I decided that I don’t really want to implement the physics engine in Razor myself. Thus I have decided to use the Open Dynamics Engine and I am already pleased with the results. It took me about a day to hook it in (had trouble for a while because my tanks were falling through the ground because of some weird collision setting). It might take a bit to figure out how to do movement and projectiles correctly but it might not be long before we actually have little tanks running around doing battle with each other.

And now I give you pile o’ tanks:

Pile of tanks

Entries (RSS) and Comments (RSS).