Does the btIDebugDraw have some kind of offset?

Post Reply
mant
Posts: 6
Joined: Mon Mar 11, 2013 8:15 am

Does the btIDebugDraw have some kind of offset?

Post by mant »

Hi Everyone. I've implemented a Debug Drawer using Irrlicht, with a on-screen text debug, but the result seems wrong.
I set the SceneNode's position equal to the position I query from bullet to render.

Screenshot:
Image
xexuxjy
Posts: 225
Joined: Wed Jan 07, 2009 11:43 am
Location: London

Re: Does the btIDebugDraw have some kind of offset?

Post by xexuxjy »

Nope , there shouldn't be any offset.. Are the collisions happening where you expect them to, or are they offset as well?
mant
Posts: 6
Joined: Mon Mar 11, 2013 8:15 am

Re: Does the btIDebugDraw have some kind of offset?

Post by mant »

xexuxjy wrote:Nope , there shouldn't be any offset.. Are the collisions happening where you expect them to, or are they offset as well?
Everything else is fine, just the debug drawer makes me wondering. I think I'm not able to use it with Irrlicht anymore.
anthrax11
Posts: 72
Joined: Wed Feb 24, 2010 9:49 pm

Re: Does the btIDebugDraw have some kind of offset?

Post by anthrax11 »

Looking at the doumentation, Irrlicht nodes have positions in local coordinates relative to the parent (root) node.
There is getPosition for local coordinates and getAbsolutePosition to get world coordinates.
Since there is no setAbsolutePosition, you should subtract the position of the root from the position of the node to convert it into local coordinates and then use setPosition.
Post Reply