[Fixed] Box collisions shape bigger than expected

Etek
Posts: 15
Joined: Mon Oct 04, 2010 5:55 pm

[Fixed] Box collisions shape bigger than expected

Post by Etek »

Hello

I'm using blender to export shapes. I've created a box and created a boxshape for it using the dimension directly from blender like this

Code: Select all

objectShape = new btBoxShape(btVector3(1.469f, 7.095f, 2.0f));
When I ran the app, the box behaves like the collision shape is bigger, or better yet, every dimension is scaled somehow to about double of what I expect it to be.

What am I doing wrong?
Last edited by Etek on Tue Oct 12, 2010 5:50 pm, edited 1 time in total.
nonvirtualthunk
Posts: 1
Joined: Thu Oct 07, 2010 9:27 pm

Re: Box collisions shape bigger than expected

Post by nonvirtualthunk »

Your problem probably stems from the fact that the arguments to the btBoxShape constructor represent half-width, half-height, and half-depth, so the end result dimensions will, in fact, be twice what you put in.
Etek
Posts: 15
Joined: Mon Oct 04, 2010 5:55 pm

Re: Box collisions shape bigger than expected

Post by Etek »

Thanks man, that was quite a dumb question to ask. :?