Scale

mrmclovin

21-09-2008 23:26:09

When I create a cube from a mesh of yours (cube.1m.mesh) and a cube shape: Cube(1), the shape and the mesh would be the same size ? It's not the same size and I have to scale(2,2,2) the mesh to make the mesh same size of the shape. I looked in the Cube constructor and saw this:
mShapeDescription.dimensions.set(size * 0.5f, size * 0.5f, size * 0.5f);

Is the size being devided to its half size of the argument I passed? why is that?

betajaen

22-09-2008 09:59:21

Well the rule is you have to start a new post if the one you are replying to is over two months old.

mrmclovin

22-09-2008 13:38:34

Okey, so I ask again:

When I create a cube from a mesh of yours (cube.1m.mesh) and a cube shape: Cube(1), the shape and the mesh would be the same size ? It's not the same size and I have to scale(2,2,2) the mesh to make the mesh same size of the shape. I looked in the Cube constructor and saw this:

mShapeDescription.dimensions.set(size * 0.5f, size * 0.5f, size * 0.5f);



Is the size being devided to its half size of the argument I passed? why is that?

xadh00m

22-09-2008 13:57:01

IMHO this is necessary because the PhysX Shape description does not want the
length/widht/height of the cube, but the expansion which is the half size (in all three dimensions).
You may read something about it in the PhysX documentation about shape description...

mrmclovin

22-09-2008 17:35:18

Okey I'll read about it. But that makes 1 NxOgre(metre) != 1 Ogre unit? Or the description thing is something else and has nothing to do with the shapes _collision_ size ?

betajaen

22-09-2008 18:46:30

1m = 1 NxOgre Unit = 1 Ogre unit.

To be consistent through out NxOgre; I chose the size given to be a diameter but internally it's halved to be the radius. There is a tiny bit of leeway called skin-width which is added or removed to aid in collision you may be getting confused with that.

mrmclovin

23-09-2008 13:52:02

Ok, thank you for your time.