bounding box resizing?

Posted By: Impaler

bounding box resizing? - 05/27/07 11:48

Hi, I am having some difficulty resizing the bounding box of the actors in my WWII FPS game. The box doesn't go all the way down to their feet, but stays above their waist, like this:
[image][/image] I've tried using c_setminmax and min_z/max_z but it doesn't change anything. The bullet's are using a c_trace function to hit the target, not a move function. How can I make the box extend all the way down to the feet?
Posted By: HPW

Re: bounding box resizing? - 05/27/07 12:31

You could try something like this...
Code:

var enable_polycollision = 2;

action my_npc {npc_update_collhull();}

function npc_update_collhull()
{
c_setminmax(me);

var v_highest = 0;
var v_lowest = 0;
var v_coll_size = 0;

v_highest = max(my.max_x, v_highest);
v_highest = max(my.max_y, v_highest);
v_lowest = min(my.min_x, v_lowest);
v_lowest = min(my.min_y, v_lowest);

v_coll_size = max(v_highest, v_coll_size);
v_coll_size = max(-v_lowest, v_coll_size);

vec_set(my.min_x, vector(-v_coll_size, -v_coll_size, my.min_z));
vec_set(my.max_x, vector(v_coll_size, v_coll_size, my.max_z));

return;
}


Posted By: molotov

Re: bounding box resizing? - 05/27/07 13:07

Maybe this works,

vec_for_min(my.min_x, my);
vec_for_max(my.max_x, my);

Have a nice day, Molotov.
Posted By: JazzDude

Re: bounding box resizing? - 05/28/07 02:27

Get the size you want--
head to foot, side to side,
in MED

Then use this code in the model's action:
Code:

vec_set(my.min_x, vector (-22,-22,-35)); //x,y,z minimums
vec_set(my.max_x, vector(44,44,35)); //x,y,z maximums
my.narrow = on;
my.fat = on;



According to the manual my.narrow and my.fat have to be there.
Posted By: Impaler

Re: bounding box resizing? - 05/28/07 11:40

Well I tried a combination of those and It's working! . I think the key was the my.narrow = on; my.fat = on;. Thanks for that tip, JazzDude!
© 2024 lite-C Forums