Jet  v1.3.3
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
jet::Box2 Class Referencefinal

2-D box geometry. More...

#include <jet/box2.h>

Inheritance diagram for jet::Box2:
jet::Surface2

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...
 
- Public Member Functions inherited from jet::Surface2
 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...
 
- Public Attributes inherited from jet::Surface2
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...
 
- Protected Member Functions inherited from jet::Surface2
virtual double closestDistanceLocal (const Vector2D &otherPoint) const
 
virtual bool isInsideLocal (const Vector2D &otherPoint) const
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Box2() [1/4]

jet::Box2::Box2 ( const Transform2 transform = Transform2(),
bool  isNormalFlipped = false 
)

Constructs (0, 0) x (1, 1) box.

◆ Box2() [2/4]

jet::Box2::Box2 ( const Vector2D lowerCorner,
const Vector2D upperCorner,
const Transform2 transform = Transform2(),
bool  isNormalFlipped = false 
)

Constructs a box with given lowerCorner and upperCorner.

◆ Box2() [3/4]

jet::Box2::Box2 ( const BoundingBox2D boundingBox,
const Transform2 transform = Transform2(),
bool  isNormalFlipped = false 
)

Constructs a box with BoundingBox2D instance.

◆ Box2() [4/4]

jet::Box2::Box2 ( const Box2 other)

Copy constructor.

Member Function Documentation

◆ boundingBoxLocal()

BoundingBox2D jet::Box2::boundingBoxLocal ( ) const
overrideprotectedvirtual

Returns the bounding box of this surface object in local frame.

Implements jet::Surface2.

◆ builder()

static Builder jet::Box2::builder ( )
static

Returns builder fox Box2.

◆ closestIntersectionLocal()

SurfaceRayIntersection2 jet::Box2::closestIntersectionLocal ( const Ray2D ray) const
overrideprotectedvirtual

Returns the closest intersection point for given ray in local frame.

Implements jet::Surface2.

◆ closestNormalLocal()

Vector2D jet::Box2::closestNormalLocal ( const Vector2D otherPoint) const
overrideprotectedvirtual

Returns the normal to the closest point on the surface from the given point otherPoint in local frame.

Implements jet::Surface2.

◆ closestPointLocal()

Vector2D jet::Box2::closestPointLocal ( const Vector2D otherPoint) const
overrideprotectedvirtual

Returns the closest point from the given point otherPoint to the surface in local frame.

Implements jet::Surface2.

◆ intersectsLocal()

bool jet::Box2::intersectsLocal ( const Ray2D ray) const
overrideprotectedvirtual

Returns true if the given ray intersects with this surface object in local frame.

Reimplemented from jet::Surface2.

Member Data Documentation

◆ bound

BoundingBox2D jet::Box2::bound = BoundingBox2D(Vector2D(), Vector2D(1.0, 1.0))

Bounding box of this box.


The documentation for this class was generated from the following file: