14 const Vector2i& sign = prec.
sign;
17 t1 = std::min( (box[sign.x].x - rayOrigin.
x) * prec.
invDir.x, t1 );
18 t0 = std::max( (box[1 - sign.x].x - rayOrigin.
x) * prec.
invDir.x, t0 );
21 t1 = std::min( (box[sign.y].y - rayOrigin.
y) * prec.
invDir.y, t1 );
22 t0 = std::max( (box[1 - sign.y].y - rayOrigin.
y) * prec.
invDir.y, t0 );
27template <
typename T =
float>
bool rayBoxIntersect(const Box3< T > &box, const RayOrigin< T > &rayOrigin, T &t0, T &t1, const IntersectionPrecomputes< T > &prec)
Definition MRRayBoxIntersection.h:36
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRIntersectionPrecomputes2.h:35
Vector2i sign
stores signs of direction vector;
Definition MRIntersectionPrecomputes2.h:44
Vector2< T > invDir
{1 / dir}
Definition MRIntersectionPrecomputes2.h:37
Definition MRVector2.h:29
T x
Definition MRVector2.h:35
T y
Definition MRVector2.h:35