Here is an update ODE wrapper. I have been updating a version Raven had and made it compatible with the latest SVN source of ODE and VSC++ 2008. It is also free and open-source.
What's New -
I've been adding plenty of new things to the ODE wrapper which is now over 200 commands. The original wrapper only had ~70-80 commands.
* Additional Message Commands (for Contacts)
* Ball-in-socket joints
* Hinge joints
* Slider joints
* Fixed joints
* Universal joints
* Hinge2 joints
* Angular motor joints
* Linear motor joints
* PR joints
* PU joints
* Piston joints
* Plane2D joints(not fully implemented, I wouldn't use this
quite yet)
* Additional Parameter for triangle Mesh to use a different
object's data on a different object. Useful for low poly
collision meshes.
Update Log -
---- Update Log ----
--------------------
* Note: I decided to keep an update log starting from v0.3.2, to keep track
of things I changed. Things added before I kept record are the joint functions.
- v0.5.0 -
* Added Static and Dynamic Capsules
* Changed ODE SET BODY MASS to ODE SET BODY TOTAL MASS
* Added extra mass functions, ODE SET BODY MASS CENTER/ROTATION and ODE SET BODY
MASS BOX/CYLINDER/SPHERE/TRIANGLE MESH/CAPSULE
- v0.5.0 rc3 -
* Organized Code into seperate h/cpp and classes and added seperate configurations
for future possiblity of compiling it to dgdk/dbc and fpsc (none working yet).
* Added ODE SET WORLD CONTACT SURFACE LAYER and ODE SET AUTO DISABLE Commands.
* Added ODE CREATE STATIC SPHERE and STATIC TRIANGE MESH with optional Geom
Object parameter.
- v0.5.0 rc2 -
* Added Ode Enable/Disable Body to forcably enable/disable objects. When Objects
come to a complete rest in ode they auto-disable to save cpu.
* Added Ode Enable/Disable Joint, basically same as above but on joints.
- v0.5.0 rc1 -
* Fixed Ode Attach Joint, now allows 0 in object params which allows dettaching
from objects (both are 0) and attaching one object to the static environment
(obj, 0).
* Fixed Ode Get Joint Body so if it is attached to static environment it returns
0.
* Fixed Ode Plane2D Joint so its useable now.
* Added Joint Motor Params set and get functions for all joints.
- v0.4.0 -
* Fixed Dynamic Cylinder so it rotates and uses the actual Cylinder class rather
than a Sphere and Cube(Lee's workaround at the time).
* Now uses the Oct '06 DirectX SDK(like DBP) rather than the Aug '07 SDK.
* Added Raycasting support, ODE RAYCAST and a number of supporting get functions.
* Fixed commands returning floats so it returns the correct value (it should at
least).
* Changed some of the command parameter names (from angle->anum) to more accurately
show what it wants and/or to be consistant with other commands.
- v0.4.0 rc3 -
* Added four new commands ODE FIND FREE JOINT, ODE FIND FREE JOINT GROUP,
ODE JOINT EXISTS, and ODE JOINT GROUP EXISTS.
* Fixed a few problems with the keywords file, all commands should highlight
correctly now.
- v0.4.0 rc2 -
* Fixed Ode Destroy Joint Group & Destroy Joint.
* Fixed the Euler to Matrix internally which should fix a number of functions
that had problems with rotation such as the reported problem with ode create
static box.
- v0.4.0 rc1 -
* Updated to latest SVN source (apparently the snapshot version I had was really
old).
* Added Linear Motors, PR, PU, Piston, and Plane2D Joints(not fully implemented)
along with their set and get functions.
- v0.3.2 -
* Removed minimum limit of 7 units for bodies.
* Added an overloaded function, ODE CREATE DYNAMIC TRIANGLE MESH Object,[GeomObject].
This will allow you to specify a different object to act as the Collision model of
an object.
ToDo List -
- Fix and test all commands because I was to lazy to do it the first time.
- Documentation!
- Plane Geom - v0.5
- Capsule Geom - v0.5
- Heightfield Geom - v0.6
- Convex Geom(maybe) - v0.6
- Body Torque and force - v0.6
- Offset Geom - v0.7
- Collide Bitfields -v0.7
- Utility Functions e.g. dBodyGetRelPointXXX - v0.7
- Body Damping - v0.8
- World Damping - v0.8
- Body Kinematics - v0.8
- Get Functions e.g Get Mass/Length - v0.8
- Get ODE Wrapper to work with DBC(maybe)/DGDK - v0.9
- Update Trimesh/heightfield geoms (instead of delete/recreate) - v0.9
- Add multiple geoms to one body - v1.0
- Message Errors(maybe) - v1.0
- Multithreading(maybe) - v1.0
** Beyond v1.0? **
- Built-in Vehicles
- Save/Load Ode States
- Composite Objects
- Spaces
Examples -
Ragdoll -
`
` Ode Ragdoll Demo
` Author: Christian Ang
`
`
` Setup
Sync On
Sync Rate 60
Autocam Off
Disable Escapekey
`
` Ode Start
Ode Start
` Ground
Make Object Box 1,1000,10,1000
Ode Create Static Box 1
Make Object Box 2,100,10,100
Position Object 2,0,300,0
Rotate Object 2,20,45,0
Ode Create Static Box 2
Make Object Box 3,300,10,300
Position Object 3,0,150,50
Rotate Object 3,15,0,30
Ode Create Static Box 3
Make Object Box 4,500,10,500
Position Object 4,0,300,150
Rotate Object 4,90,0,0
Ode Create Static Box 4
Make Object Box 5,200,10,200
Position Object 5,0,200,150
Rotate Object 5,0,0,-45
Ode Create Static Box 5
`
` Create Ragdoll
For i=0 to 60
makeRagdoll(rnd(1000)-500,rnd(1000),rnd(1000)-500)
Next i
Position Camera -500,400,-500
Point Camera 0,0,0
`
` Main Loop
Repeat
Text 0,0,"FPS: "+str$(Screen Fps())
Text 0,20,"Use Arrowkeys to move Around Scene"
Control Camera Using Arrowkeys 0,5,2
` Update Physics
Ode Update
`Sync
Sync
Until escapekey()=1
Ode End
End
Function makeRagdoll(offX,offY,offZ)
` Head
head=Find Free Object()
Make Object Sphere head,20
Position Object head,offX,200+offY,offZ
Ode Create Dynamic Sphere head
Ode Set Body Mass head,0.5
` Body
body=Find Free Object()
Make Object Box body,25,50,25
Position Object body,offX,160+offY,offZ
Ode Create Dynamic Box body
Ode Set Body Mass body,0.5
` Left Upper Arm
lUarm=Find Free Object()
Make Object Box lUarm,25,12,12
Position Object lUarm,-30+offX,185+offY,offZ
Ode Create Dynamic Box lUarm
Ode Set Body Mass lUarm,0.5
` Left Lower Arm
lLarm=Find Free Object()
Make Object Box lLarm,30,8,8
Position Object lLarm,-60+offX,185+offY,offZ
Ode Create Dynamic Box lLarm
Ode Set Body Mass lLarm,0.5
` Right Upper Arm
rUarm=Find Free Object()
Make Object Box rUarm,25,12,12
Position Object rUarm,30+offX,185+offY,offZ
Ode Create Dynamic Box rUarm
Ode Set Body Mass rUarm,0.5
` Right Lower Arm
rLarm=Find Free Object()
Make Object Box rLarm,30,8,8
Position Object rLarm,60+offX,185+offY,offZ
Ode Create Dynamic Box rLarm
Ode Set Body Mass rLarm,0.5
` Left Upper Leg
lUleg=Find Free Object()
Make Object Box lUleg,12,30,12
Position Object lUleg,-10+offX,115+offY,offZ
Ode Create Dynamic Box lUleg
Ode Set Body Mass lUleg,0.5
` Left Lower Leg
lLleg=Find Free Object()
Make Object Box lLleg,8,30,8
Position Object lLleg,-10+offX,80+offY,offZ
Ode Create Dynamic Box lLleg
Ode Set Body Mass lLleg,0.5
` Right Upper Leg
rUleg=Find Free Object()
Make Object Box rUleg,12,30,12
Position Object rUleg,10+offX,115+offY,offZ
Ode Create Dynamic Box rUleg
Ode Set Body Mass rUleg,0.5
` Right Lower Leg
rLleg=Find Free Object()
Make Object Box rLleg,8,30,8
Position Object rLleg,10+offX,80+offY,offZ
Ode Create Dynamic Box rLleg
Ode Set Body Mass rLleg,0.5
`
` Attach Joints
jG=ODE Find Free Joint Group()
Ode Create Joint Group jG
` Attach Head to Body
i=ODE Find Free Joint()
Ode Create Ball Joint i,jG
Ode Attach Joint i,head,body
Ode Set Ball Anchor i,offX,195+offY,offZ
` Attach Upper Arms to Body
i=ODE Find Free Joint()
Ode Create Ball Joint i,jG
Ode Attach Joint i,body,lUarm
Ode Set Ball Anchor i,-15+offX,185+offY,offZ
i=ODE Find Free Joint()
Ode Create Ball Joint i,jG
Ode Attach Joint i,body,rUarm
Ode Set Ball Anchor i,15+offX,185+offY,offZ
` Attach Lower Arms to Body
i=ODE Find Free Joint()
Ode Create Hinge Joint i,jG
Ode Attach Joint i,lUarm,lLarm
Ode Set Hinge Anchor i,-48+offX,185+offY,offZ
Ode set Hinge Axis i,0,1,0
i=ODE Find Free Joint()
Ode Create Hinge Joint i,jG
Ode Attach Joint i,rUarm,rLarm
Ode Set Hinge Anchor i,48+offX,185+offY,offZ
Ode set Hinge Axis i,0,1,0
` Attach Upper Legs to Body
i=ODE Find Free Joint()
Ode Create Ball Joint i,jG
Ode Attach Joint i,body,lUleg
Ode Set Ball Anchor i,-10+offX,135+offY,offZ
i=ODE Find Free Joint()
Ode Create Ball Joint i,jG
Ode Attach Joint i,body,rUleg
Ode Set Ball Anchor i,10+offX,135+offY,offZ
` Attach Lower Legs to Body
i=ODE Find Free Joint()
Ode Create Hinge Joint i,jG
Ode Attach Joint i,lUleg,lLleg
Ode Set Hinge Anchor i,-10+offX,100+offY,offZ
Ode set Hinge Axis i,1,0,0
i=ODE Find Free Joint()
Ode Create Hinge Joint i,jG
Ode Attach Joint i,rUleg,rLleg
Ode Set Hinge Anchor i,10+offX,100+offY,offZ
Ode set Hinge Axis i,1,0,0
EndFunction
Downloads -
ODE VC++ Project and DBPro DLL
SVN -
http://svn.xp-dev.com/svn/SlyOdeWrapper/trunk/
Just DBPro DLL
Rar -
http://teroton.com/downloads/DBProODEDLL.rar
Feel free to ask any questions, post bugs, and have fun!
Don't forget to show what you do with ODE in here
. I'll also try to keep the first post up to date with whats new in ODE.