It dosn't really work like I expected
REM ===========DARK physX CLASSIC==============
REM BY DD =)
Dim LIMBS(100,6)
load object "IDLE.x",2
load object "WALK.x",1
position object 1,10,0,10
color object 1,100
sync on
scale object 1,50,50,50
scale object 2,50,50,50
do
if upkey()=1 then move object 1,1
if rightkey()=1 then inc a#,3
if leftkey()=1 then inc a#,-3
a#=wrapvalue(a#)
yrotate object 1,a#
if spacekey()=1 then set object frame 2,0
Play_Rag_Physics(2,1,1000,100,3)
sync
loop
Function Play_Rag_Physics(obj,collider,time,speed,flexibility)
if object hit(obj,collider)=0 then timie=0
if object collision(obj,collider)=1
Print "OH!!"
colobjangy=object angle y(collider)
colobjangx=object angle x(collider)
colobjangz=object angle z(collider)
inc timie
active=1
rem calculate the dist bettween all limbs
perform checklist for object limbs obj
for a= 1 to checklist quantity()
limbs(a,1)=limb position x(obj,a)
limbs(a,2)=limb position y(obj,a)
limbs(a,3)=limb position z(obj,a)
limbs(a,0)=limb_distance(a,collider)
next a
for b=1 to checklist quantity()
marks=0
for a= 2 to checklist quantity()
v1=limbs(a,0)
v2=limbs(b,0)
if v2=< v1
else
inc marks
endif
next a
if marks=0 then closest=b
next b
impactsite=closest
r=0
endif
if active=1
inc timie
r=curveangle(colobjangy*-1,limb angle y(obj,impactsite),speed)
r2=curveangle(colobjangx*-1,limb angle x(obj,impactsite),speed)
r3=curveangle(colobjangz*-1,limb angle z(obj,impactsite),speed)
if limb angle y(obj,impactsite)=>object angle y(obj)+flexiblity then yrotate object obj,object angle y(obj)+1
if limb angle x(obj,impactsite)=>object angle x(obj)+flexiblity then xrotate object obj,object angle x(obj)+1
if limb angle z(obj,impactsite)=>object angle z(obj)+flexiblity then zrotate object obj,object angle z(obj)+1
if limb angle y(obj,impactsite)=<object angle y(obj)+flexiblity then yrotate object obj,object angle y(obj)-1
if limb angle x(obj,impactsite)=<object angle x(obj)+flexiblity then xrotate object obj,object angle x(obj)-1
if limb angle z(obj,impactsite)=<object angle z(obj)+flexiblity then zrotate object obj,object angle z(obj)-1
if timie=>time then timie=0 : active=0 : exitfunction
rotate limb obj,impactsite,r,r2,r3
endif
endfunction
function limb_distance(limb,ob)
hd#=sqrt((limb position x(1,limb)-object position x(2))^2+(limb position z(1,limb)-object position z(2))^2)
vd#=(limb position y(1,limb)-object position x(2))^2
d#=sqrt(hd#^2+vd#^2)
endfunction d#
but do you know of any 2D physics engines for DB(preferably for stick ragdolls?
Vista is a paradox created by Bill Gates to force the noble pc gamers of america to console I am here to change that. [link]www.kdlproductions.webs.com[link]