Game Development Community

Character's center

by D B · in Torque Game Engine · 04/09/2006 (1:15 pm) · 5 replies

I spawned an explosion at the character's position, it appeared at his feet. When I checked in the World Editor, I noticed a little box by the character's feet when I select him, which is the same location where the explosion appears.

I was wondering what this box is; is it the bounding box? It seems really small for a bounding box. If it is the bounding box, would the explosion spawn at the center ofthe bounding box, or does it spawn elsewhere in it? If it is not the bounding box, how I could adjust it to be at the character's torso, rather than his feet?

Thank you.

#1
04/09/2006 (1:36 pm)
It's possible that your bounding box is just really small. Player bounding boxes are not actually stored in the model file itself, but in the player datablock. There should be a "boundingBox" field in the PlayerData datablock that you can alter to make the box bigger.

the default value is "1.2 1.2 2.3" but if you have a new player model those values will probably not be appropriate.
#2
04/09/2006 (2:04 pm)
The bounding box was very small, and those values did indeed change the size of the bounding box. Thank you. :D
#3
04/09/2006 (4:04 pm)
Getting the players position returns the x,y center and z base of the bounding box (their feet). So if you want to get the player's "center" just call getWorldBoxCenter() instead of getTransform().
#4
04/09/2006 (8:00 pm)
Oh, cool! Thanks, Paul! :D
#5
04/12/2006 (10:54 am)
That's good to know, thanx