Loading...
Searching...
No Matches
CommonMath::RectPrism Class Reference

A rectangular prism. More...

#include </home/thodoris/src/ompl/demos/multicopter/CommonMath/RectPrism.h>

Inheritance diagram for CommonMath::RectPrism:

Public Member Functions

 RectPrism (Vec3 center, Vec3 sideLengths)
 Constructor.
Boundary GetTangentPlane (Vec3 const testPoint)
 Finds a separating plane between the prism and given point.
bool IsPointInside (Vec3 const testPoint)
 Check whether a given point is inside or on the boundary of the prism.
Vec3 GetRandomPositionInside (std::default_random_engine randomGen)
void SetCenterPoint (Vec3 center)
 Sets the location of the center of the prism in global coordinates.
void SetSideLengths (Vec3 sideLen)
 Sets the side lengths of the prism.

Detailed Description

A rectangular prism.

The rectangular prism is defined by the location of the center of the object, three side lengths, and a rotation between the the global coordinate frame and a coordinate frame aligned with the edges of the rectangular prism.

Definition at line 33 of file RectPrism.h.

Constructor & Destructor Documentation

◆ RectPrism()

CommonMath::RectPrism::RectPrism ( Vec3 center,
Vec3 sideLengths )
inline

Constructor.

Creates the rectangular prism. The local coordinate frame is defined such that it aligns with the edges of the prism (i.e. the x-axis of the local coordinate frame is parallel to the edge defined by sideLengths.x, the y-axis is parallel to the edge defined by sideLengths.y, and the z-axis is parallel to the edge defined by sideLengths.z).

Parameters
centerThe center of the prism written in the global coordinate frame
sideLengthsThe length of each side of the prism
rotationThe rotation between the local coordinate frame and global coordinate frame

Definition at line 47 of file RectPrism.h.

Member Function Documentation

◆ GetRandomPositionInside()

Vec3 CommonMath::RectPrism::GetRandomPositionInside ( std::default_random_engine randomGen)
inlinevirtual

Implements CommonMath::ConvexObj.

Definition at line 107 of file RectPrism.h.

◆ GetTangentPlane()

Boundary CommonMath::RectPrism::GetTangentPlane ( Vec3 const testPoint)
inlinevirtual

Finds a separating plane between the prism and given point.

The resulting Boundary struct is defined by the point on the boundary of the rectangular prism closest to testPoint and a unit normal pointing from this point to testPoint.

Parameters
testPointThe coordinates of any point outside of the prism
Returns
A Boundary struct defining a point on the boundary of the prism and a unit vector normal to the separating plane pointing away from the prism

Implements CommonMath::ConvexObj.

Definition at line 63 of file RectPrism.h.

◆ IsPointInside()

bool CommonMath::RectPrism::IsPointInside ( Vec3 const testPoint)
inlinevirtual

Check whether a given point is inside or on the boundary of the prism.

Parameters
testPointThe coordinates of any point
Returns
true if testPoint is inside or on the boundary of the prism, false otherwise

Implements CommonMath::ConvexObj.

Definition at line 97 of file RectPrism.h.

◆ SetCenterPoint()

void CommonMath::RectPrism::SetCenterPoint ( Vec3 center)
inline

Sets the location of the center of the prism in global coordinates.

Definition at line 118 of file RectPrism.h.

◆ SetSideLengths()

void CommonMath::RectPrism::SetSideLengths ( Vec3 sideLen)
inline

Sets the side lengths of the prism.

Definition at line 123 of file RectPrism.h.


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