[SOLVED] Character collision dimension problem

Rope

05-04-2008 10:16:32

Hi all.

I'm trying to develop a FPS game for my final project.

Well, I've tested CharacterController and Character for moving my character. I'm using ninja.mesh for testing.

I have a mesh on the ground with enough thickness to prevent the character floating.

So, I can move my character well, now. I'm also throwing a "man.mesh" on right hand click and physics are working great , too.

Let's talk about my problem.

Ninja.mesh is a huge mesh , right? I scaled it in the Character class, I mean I scaled the node in the Character.

character->getNode()->setScale(0.3,0.3,0.3);

The collision of the character is okay with staying on the ground but the collision model is still too small that the body of the character does not collide, only the feet collides.

Both CT_Box and CT_Capsule types didn't solve my problem.

When I increase the y dimension , I see that the character is walking int the air. How can i get the collisionBox to right position? Or my only chance is to edit ninja.mesh and position ninja to a lower position?

By the way, x and z dimensions work well when I set them to 15 or around 15. ( with 0.3 scale)

Thanks. :D

betajaen

05-04-2008 11:14:41

The Ninja mesh offset is weird. It's about 0.5 metres above the 0,0,0. You need to create a secondary node with a offset to counteract the problem.

There have been many posts about this in the past.

Rope

05-04-2008 11:51:40

well then, sorry. I searched a lot but maybe I couldn't find the right keyword.

Thanks a lot.

I really solved the problem by creating a new scene node in the character node and add the entity inside that new scenenode.

Then, i repositioned the ninja entity.

dbrock

06-04-2008 01:21:34

meshmagick!

Put the pivot @ the feet:
meshmagick transform -yalign=bottom ninja.mesh

Make the ninja smaller (say 6 units high)
meshmagick transform -resize=s/6/s ninja.mesh

Is your ninja facing the wrong axis? (this rotates him 90degrees on the Y)
meshmagick transform -rotate=90/0/1/0 ninja.mesh
This removes the need to scale/offset your nodes, and keep your code neater.