|
bounding box resizing?
#132304
05/27/07 11:48
05/27/07 11:48
|
Joined: Aug 2006
Posts: 128 Papua New Guinea
Impaler
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 128
Papua New Guinea
|
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?
Murphey's Law: << if anything can go wrong, it will >> (Murphey was an optimist).
|
|
|
Re: bounding box resizing?
[Re: Impaler]
#132305
05/27/07 12:31
05/27/07 12:31
|
Joined: Aug 2005
Posts: 343 Germany
HPW
Senior Member
|
Senior Member
Joined: Aug 2005
Posts: 343
Germany
|
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; }
Evil Blood (v. 0.52) RPG Commport.de (Social Network Community)
|
|
|
Re: bounding box resizing?
[Re: molotov]
#132307
05/28/07 02:27
05/28/07 02:27
|
Joined: Sep 2003
Posts: 733 Whitefish, Montana
JazzDude
User
|
User
Joined: Sep 2003
Posts: 733
Whitefish, Montana
|
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.
|
|
|
Re: bounding box resizing?
[Re: JazzDude]
#132308
05/28/07 11:40
05/28/07 11:40
|
Joined: Aug 2006
Posts: 128 Papua New Guinea
Impaler
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 128
Papua New Guinea
|
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!
Murphey's Law: << if anything can go wrong, it will >> (Murphey was an optimist).
|
|
|
|