JBudOne
26-08-2008 19:02:43
Hey guys, I'm having this problem with my program where the collision box is set in one place, and the node is set slightly above it. Whenever the objects move around, the node moves with it too and remains slightly above the box.
I try moving the nodes down but it moves back into position above the box anyways. Any ideas? Thanks.
micken
27-08-2008 04:52:58
Did you try moving your bodies up instead of moving your node down? It looks to me like the problem might be coming from the way you create your scenenodes and/or bodies.
A thing to try would be to create a CustomTransformCallback to set the position of your scenenode after the body has been updated by the world each frame. Setting the position of either won't have much of an effect in most cases unless it is done here.
Can you post the code you are using to create the scenenodes and bodies?
walaber
28-08-2008 14:41:48
when you create the Collision object, you can specify an offset, to align it properly with your mesh...
just make sure if you do this to call collision->setCenterOfMass(), and calculate the intertia properly, to keep the physics simulation realistic.
brunomfs
17-10-2008 03:08:09
Hello everyone!
I am experiencing the same problem, and i solved it with an offset vector with components (0, bounding_box_size/2, 0).
But as i am making my own meshes in 3ds max and exporting them with oFusion, i would like to know if there's a more ellegant way to solving this problem.
I mean: is it a ofusion exporting problem or is it the way ogrenewt build the collision mesh?
Thanks in advance!
micken
17-10-2008 04:43:30
I've never experienced this problem, but I have always made sure before exporting anything that the PIVOT POINT is in the center of the object, and the transform and rotation is reset.