11 const Vector2i& sign = prec.
sign;
14 t1 = std::min( (box[sign.x].x - rayOrigin.
x) * prec.
invDir.x, t1 );
15 t0 = std::max( (box[1 - sign.x].x - rayOrigin.
x) * prec.
invDir.x, t0 );
18 t1 = std::min( (box[sign.y].y - rayOrigin.
y) * prec.
invDir.y, t1 );
19 t0 = std::max( (box[1 - sign.y].y - rayOrigin.
y) * prec.
invDir.y, t0 );
24template <
typename T =
float>
bool rayBoxIntersect(const Box3< T > &box, const RayOrigin< T > &rayOrigin, T &t0, T &t1, const IntersectionPrecomputes< T > &prec)
Definition MRRayBoxIntersection.h:63
Definition MRCameraOrientationPlugin.h:8
Box given by its min- and max- corners.
Definition MRMesh/MRBox.h:25
Definition MRMesh/MRMeshFwd.h:508
Vector2i sign
stores signs of direction vector;
Definition MRIntersectionPrecomputes2.h:44
Vector2< T > invDir
Definition MRIntersectionPrecomputes2.h:37
Definition MRVector2.h:18
T x
Definition MRVector2.h:24
T y
Definition MRVector2.h:24