ODE Help Urgent Please!

Blitz3D Forums/Blitz3D Userlibs/ODE Help Urgent Please!

Erroneouss(Posted 2005) [#1]
I can't seem to figure out what the heck I'm doing wrong...
I feel soooo stupid. I know its going to be something really easy...

But here goes... I have a type, "TODEGeom", and whenever it collides with something, it goes reddish colored... I want it to play a sound too, like a thing hitting another thing sound... I feel soo stupid... It's gonna be really easy I just know it...

For g.TODEGeom = Each TODEGeom
	count = ODE_dBodyGetCollisionsCount(g\body):
	depth# = ODE_dBodyGetCollisionDepth(g\body,i)	
		For i = 0 To count - 1
			If depth > 0.01
				red# = 255*depth*5
				If red# > 255 Then red# = 255
				EntityColor g\mesh, 255,255,0

			Else
				EntityColor g\mesh,255, 255, 255
			EndIf
		Next
		EntityColor g\mesh,100+red,10,0
  Next 



Eric(Posted 2005) [#2]
Maybe, but not sure...

Put this line inside your For...Next loop

depth# = ODE_dBodyGetCollisionDepth(g\body,i)


JoshK(Posted 2005) [#3]
For g.TODEGeom=Each TODEGeom
If ODE_dBodyGetCollisionsCount(g\body)
PlaySound sound
EntityColor g\mesh,255,0,0
Else
EntityColor g\mesh,255,255,255
Endif
Next


Erroneouss(Posted 2005) [#4]
@Eric - Still doesn't work....
@halo - Then the sound plays infinitly... and never stops.

P.S. - Oops! I noticed a ":" ater "ODE_dBodyGetCollisions"... *Smacks self in face*...

hmmm.... Even fixing that, it still doesn't work....