A rectangular prism. More...
#include </home/thodoris/src/ompl/demos/multicopter/CommonMath/RectPrism.h>

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()
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
-
center The center of the prism written in the global coordinate frame sideLengths The length of each side of the prism rotation The rotation between the local coordinate frame and global coordinate frame
Definition at line 47 of file RectPrism.h.
Member Function Documentation
◆ GetRandomPositionInside()
|
inlinevirtual |
Implements CommonMath::ConvexObj.
Definition at line 107 of file RectPrism.h.
◆ GetTangentPlane()
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
-
testPoint The 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()
|
inlinevirtual |
Check whether a given point is inside or on the boundary of the prism.
- Parameters
-
testPoint The 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()
|
inline |
Sets the location of the center of the prism in global coordinates.
Definition at line 118 of file RectPrism.h.
◆ SetSideLengths()
|
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:
- demos/multicopter/CommonMath/RectPrism.h