get_hitvertex

Posted By: flits

get_hitvertex - 08/05/07 19:51

hallo i have a problem white this code

it trace but i dont get the vertex
fisrt time i try this function because i am going to use thise white vec_to_mesh so i realy need that vertex_search
i tried to set vec_set and more but getvertex stays -1 watever i tryed
sombody a idee thx

var getvertex;

while(1)
{
c_trace(my.x,vector(my.x,my.y,my.z-100),use_box && get_hitvertex);
getvertex = hitvertex;
wait(1);
}
Posted By: Ahriman

Re: get_hitvertex - 08/05/07 20:18

Try using Ignore_me in the trace, it is possible depending on the models center that you are tracing the wrong model. Also you are using use_box...from the manual:

GET_HITVERTEX When a model is hit, the number of the hit vertex will be returned in the hitvertex variable. Mutually exclusive with USE_AABB.

var getvertex;

while(1)
{
c_trace(my.x,vector(my.x,my.y,my.z-100), ignore_me|use_aabb|get_hitvertex );
getvertex = hitvertex;
wait(1);
}
Posted By: flits

Re: get_hitvertex - 08/05/07 20:24

thx but it didnt work it stays -1


more infi from manaul >><<

c_trace(VECTOR* from, VECTOR* to, var mode)
Sends a ray from the from position to the to position and checks whether this ray hits an obstacle on its way. This is the general instruction that is used by entities to detect their environment.
Parameters:
from Start position vector
to Target position vector
mode Tracing mode, see below

The following mode flags can be combined:
GET_HITVERTEX When a model is hit, the number of the hit vertex will be returned in the hitvertex variable. Mutually exclusive with USE_AABB.

Modifies:
hitvertex The hit object's closest vertex number, when mode is set to GET_HITVERTEX.
Posted By: fogman

Re: get_hitvertex - 08/05/07 20:38

Quote:

Mutually exclusive with USE_AABB




Doesn´t that mean that use_aabb doesn´t work together with get_hitvertex?
What happens if you delete "use_aabb"?
Posted By: flits

Re: get_hitvertex - 08/05/07 20:45

thx i tried somthing else

from

c_trace(my.x,vector(my.x,my.y,my.z-100),use_box && get_hitvertex);
to
c_trace(my.x,vector(my.x,my.y,(my.z-100)),ignore_me | get_hitvertex);

now it works
i think its the use_box
it wasnt ignore_me
thx all
© 2024 lite-C Forums