JV-ODE Physics Thread 9

Blitz3D Forums/Blitz3D Userlibs/JV-ODE Physics Thread 9

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.

You're welcome Xyle

@Chunkations: The code you posted should work ok. I suspect you might be using KeyHit() or JoyHit() to detect the 'Reset' button. Change it to use KeyDown() or JoyDown() instead, as the simulation needs to complete more than one time step during the reset routine. The car demo gets away with it because the reset process doesn't change the cars heading, it only flips it over.

Here's some code you can try in the car demo...
If KeyDown(57)=1
	Force=0

	dBodySetAngularVel(Car,0,0,0)
	dBodySetLinearVel(Car,0,0,0)

	For count=1 To 4
		dBodySetAngularVel(Wheel(count),0,0,0)
		dBodySetLinearVel(Wheel(count),0,0,0)
	Next

	dBodySetPosition(Car,dBodyGetPositionX(Car),10,dBodyGetPositionZ(Car))
	dBodySetRotation(Car,0,0,0)
	End If