strange collision box

Posted By: Vyshess

strange collision box - 11/21/10 15:41

I need a collission box for my player-model that has the width and height of this model. So i was using
Code:
c_setminmax(my);

. But that creates a hugh box. there is enough room for two player-models...

I didn`t scaled the model. So, why this strange collision box??

thx for help!
Posted By: 3run

Re: strange collision box - 11/21/10 15:54

'c_setminmax(ENTITY*)' sets BBOX depending on all animation frames, so if BBOX is huge big, that means that in some of the animation frames, model moves far from it's origin.
So here you need to set custom BBOX. Or (if you don't use them) find animation frames that moves too far from the model's origin, and delete them. But I prefer the first solution.
Here is the example:
Code:
my.eflags |= FAT | NARROW; // set both flags 
wait(1); // wait one frame
vec_set(my.min_x,vector(-50,-50,-50)); // set bounding box to individual values
vec_set(my.max_x,vector(50,50,50));

Call this before the while loop. Good luck.
Posted By: Vyshess

Re: strange collision box - 11/21/10 16:04

hmmm...there is no animation frame that would make the box so big... anyway, your first solution fixed my problem. thx 3run!
Posted By: 3run

Re: strange collision box - 11/21/10 17:40

You are welcome bro laugh
Posted By: Vyshess

Re: strange collision box - 11/21/10 22:22

oh i forgot something strange.
if i change the last value (the red one)-> "vec_set(my.min_x,vector(-50,-50,-50));" to -1 or lower, suddenly the player appears at the top of my testroom and falls down to his position that i set in the WED..but why?
Posted By: 3run

Re: strange collision box - 11/22/10 07:05

You aren't lowering it, you are increasing it.
You need to keep all that values beyond the -1. Other ways it'll be bugy.
© 2024 lite-C Forums