c_trace question

Posted By: cjm

c_trace question - 02/21/09 21:21

I was using c_trace to enable walking on a floor and stair climbing, the code needed is around in a number of tutorials. Code of the form:

Quote:
vec_set (temp.x, my.x);
temp.z -= 10000;
temp.z -= 10000;temp.z = -c_trace (my.x, temp.x, IGNORE_ME | IGNORE_PASSABLE | USE_BOX);

However this made 'cbabe' walk with her feet and ankles in the floor!

The fix was an offset to allow for this, thanks George:

Quote:
temp.z = -c_trace (my.x, temp.x, IGNORE_ME | IGNORE_PASSABLE | USE_BOX) + 20; // play with 20

My question is why is this offset "now" necessary when old(ish)code doen't appear to need it/show it?

Why doesn't c_trace return the correct distance?

(My code is running on A7.70 Commercial)
Posted By: Max_Prower

Re: c_trace question - 03/01/09 13:54

For moving up stairs and slopes, I would reccomend using move_min_z. I have a question. What exactly does temp mean?
Posted By: cjm

Re: c_trace question - 03/02/09 15:25

'temp' is a temperary holding vector, it is just used to to hold the vector coordinates of 'my's' vector position 10000 quants down the z axis. Its used as the 'target' position for c_trace as it traces from 'my's' reference center downwards.
Posted By: croman

Re: c_trace question - 03/02/09 15:31

c_trace scans from objects origin and in your case origin is probably in center of model(torso) and not feet. i think that's why
© 2024 lite-C Forums