bool
TestIntersection(float* matrix,int obj,vect3d pos,vect3d dir,float
max_dis,intersectionstruct* out)
Test a object with a liner.
matrix: The
matrix of object in world space
obj: The id
of input obj.
pos: the vector
position in world space.
dir: direction
of vector
max_dis: the
maximum distance where the intersection is valid. If it is 0, so all distance will
be valid.
intersectionstruct[out]: filled struct
material
- material_id of the face on the intersection
distance
- the intersection distance from the position of source ray
,face_u,face_v
- independent
u,v coordinates of face on the intersection
u1,v1,u2,v2
-textures u,v coordinates of
face on the intersection
Result:
Ture: If there was
a intersection.
False: If there was
not intersection.