Jedive ODE Wrapper

Blitz3D Forums/Blitz3D Userlibs/Jedive ODE Wrapper

My current code looks like...
;creates a rigid body Sphere from a source entity's dimensions and link them together
Function ODESphere(ent)
	;EntityParent ent,0

	;get transform
	x#=EntityX(ent,1)
	y#=EntityY(ent,1)
	z#=EntityZ(ent,1)
	sx#=MeshWidth(ent)/2
	sy#=MeshHeight(ent)/2
	sz#=MeshDepth(ent)/2

	;get radius (radius is biggest scale)
	radius#=0
	If radius<=sx radius=sx
	If radius<=sy radius=sy
	If radius<=sz radius=sz	

	;create ode rigid body
	o.odebody = New odebody
	o\body = dBodyCreate(ODEWorld)

	;create the rigid body geometry for ode
	o\geom = dCreateSphere(ODESpace,radius)
	dGeomSetBody o\geom,o\body

	;set position and rotation
	dBodySetPosition o\body,x,y,z
	dBodySetRotation o\body,0,0,0

	;link
	o\ent=ent

	Return o\body
End Function


Basically I parse my LoadAnimMesh and easily link stuff up and turn it into rigid bodies. Eventually I'll sort the mass and other stuff too...