New ODE 0.5 wrapper for Blitz3D

Blitz3D Forums/Blitz3D Programming/New ODE 0.5 wrapper for Blitz3D

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I post again :)
;creates a rigid body cube from a source entity's dimensions and link them together
Function ODECube(ent)
	;get transform
	x#=EntityX(ent,1)
	y#=EntityY(ent,1)
	z#=EntityZ(ent,1)
	sx#=MeshWidth(ent)
	sy#=MeshHeight(ent)
	sz#=MeshDepth(ent)

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

	;create the rigid body geometry for ode
	o\geo = ODE_dCreateBox(ODE,sx,sy,sz,10)
	ODE_dGeomSetBody o\geo, o\body

	;set position and rotation
	ODE_dBodySetPosition(o\body,x,y,z)
	ODE_dBodySetRotation(o\body,0,0,0)

	;link
	ODELink(ent,o\geo)
	
	Return o\body
End Function