Information about where a ray hits the surface.
More...
|
#define | HIT_NULL ((struct hit *)0) |
|
#define | RT_CK_HIT(_p) BU_CKMAG(_p, RT_HIT_MAGIC, "struct hit") |
|
#define | RT_HIT_INIT_ZERO { RT_HIT_MAGIC, 0.0, VINIT_ZERO, VINIT_ZERO, VINIT_ZERO, NULL, 0, NULL } |
|
#define | RT_HIT_NORMAL(_normal, _hitp, _stp, _unused, _flipflag) |
|
#define | CURVE_NULL ((struct curvature *)0) |
|
#define | RT_CURVATURE_INIT_ZERO { VINIT_ZERO, 0.0, 0.0 } |
|
#define | RT_CURVATURE(_curvp, _hitp, _flipflag, _stp) |
|
#define | RT_HIT_UVCOORD(ap, _stp, _hitp, uvp) |
|
Information about where a ray hits the surface.
The hit structure contains information about an individual boundary/ray intersection.
This is the lowest level of intersection information returned by LIBRT's intersection logic. Generally, multiple hits are used by higher level routines to construct segments (per shape) and partitions (boolean evaluations of multiple segments which constitute the actual portion of the ray deemed to have passed through solid geometry.)
◆ HIT_NULL
#define HIT_NULL ((struct hit *)0) |
Definition at line 71 of file hit.h.
◆ RT_CK_HIT
Definition at line 72 of file hit.h.
◆ RT_HIT_INIT_ZERO
Definition at line 73 of file hit.h.
◆ RT_HIT_NORMAL
#define RT_HIT_NORMAL |
( |
|
_normal, |
|
|
|
_hitp, |
|
|
|
_stp, |
|
|
|
_unused, |
|
|
|
_flipflag |
|
) |
| |
Value: { \
RT_CK_HIT(_hitp); \
RT_CK_SOLTAB(_stp); \
RT_CK_FUNCTAB((_stp)->st_meth); \
{ \
void *_n = (void *)_normal; \
if ((_stp)->st_meth->ft_norm) { \
(_stp)->st_meth->ft_norm(_hitp, _stp, (_hitp)->hit_rayp); \
} \
if (_n != NULL) { \
int _f = (int)_flipflag; \
if (_f) { \
VREVERSE((
fastf_t *)_normal, (_hitp)->hit_normal); \
} else { \
VMOVE((
fastf_t *)_normal, (_hitp)->hit_normal); \
} \
} \
} \
}
double fastf_t
fastest 64-bit (or larger) floating point type
Compute normal into (_hitp)->hit_normal.
Set flip-flag accordingly depending on boolean logic, as one hit may be shared between multiple partitions with different flip status.
Example: box.r = box.s - sph.s; sph.r = sph.s
Return the post-boolean normal into caller-provided _normal vector.
Definition at line 86 of file hit.h.
◆ CURVE_NULL
◆ RT_CURVATURE_INIT_ZERO
#define RT_CURVATURE_INIT_ZERO { VINIT_ZERO, 0.0, 0.0 } |
◆ RT_CURVATURE
#define RT_CURVATURE |
( |
|
_curvp, |
|
|
|
_hitp, |
|
|
|
_flipflag, |
|
|
|
_stp |
|
) |
| |
Value: { \
RT_CK_HIT(_hitp); \
RT_CK_SOLTAB(_stp); \
RT_CK_FUNCTAB((_stp)->st_meth); \
if ((_stp)->st_meth->ft_curve) { \
(_stp)->st_meth->ft_curve(_curvp, _hitp, _stp); \
} \
if (_flipflag) { \
(_curvp)->crv_c1 = - (_curvp)->crv_c1; \
(_curvp)->crv_c2 = - (_curvp)->crv_c2; \
} \
}
Use this macro after having computed the normal, to compute the curvature at a hit point.
In Release 4.4 and earlier, this was called RT_CURVE(). When the extra argument was added the name was changed.
Definition at line 133 of file hit.h.
◆ RT_HIT_UVCOORD
#define RT_HIT_UVCOORD |
( |
|
ap, |
|
|
|
_stp, |
|
|
|
_hitp, |
|
|
|
uvp |
|
) |
| |
Value: { \
RT_CK_HIT(_hitp); \
RT_CK_SOLTAB(_stp); \
RT_CK_FUNCTAB((_stp)->st_meth); \
if ((_stp)->st_meth->ft_uv) { \
(_stp)->st_meth->ft_uv(ap, _stp, _hitp, uvp); \
} \
}
Definition at line 158 of file hit.h.
◆ rt_pr_hit()
void rt_pr_hit |
( |
const char * |
str, |
|
|
const struct hit * |
hitp |
|
) |
| |
◆ rt_pr_hit_vls()
void rt_pr_hit_vls |
( |
struct bu_vls * |
v, |
|
|
const char * |
str, |
|
|
const struct hit * |
hitp |
|
) |
| |
◆ rt_pr_hitarray_vls()
void rt_pr_hitarray_vls |
( |
struct bu_vls * |
v, |
|
|
const char * |
str, |
|
|
const struct hit * |
hitp, |
|
|
int |
count |
|
) |
| |