Looks like that didn't fix it. Here's piece of my code.
;Here's the type, the non-ode stuff is game specific stuff
Type ODEGeom
Field body
Field geom
Field mesh
Field size#
Field TurnSpeed#
Field TurnDrag#
Field TurnAcceleration#
Field MoveDrag#
Field dx#,dy#,dz#,turn#
End Type
;This first function makes the EDEGeom
Function AddODE.ODEGeom(ODESpace,x#,y#,Z#,p#,yaw#,r#,mesh,colRadius=5,TurnAcceleration# = 0.03,TurnDrag# = .9,MoveDrag# = .99)
Local size = colRadius
ode.ODEGeom=New ODEGeom
ode\body=dBodyCreate(World)
dBodySetPosition(ode\body,x,y,Z)
dBodySetRotation(ode\body,p,yaw,r)
ode\geom=dCreateSphere(ODESpace,size)
dBodySetAutoDisableFlag(ode\body,1)
dGeomSetBody(ode\geom,ode\body)
ode\mesh = mesh
ode\size = size
;create rig
For i = 1 To 360 Step 30
rx# = Sin(i) * 3
rZ# = Cos(i) * 3
odeR.ODEGeom = New ODEGeom
odeR\geom=dCreateSphere(ODESpace,2/2)
dGeomSetBody(odeR\geom,ode\body)
dGeomSetOffsetPosition(odeR\geom,rx,0,rz)
odeR\mesh=CreateSphere()
HideEntity odeR\mesh
ScaleMesh odeR\mesh,size,size,size
EntityColor odeR\mesh,255,255,255
EntityShininess odeR\mesh,0.7
Next
ode\TurnSpeed# = 0
ode\TurnAcceleration# = TurnAcceleration#
ode\TurnDrag# = TurnDrag#
ode\MoveDrag = MoveDrag
Return ode
End Function
;Here's the function I use to destroy, or fail to destroy the ODE Geoms
Function freeODE(ODE.ODEGeom)
dGeomDestroy ODE\geom
dBodyDestroy ODE\body
Delete ODE
End Function
I've also gone as far to check using the GeomID functions to check if the id was correct, and it was. Also try the space remove function "dspaceremove" or somthing like that.
|