c_trace ?

Posted By: Anonymous

c_trace ? - 04/15/08 01:21

how can I tell if a model was by a c_tarce on the front side or the back side??

Thanks,Malice
Posted By: Pappenheimer

Re: c_trace ? - 04/15/08 09:19

?

The traced entity should be set to 'you', then you can look for you.pan and compare it to the direction of the trace.

Is it that what you mean?
Posted By: Anonymous

Re: c_trace ? - 04/15/08 21:49

Yeah but I not sure how to compare it ..

if(you.pan==my.pan){
you hit no the back}
if(you.pan==my.pan+180){
you hit on the front}

something like that??
Posted By: Pappenheimer

Re: c_trace ? - 04/15/08 21:54

There is an example in the Movement & Interaction Tutorial in my signature: the three last exposed actions of the third level. (It was made with A5, but the main things didn't change much.)
Posted By: Anonymous

Re: c_trace ? - 04/15/08 22:23

thank you will look at I download it a few months ago and have use stuff from it before.. THanks for making in the first place.


Thanks,Malice
Posted By: flits

Re: c_trace ? - 04/16/08 08:23

i dont know if it works neve rtryed but this inside the manual

> 0 Distance to the hit polygon of the next obstacle.
0 No polygon was hit.
< 0 A polygon was hit from behind. The from position lies within a solid object, or the me entity intersects with a target entity.
Posted By: Anonymous

Re: c_trace ? - 04/16/08 14:19

that means result=c_trace(ect) the result = the distance trace but how doe that tell me if the fornt of the model was hit or the back? It would be nice if the bounding box had planes and each plane had a number that was returned to the trace.

if(trace_hit==1)
{
if(bbox_plane=1)
{
model hit on the front}
}


Do you think this is worth addingto the futrure forum??
Malcie
Posted By: Fenriswolf

Re: c_trace ? - 04/16/08 15:24

Hello,

basically you can do this with this code.

You just need to calculate the angle of your trace and compare it with the angle of the hit entity. If the absolute difference between the angles is greater than, lets say, 90, the entity was hit from behind.

So you would probably do it like that:
if (abs(ang(ang_to_target.pan - hit_entity.pan)) > 90 ) ...
Posted By: Anonymous

Re: c_trace ? - 04/16/08 16:23

THANK YOU!! This is want I was looking for. I don't have the math skill to have ever come up with this on my own.

Thanks,Malice
© 2023 lite-C Forums