ODE object flying to the side as soon as created?

Blitz3D Forums/Blitz3D Userlibs/ODE object flying to the side as soon as created?

JoshK(Posted 2004) [#1]
I had good results implementing ODE in a small program, but then I got some weird results in the editor. The object flies off to the side, or up, and then behaves normally once it slows down or lands. It's as if there is an existing object it is colliding with, but there is only one object.

This code might look a little different from most Blitz code, but you can see what it does:
Case MENU_FITBOX
	If CURRENTSTATICMESHREFERENCE
		PokeInt CURRENTSTATICMESHREFERENCE,STATICMESHREFERENCE_COLLISIONMETHOD,1
		RenderBrowserStaticmeshDisplay()
		body=ODE_dBodyCreate()
		geom=ODE_dCreateBox(PHYSICSWORLD,ODE_SCALE*StaticMeshReferenceWidth(CURRENTSTATICMESHREFERENCE),ODE_SCALE*StaticMeshReferenceHeight(CURRENTSTATICMESHREFERENCE),ODE_SCALE*StaticMeshReferenceDepth(CURRENTSTATICMESHREFERENCE),1)
		ODE_dGeomSetBody geom,body
		ODE_dBodySetPosition body,ODE_SCALE*StaticMeshReferenceCenterX(CURRENTSTATICMESHREFERENCE),ODE_SCALE*StaticMeshReferenceCenterY(CURRENTSTATICMESHREFERENCE),ODE_SCALE*StaticMeshReferenceCenterZ(CURRENTSTATICMESHREFERENCE)
		ODE_dBodySetMass body,10
		ODE_dBodySetLinearVel(body,0,0,0)
		PokeInt CURRENTOBJECT,OBJECT_ODE_BODY,body
		PokeInt CURRENTOBJECT,OBJECT_ODE_GEOM,geom
		EndIf



Eric(Posted 2004) [#2]
Halo,

My first time responding to you, and I don't know if this is your answer, but I remember there being an invisible object at 0,0,0. There is a default floor that you can disable, and create a floor of your own. I think this was a bug or something.

Regards,
Eric


JoshK(Posted 2004) [#3]
I know there is a plane, which I enabled because I want it. Is this what you mean, or is there a solid box or something there? It doesn't pick up any collisions until it hits the floor.


Eric(Posted 2004) [#4]
I think it is attached to the Plane somehow... I don't know if it was ever explained. I just disabled the invisible plane and created my own... Currently I use Tokamak. So I don't have any truely good advice.

Regards,
Eric


JoshK(Posted 2004) [#5]
Hahaha...

Yeah, I looked at some older threads, and it looks like there is some invisible object. I offset everything by a constant, and it works fine. Still, that's kind of troubling.


Eric(Posted 2004) [#6]
I know...

Have you looked at Tokamak?
The only thing that troubles me with tokamak is the fact that there has been no movement on revisions... It's almost like it died. I hope in the future, we can just use dll's with no wrapper dll. I think that would be handy.

Regards,
Eric


JoshK(Posted 2004) [#7]
I found that Tokamak had some severe crippling problems. Objects would pass through each other unless the physics were set to EXTREME dreamlike mode.

I have a guy working on another ODE dll, so maybe you can use that and not have the problems with the current one.


Eric(Posted 2004) [#8]
I would like that, Converting to ODE is not a difficult process. Keep me in mind if you get that new .dll.

I haven't had problems with tokamak ,like thing passing through other things, unless they we move extremely fast, but usually my problem is mesh density. If I create a quad with only 4 verts, scale it to be 128 x 128, the simulation was very inaccurate. Take that same Mesh and quad divide it a couple of times and it worked perfect.

I'll have to take another look at ODE.

Regards,
Eric