2-D box geometry. More...

#include <Core/Geometry/Box2.h>

Inheritance diagram for CubbyFlow::Box2:
CubbyFlow::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 CubbyFlow::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
 Returns the closest point from the given point otherPoint to the surface. More...
 
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...
 

Static Public Member Functions

static Builder GetBuilder ()
 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 CubbyFlow::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 CubbyFlow::Surface2
virtual double ClosestDistanceLocal (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]

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

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

◆ Box2() [2/4]

CubbyFlow::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]

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

Constructs a box with BoundingBox2D instance.

◆ Box2() [4/4]

CubbyFlow::Box2::Box2 ( const Box2 other)

Copy constructor.

Member Function Documentation

◆ BoundingBoxLocal()

BoundingBox2D CubbyFlow::Box2::BoundingBoxLocal ( ) const
overrideprotectedvirtual

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

Implements CubbyFlow::Surface2.

◆ ClosestIntersectionLocal()

SurfaceRayIntersection2 CubbyFlow::Box2::ClosestIntersectionLocal ( const Ray2D ray) const
overrideprotectedvirtual

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

Implements CubbyFlow::Surface2.

◆ ClosestNormalLocal()

Vector2D CubbyFlow::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 CubbyFlow::Surface2.

◆ ClosestPointLocal()

Vector2D CubbyFlow::Box2::ClosestPointLocal ( const Vector2D otherPoint) const
overrideprotectedvirtual

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

Implements CubbyFlow::Surface2.

◆ GetBuilder()

static Builder CubbyFlow::Box2::GetBuilder ( )
static

Returns builder fox Box2.

◆ IntersectsLocal()

bool CubbyFlow::Box2::IntersectsLocal ( const Ray2D ray) const
overrideprotectedvirtual

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

Reimplemented from CubbyFlow::Surface2.

Member Data Documentation

◆ bound

BoundingBox2D CubbyFlow::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: