Quick Question: Tracing and stuff

Posted By: Bright

Quick Question: Tracing and stuff - 08/06/07 20:52

Hey guys,
I'm a bit confused about something and I was just wondering how I'd make this code scan in front of the object instead of downwards:
Code:
 
// detect walls infront of the user
function proj_scanfront(scandist)
{
// scan and store data into a local
var scanstore;
c_trace(my.x, vector(my.x, my.y, my.z + scandist), ignore_me + ignore_passable + scan_texture);

// reposition at the target
vec_set(scanstore, target);
vec_set(my.x, scanstore.x);
}



Its suppost to be for a player shooting a weapon.
Thanks for your interest and I hope to hear from you soon

-Bright
Posted By: vlau

Re: Quick Question: Tracing and stuff - 08/07/07 05:13

Code:

function proj_scanfront(scandist)
{
vec_set(temp,vector(scandist,0,0));
vec_rotate(temp,my.pan);
vec_add(temp,my.x);

c_trace(my.x, temp, ignore_me + ignore_passable + scan_texture);

// reposition at the target
vec_set(scanstore, target);
vec_set(my.x, scanstore.x);
}


Posted By: Bright

Re: Quick Question: Tracing and stuff - 08/08/07 03:41

Sweet as thanks man
*rates*
© 2024 lite-C Forums