code cleanup: move doxy comments into the C files.
This commit is contained in:
@@ -95,12 +95,6 @@ int isect_line_sphere_v2(const float l1[2], const float l2[2], const float sp[2]
|
|||||||
int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[2], const float v4[2], float vi[2]);
|
int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[2], const float v4[2], float vi[2]);
|
||||||
int isect_seg_seg_v2(const float v1[2], const float v2[2], const float v3[2], const float v4[2]);
|
int isect_seg_seg_v2(const float v1[2], const float v2[2], const float v3[2], const float v4[2]);
|
||||||
|
|
||||||
/* Returns the number of point of interests
|
|
||||||
* 0 - lines are colinear
|
|
||||||
* 1 - lines are coplanar, i1 is set to intersection
|
|
||||||
* 2 - i1 and i2 are the nearest points on line 1 (v1, v2) and line 2 (v3, v4) respectively
|
|
||||||
* */
|
|
||||||
|
|
||||||
int isect_line_line_v3(const float v1[3], const float v2[3],
|
int isect_line_line_v3(const float v1[3], const float v2[3],
|
||||||
const float v3[3], const float v4[3],
|
const float v3[3], const float v4[3],
|
||||||
float i1[3], float i2[3]);
|
float i1[3], float i2[3]);
|
||||||
@@ -108,35 +102,13 @@ int isect_line_line_strict_v3(const float v1[3], const float v2[3],
|
|||||||
const float v3[3], const float v4[3],
|
const float v3[3], const float v4[3],
|
||||||
float vi[3], float *r_lambda);
|
float vi[3], float *r_lambda);
|
||||||
|
|
||||||
/* if clip is nonzero, will only return true if lambda is >= 0.0
|
|
||||||
* (i.e. intersection point is along positive d)*/
|
|
||||||
int isect_ray_plane_v3(const float p1[3], const float d[3],
|
int isect_ray_plane_v3(const float p1[3], const float d[3],
|
||||||
const float v0[3], const float v1[3], const float v2[3],
|
const float v0[3], const float v1[3], const float v2[3],
|
||||||
float *r_lambda, const int clip);
|
float *r_lambda, const int clip);
|
||||||
|
|
||||||
/**
|
|
||||||
* Intersect line/plane, optionally treat line as directional (like a ray) with the no_flip argument.
|
|
||||||
* \param out The intersection point.
|
|
||||||
* \param l1 The first point of the line.
|
|
||||||
* \param l2 The second point of the line.
|
|
||||||
* \param plane_co A point on the plane to intersect with.
|
|
||||||
* \param plane_no The direction of the plane (does not need to be normalized).
|
|
||||||
* \param no_flip When true, the intersection point will always be from l1 to l2, even if this is not on the plane.
|
|
||||||
*/
|
|
||||||
int isect_line_plane_v3(float out[3], const float l1[3], const float l2[3],
|
int isect_line_plane_v3(float out[3], const float l1[3], const float l2[3],
|
||||||
const float plane_co[3], const float plane_no[3], const short no_flip);
|
const float plane_co[3], const float plane_no[3], const short no_flip);
|
||||||
|
|
||||||
/**
|
|
||||||
* Intersect two planes, return a point on the intersection and a vector
|
|
||||||
* that runs on the direction of the intersection.
|
|
||||||
* Return error code is the same as 'isect_line_line_v3'.
|
|
||||||
* \param r_isect_co The resulting intersection point.
|
|
||||||
* \param r_isect_no The resulting vector of the intersection.
|
|
||||||
* \param plane_a_co The point on the first plane.
|
|
||||||
* \param plane_a_no The normal of the first plane.
|
|
||||||
* \param plane_b_co The point on the second plane.
|
|
||||||
* \param plane_b_no The normal of the second plane.
|
|
||||||
*/
|
|
||||||
void isect_plane_plane_v3(float r_isect_co[3], float r_isect_no[3],
|
void isect_plane_plane_v3(float r_isect_co[3], float r_isect_no[3],
|
||||||
const float plane_a_co[3], const float plane_a_no[3],
|
const float plane_a_co[3], const float plane_a_no[3],
|
||||||
const float plane_b_co[3], const float plane_b_no[3]);
|
const float plane_b_co[3], const float plane_b_no[3]);
|
||||||
|
@@ -560,7 +560,8 @@ int isect_line_sphere_v2(const float l1[2], const float l2[2],
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
|
* \return
|
||||||
* -1: collinear
|
* -1: collinear
|
||||||
* 1: intersection
|
* 1: intersection
|
||||||
*/
|
*/
|
||||||
@@ -758,6 +759,10 @@ int isect_ray_tri_v3(const float p1[3], const float d[3],
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* if clip is nonzero, will only return true if lambda is >= 0.0
|
||||||
|
* (i.e. intersection point is along positive d)
|
||||||
|
*/
|
||||||
int isect_ray_plane_v3(const float p1[3], const float d[3],
|
int isect_ray_plane_v3(const float p1[3], const float d[3],
|
||||||
const float v0[3], const float v1[3], const float v2[3],
|
const float v0[3], const float v1[3], const float v2[3],
|
||||||
float *r_lambda, const int clip)
|
float *r_lambda, const int clip)
|
||||||
@@ -876,6 +881,16 @@ int isect_ray_tri_threshold_v3(const float p1[3], const float d[3],
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Intersect line/plane, optionally treat line as directional (like a ray) with the no_flip argument.
|
||||||
|
*
|
||||||
|
* \param out The intersection point.
|
||||||
|
* \param l1 The first point of the line.
|
||||||
|
* \param l2 The second point of the line.
|
||||||
|
* \param plane_co A point on the plane to intersect with.
|
||||||
|
* \param plane_no The direction of the plane (does not need to be normalized).
|
||||||
|
* \param no_flip When true, the intersection point will always be from l1 to l2, even if this is not on the plane.
|
||||||
|
*/
|
||||||
int isect_line_plane_v3(float out[3],
|
int isect_line_plane_v3(float out[3],
|
||||||
const float l1[3], const float l2[3],
|
const float l1[3], const float l2[3],
|
||||||
const float plane_co[3], const float plane_no[3], const short no_flip)
|
const float plane_co[3], const float plane_no[3], const short no_flip)
|
||||||
@@ -921,7 +936,20 @@ int isect_line_plane_v3(float out[3],
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* note: return normal isn't unit length */
|
/**
|
||||||
|
* Intersect two planes, return a point on the intersection and a vector
|
||||||
|
* that runs on the direction of the intersection.
|
||||||
|
* Return error code is the same as 'isect_line_line_v3'.
|
||||||
|
*
|
||||||
|
* \param r_isect_co The resulting intersection point.
|
||||||
|
* \param r_isect_no The resulting vector of the intersection.
|
||||||
|
* \param plane_a_co The point on the first plane.
|
||||||
|
* \param plane_a_no The normal of the first plane.
|
||||||
|
* \param plane_b_co The point on the second plane.
|
||||||
|
* \param plane_b_no The normal of the second plane.
|
||||||
|
*
|
||||||
|
* \note return normal isn't unit length
|
||||||
|
*/
|
||||||
void isect_plane_plane_v3(float r_isect_co[3], float r_isect_no[3],
|
void isect_plane_plane_v3(float r_isect_co[3], float r_isect_no[3],
|
||||||
const float plane_a_co[3], const float plane_a_no[3],
|
const float plane_a_co[3], const float plane_a_no[3],
|
||||||
const float plane_b_co[3], const float plane_b_no[3])
|
const float plane_b_co[3], const float plane_b_no[3])
|
||||||
@@ -1206,11 +1234,12 @@ int isect_axial_line_tri_v3(const int axis, const float p1[3], const float p2[3]
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the number of point of interests
|
/**
|
||||||
|
* \return The number of point of interests
|
||||||
* 0 - lines are colinear
|
* 0 - lines are colinear
|
||||||
* 1 - lines are coplanar, i1 is set to intersection
|
* 1 - lines are coplanar, i1 is set to intersection
|
||||||
* 2 - i1 and i2 are the nearest points on line 1 (v1, v2) and line 2 (v3, v4) respectively
|
* 2 - i1 and i2 are the nearest points on line 1 (v1, v2) and line 2 (v3, v4) respectively
|
||||||
* */
|
*/
|
||||||
int isect_line_line_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3], float i1[3], float i2[3])
|
int isect_line_line_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3], float i1[3], float i2[3])
|
||||||
{
|
{
|
||||||
float a[3], b[3], c[3], ab[3], cb[3], dir1[3], dir2[3];
|
float a[3], b[3], c[3], ab[3], cb[3], dir1[3], dir2[3];
|
||||||
|
Reference in New Issue
Block a user