Jet
v1.3.3
|
2-D box geometry. More...
#include <jet/box2.h>
Classes | |
class | Builder |
Front-end to create Box2 objects step by step. More... | |
Public Member Functions | |
Box2 (const Transform2 &transform=Transform2(), bool isNormalFlipped=false) | |
Constructs (0, 0) x (1, 1) box. More... | |
Box2 (const Vector2D &lowerCorner, const Vector2D &upperCorner, const Transform2 &transform=Transform2(), bool isNormalFlipped=false) | |
Constructs a box with given lowerCorner and upperCorner . More... | |
Box2 (const BoundingBox2D &boundingBox, const Transform2 &transform=Transform2(), bool isNormalFlipped=false) | |
Constructs a box with BoundingBox2D instance. More... | |
Box2 (const Box2 &other) | |
Copy constructor. More... | |
![]() | |
Surface2 (const Transform2 &transform=Transform2(), bool isNormalFlipped=false) | |
Constructs a surface with normal direction. More... | |
Surface2 (const Surface2 &other) | |
Copy constructor. More... | |
virtual | ~Surface2 () |
Default destructor. More... | |
Vector2D | closestPoint (const Vector2D &otherPoint) const |
BoundingBox2D | boundingBox () const |
Returns the bounding box of this surface object. More... | |
bool | intersects (const Ray2D &ray) const |
Returns true if the given ray intersects with this surface object. More... | |
double | closestDistance (const Vector2D &otherPoint) const |
SurfaceRayIntersection2 | closestIntersection (const Ray2D &ray) const |
Returns the closest intersection point for given ray . More... | |
Vector2D | closestNormal (const Vector2D &otherPoint) const |
virtual void | updateQueryEngine () |
Updates internal spatial query engine. More... | |
virtual bool | isBounded () const |
Returns true if bounding box can be defined. More... | |
virtual bool | isValidGeometry () const |
Returns true if the surface is a valid geometry. More... | |
bool | isInside (const Vector2D &otherPoint) const |
Static Public Member Functions | |
static Builder | builder () |
Returns builder fox Box2. More... | |
Public Attributes | |
BoundingBox2D | bound = BoundingBox2D(Vector2D(), Vector2D(1.0, 1.0)) |
Bounding box of this box. More... | |
![]() | |
Transform2 | transform |
Local-to-world transform. More... | |
bool | isNormalFlipped = false |
Flips normal. More... | |
Protected Member Functions | |
Vector2D | closestPointLocal (const Vector2D &otherPoint) const override |
bool | intersectsLocal (const Ray2D &ray) const override |
BoundingBox2D | boundingBoxLocal () const override |
Returns the bounding box of this surface object in local frame. More... | |
Vector2D | closestNormalLocal (const Vector2D &otherPoint) const override |
SurfaceRayIntersection2 | closestIntersectionLocal (const Ray2D &ray) const override |
Returns the closest intersection point for given ray in local frame. More... | |
![]() | |
virtual double | closestDistanceLocal (const Vector2D &otherPoint) const |
virtual bool | isInsideLocal (const Vector2D &otherPoint) const |
2-D box geometry.
This class represents 2-D box geometry which extends Surface2 by overriding surface-related queries. This box implementation is an axis-aligned box that wraps lower-level primitive type, BoundingBox2D.
jet::Box2::Box2 | ( | const Transform2 & | transform = Transform2() , |
bool | isNormalFlipped = false |
||
) |
Constructs (0, 0) x (1, 1) box.
jet::Box2::Box2 | ( | const Vector2D & | lowerCorner, |
const Vector2D & | upperCorner, | ||
const Transform2 & | transform = Transform2() , |
||
bool | isNormalFlipped = false |
||
) |
Constructs a box with given lowerCorner
and upperCorner
.
jet::Box2::Box2 | ( | const BoundingBox2D & | boundingBox, |
const Transform2 & | transform = Transform2() , |
||
bool | isNormalFlipped = false |
||
) |
Constructs a box with BoundingBox2D instance.
jet::Box2::Box2 | ( | const Box2 & | other | ) |
Copy constructor.
|
overrideprotectedvirtual |
Returns the bounding box of this surface object in local frame.
Implements jet::Surface2.
|
overrideprotectedvirtual |
Returns the closest intersection point for given ray
in local frame.
Implements jet::Surface2.
|
overrideprotectedvirtual |
Returns the normal to the closest point on the surface from the given point otherPoint
in local frame.
Implements jet::Surface2.
Returns the closest point from the given point otherPoint
to the surface in local frame.
Implements jet::Surface2.
|
overrideprotectedvirtual |
Returns true if the given ray
intersects with this surface object in local frame.
Reimplemented from jet::Surface2.
BoundingBox2D jet::Box2::bound = BoundingBox2D(Vector2D(), Vector2D(1.0, 1.0)) |
Bounding box of this box.