Kaim::OrientedBox2d Class Reference

Kaim::OrientedBox2d Class Reference

#include <orientedbox2d.h>

Class Description

This class represents a three-dimensional bounding box with a free orientation on the (X,Y) plane.

It is defined by:

  • The position of a single reference corner (m_a).
  • An orientation vector that determines the facing direction of the box from the reference corner (m_normalizedOrientation).
  • A length value, which determines the extents of the box along its orientation vector (m_length).
  • A width value, which determines the extents of the box perpendicular to the orientation vector (m_width). The width of the box always extends to the left when facing the orientation.
  • A thickness value, which determines the extents of the box along the vertical Z axis (m_thickness).

    For example:

    ^ +--------------------+
    | | |
    |width | |
    | | |
    | | | orientation
    v A+--------------------+------------->
    <-------------------->
    length

Constructors

 OrientedBox2d ()
 
 OrientedBox2d (const Vec3f &a, const Vec2f &orientation, KyFloat32 length, KyFloat32 width, KyFloat32 thickness)
 

Main API Functions

bool IsValid ()
 
void Clear ()
 
void Set (const Vec3f &a, const Vec2f &orientation, KyFloat32 length, KyFloat32 width, KyFloat32 thickness)
 
void InitAs2dInflatedSegment (const Vec3f &start, const Vec3f &dest, KyFloat32 radius)
 
bool IsInside2d (const Vec3f &pos)
 

Public Data Members

Vec3f m_a
 
Vec2f m_normalizedOrientation
 
KyFloat32 m_length
 
KyFloat32 m_width
 
KyFloat32 m_thickness
 

Constructor & Destructor Documentation

Kaim::OrientedBox2d::OrientedBox2d ( )
inline

Creates a new OrientedBox2d with 0.0f length, width and thickness.

If you use this constructor, you must call Set() to set the dimensions of the rectangle before it can be used.

Kaim::OrientedBox2d::OrientedBox2d ( const Vec3f a,
const Vec2f orientation,
KyFloat32  length,
KyFloat32  width,
KyFloat32  thickness 
)
inline

Creates a new OrientedBox2d and initialize it accordingly to provided information.

Parameters
aThe position of the reference corner.
orientationThe facing orientation of the box.
lengthThe extents of the box along its orientation vector.
widthThe extents of the box perpendicular to its orientation vector on the (X,Y) plane.
thicknessThe extents of the box along the vertical Z axis.

Member Function Documentation

void Kaim::OrientedBox2d::InitAs2dInflatedSegment ( const Vec3f start,
const Vec3f dest,
KyFloat32  radius 
)
inline

Creates a new OrientedBox2d that will be an inflate of the segment going from start to dest of radius Object created using this constructor.

void Kaim::OrientedBox2d::Set ( const Vec3f a,
const Vec2f orientation,
KyFloat32  length,
KyFloat32  width,
KyFloat32  thickness 
)
inline

Sets the dimensions of the box.

Parameters
aThe position of the reference corner.
orientationThe facing orientation of the box.
lengthThe extents of the box along its orientation vector.
widthThe extents of the box perpendicular to its orientation vector on the (X,Y) plane.
thicknessThe extents of the box along the vertical Z axis.

Member Data Documentation

Vec3f Kaim::OrientedBox2d::m_a

The position of the reference corner.

KyFloat32 Kaim::OrientedBox2d::m_length

The extents of the box along its orientation vector.

Vec2f Kaim::OrientedBox2d::m_normalizedOrientation

The facing orientation of the box (unit vector).

KyFloat32 Kaim::OrientedBox2d::m_thickness

The extents of the box along the vertical Z axis.

KyFloat32 Kaim::OrientedBox2d::m_width

The extents of the box perpendicular to its orientation vector on the (X,Y) plane.


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