Quote: "I totally understand the no time thing. I have been busy with work and I haven't personally been able to do any game stuff lately though some doing work in my company have (lucky folks).
I wish I could have a summer break just to code whatever I wanted...ahh... I'm trying to get there! LOL"
Yeah, ever since I got a job in the summer I've been to tired to work if I had time.
But I've suddenly felt some motivation to work so I got a nice little update for you all(v5.0 rc 1).
First, sorry, but since I got a new computer I hadn't installed the DX 9.0 Oct 06 SDK but the Aug 07 so you will need the Aug 07 runtime for this which I'm sure most of you have. Next update I'll be sure to compile it with the Oct 06 SDK.
I've fixed a few bugs, one in attach joints so now it allows a 0 in the objects parameters. This means you can either attach an object to the static environment or detach objects from the joint(basic method to break joints). I've also fixed a small bug in Ode Get Joint Body to return the correct value when their is no body.
I also took the time to look at the Plane2D joint and fixed that so you'll be able to use it. I've also made a little demo, nothing exciting, to show it works.
` Ode Plane2D Joint Test
` Author: Christian Ang
` Plane2D will constraint object to z == 0
Sync On
Sync Rate 60
Ode Start
Make Object Cube 1,10
Ode Create Dynamic Box 1
Ode Create Joint Group 1
Ode Create Plane2d Joint 1,1
Ode Attach Joint 1,1,0
Make Object Box 2,100,10,100
Position Object 2,0,-50,0
Xrotate Object 2,-60
Ode Create Static Box 2
Position Camera 0,0,-200
do
Control Camera Using Arrowkeys 0,5,2
ode update
sync
loop
Last, I've put in the Joint Param Functions (check this if you want to use it -
http://opende.sourceforge.net/wiki/index.php/Manual_%28Joint_Types_and_Functions%29#Stops_and_motor_parameters ). A list of the functions (untested) -
ODE SET HINGE PARAM joint, param, value
ODE GET HINGE PARAM joint, param
ODE SET SLIDER PARAM joint, param, value
ODE GET SLIDER PARAM joint, param
ODE SET UNIVERSAL PARAM joint, param, value
ODE GET UNIVERSAL PARAM joint, param
ODE SET HINGE2 PARAM joint, param, value
ODE GET HINGE2 PARAM joint, param
ODE SET PR PARAM joint, param, value
ODE GET PR PARAM joint, param
ODE SET PU PARAM joint, param, value
ODE GET PU PARAM joint, param
ODE SET AMOTOR PARAM joint, param, value
ODE GET AMOTOR PARAM joint, param
ODE SET LMOTOR PARAM joint, param, value
ODE GET LMOTOR PARAM joint, param
ODE SET PISTON PARAM joint, param, value
ODE GET PISTON PARAM joint, param
For a list of params check the link and scroll down to the yellow table; the params go in order starting from 1.
I have also rearranged my site so the download is now at -
http://teroton.com/downloads/DBProODEDLL.rar, which I will attempt to keep updated. As for the source I've decided to keep that on an svn respository so if you want it then use this url -
http://svn.xp-dev.com/svn/SlyOdeWrapper/trunk/. Keeping it on an SVN just makes it easier for me to update it.
I'm also currently working on a joint feedback/breakable joint demo so you should expect that soon.
Edit: Eh might as well give you a little taste of breakable joints, current wip demo ;p
` Ode Joint Feedback Test
` Author: Christian Ang
` Sync
Sync On
Sync Rate 60
Autocam Off
` Start Ode
Ode Start
` Create a Jointed Object [ Bridge ]
Ode Create Joint Group 1
For i=1 to 6
Make Object Box i,10,2,50
Position Object i,-70+i*20,-20,0
Ode Create Dynamic Box i
Ode Set Body Mass i,700.0
Ode Create Hinge Joint i,1
Ode Set Hinge Anchor i,-80+i*20,-20,0
Ode Set Hinge Axis i,0,1,0
Ode Attach Joint i,i,i-1
Ode Set Joint Feedback i
Next i
Ode Create Hinge Joint 7,1
Ode Set Hinge Anchor 7,60,-20,0
Ode Set Hinge Axis 7,0,1,0
Ode Attach Joint 7,6,0
Ode Set Joint Feedback 7
` Floor
Make Object Box 100,100,20,100
Position Object 100,0,-50,0
Ode Create Static Box 100
Position Camera 0,20,-200
j=1
` Create Array to save joint stress time
Dim stress(7) as integer
` Main Loop
Do
` Show Joint Feedback
if leftkey()=1 and r=0 and j>1 then dec j:r=1
if rightkey()=1 and r=0 and j<7 then inc j:r=1
if scancode()=0 then r=0
Text 0,0,"Switch Joint with left/right keys - Drop boxes with Space - Break selected joint with Enter"
Text 0,20,"--Joint Information--"
Text 0,40,"ID: "+str$(j)
Text 0,60,"Body 1: "+str$(Ode Get Joint Body(j,0))
Text 0,80,"Body 2: "+str$(Ode Get Joint Body(j,1))
Text 0,100,"A1X: "+str$(Ode Get Hinge Anchor X(j,1))
Text 0,120,"A1Y: "+str$(Ode Get Hinge Anchor Y(j,1))
Text 0,140,"A1Z: "+str$(Ode Get Hinge Anchor Z(j,1))
Text 0,160,"A2X: "+str$(Ode Get Hinge Anchor X(j,2))
Text 0,180,"A2Y: "+str$(Ode Get Hinge Anchor Y(j,2))
Text 0,200,"A2Z: "+str$(Ode Get Hinge Anchor Z(j,2))
Text 0,220,"AxisX:"+str$(Ode Get Hinge Axis X(j))
Text 0,240,"AxisY:"+str$(Ode Get Hinge Axis Y(j))
Text 0,260,"AxisZ:"+str$(Ode Get Hinge Axis Z(j))
Text 250,20,"--Joint Feedback Info--"
Text 250,40,"B1FX: "+str$(Ode Get Joint Feedback Force X(j,1))
Text 250,60,"B1FY: "+str$(Ode Get Joint Feedback Force Y(j,1))
Text 250,80,"B1FZ: "+str$(Ode Get Joint Feedback Force Z(j,1))
Text 250,100,"B2FX: "+str$(Ode Get Joint Feedback Force X(j,2))
Text 250,120,"B2FY: "+str$(Ode Get Joint Feedback Force Y(j,2))
Text 250,140,"B2FZ: "+str$(Ode Get Joint Feedback Force Z(j,2))
Text 250,160,"B1TX: "+str$(Ode Get Joint Feedback Torque X(j,1))
Text 250,180,"B1TY: "+str$(Ode Get Joint Feedback Torque Y(j,1))
Text 250,200,"B1TZ: "+str$(Ode Get Joint Feedback Torque Z(j,1))
Text 250,220,"B2TX: "+str$(Ode Get Joint Feedback Torque X(j,2))
Text 250,240,"B2TY: "+str$(Ode Get Joint Feedback Torque Y(j,2))
Text 250,260,"B2TZ: "+str$(Ode Get Joint Feedback Torque Z(j,2))
remstart - not totally working right yet so disabled for now
` If object force is too much for to long then break joint
For k=1 to 7
If Ode Get Joint Feedback Force Y(j,1) > 50000.0
stress(k)=stress(k)+1
Endif
if stress(k)=60
Ode Attach Joint k,0,0
Endif
Next k
remend
` Allow them to snap bridge at joints
If returnkey()=1 and r=0
a = Ode Get Joint Body(j,0)
b = Ode Get Joint Body(j,1)
Ode Attach Joint j,0,0
` Because it is disabled after detach; reactive
if a > 0 then Ode Set Linear Velocity a,0,0,0
if b > 0 then Ode Set Linear Velocity b,0,0,0
r=1
Endif
` Create a Box to drop onto the bridge
If spacekey()=1 and r=0
i=FindFreeObj()
Make Object Cube i,25
Position Object i,0,100,0
Ode Create Dynamic Box i
Ode Set Body Mass i,1500.0
r=1
Endif
` Update Physics
Ode Update
` Sync
Sync
Loop
Function FindFreeObj()
repeat
inc i
until Object Exist(i)=0
EndFunction i