collision body out of sync [solved]

dest

09-04-2008 18:18:42

Okay this may be a stupid question but I can't seem to figure it out. I have a cylinder collision shape and I'm attaching it to a sceneNode, but as you can see below it's not aligned correctly with the graphics -



I've tried translating the sceneNode to make the two match up but the body seems to move with it (I thought this wasn't meant to happen?). Ive also tryed using getPositionOrientation() and setPositionOrientation() on the body too move it into sync with the graphics, but no luck.

Any help would be much appreciated, though I'm probably just missing something stupid. Cheers!

albino

09-04-2008 18:59:57

maybe the sylinder's center isnt where its supposed to be

side view from cylinder:


center is supposed to be in "O" but its in "X"
now when you rotate it, it will rotate around "X"
instead of "O" and that causes the weird rotation

just a guess tho, worth to check :roll:

dest

09-04-2008 19:03:14

maybe the sylinder's center isnt where its supposed to be

side view from cylinder:


center is supposed to be in "O" but its in "X"
now when you rotate it, it will rotate around "X"
instead of "O" and that causes the weird rotation

just a guess tho, worth to check :roll:


Yeah this is true alright, the cylinder is offset slightly intentionally. Im just wondering if there is a way to correct for this?

dest

09-04-2008 22:30:50

Figured it out. Just attached the body to a sceneNode and then attached the entity to a child of that and set the offset there.