|
Momentum
A library for solving nonlinear optimization problems related to human body kinematics
|
Oriented plane used to classify support contacts and project support polygons. More...
#include <support_polygon.h>
Public Member Functions | |
| SupportPlaneT (const Vector3< T > &planeNormal=Vector3< T >::UnitY(), T planeOffset=T(0), const Vector3< T > &uAxisHint=Vector3< T >::UnitX()) | |
| Construct an oriented support plane and in-plane coordinate basis. | |
| Vector3< T > | origin () const |
| Return one world-space point on the plane, equal to normal * offset. | |
| T | signedDistance (const Vector3< T > &point) const |
| Return normal.dot(point) - offset; negative values are below/behind the plane. | |
| Vector3< T > | projectPoint (const Vector3< T > &point) const |
Return point projected orthogonally onto the plane. | |
| Vector2< T > | coordinates (const Vector3< T > &point) const |
Return 2D support-plane coordinates of point after projection. | |
| Vector3< T > | pointFromCoordinates (const Vector2< T > &point) const |
| Return the world-space point with the given 2D support-plane coordinates. | |
Public Attributes | |
| Vector3< T > | normal = Vector3<T>::UnitY() |
| Unit plane normal. Points on the non-penetrating side have non-negative signed distance. | |
| T | offset = T(0) |
| Plane offset in normal.dot(point) - offset = 0. | |
| Vector3< T > | uAxis = Vector3<T>::UnitX() |
| First unit in-plane basis axis used for 2D support-polygon coordinates. | |
| Vector3< T > | vAxis = Vector3<T>::UnitZ() |
| Second unit in-plane basis axis. Chosen to preserve the default Y-up world-XZ coordinates. | |
Oriented plane used to classify support contacts and project support polygons.
The default is Momentum's Y-up ground plane. Its in-plane basis intentionally preserves the existing world-XZ support-polygon coordinates: uAxis is +X and vAxis is +Z. That makes the default basis left-handed, so callers should treat (u, v) as projection coordinates, not as a right-handed frame. Points with signed distance <= the caller's margin are on the contact side of the plane.
Definition at line 25 of file support_polygon.h.
|
explicit |
Construct an oriented support plane and in-plane coordinate basis.
| planeNormal | Plane normal before normalization. |
| planeOffset | Plane offset matching planeNormal; normalized with the normal. |
| uAxisHint | Preferred first in-plane axis. If it is collinear with planeNormal, a stable perpendicular axis is chosen instead. |
Definition at line 69 of file support_polygon.cpp.
References momentum::Eps(), MT_THROW_IF, normal, offset, uAxis, and vAxis.
|
nodiscard |
Return 2D support-plane coordinates of point after projection.
Definition at line 108 of file support_polygon.cpp.
References origin(), projectPoint(), uAxis, and vAxis.
Referenced by momentum::computeSupportPolygonFromWorldPoints().
|
nodiscard |
Return one world-space point on the plane, equal to normal * offset.
Definition at line 93 of file support_polygon.cpp.
References normal, and offset.
Referenced by coordinates(), and pointFromCoordinates().
|
nodiscard |
Return the world-space point with the given 2D support-plane coordinates.
Definition at line 114 of file support_polygon.cpp.
|
nodiscard |
Return point projected orthogonally onto the plane.
Definition at line 103 of file support_polygon.cpp.
References normal, and signedDistance().
Referenced by coordinates().
|
nodiscard |
Return normal.dot(point) - offset; negative values are below/behind the plane.
Definition at line 98 of file support_polygon.cpp.
References normal, and offset.
Referenced by projectPoint().
| Vector3<T> momentum::SupportPlaneT< T >::normal = Vector3<T>::UnitY() |
Unit plane normal. Points on the non-penetrating side have non-negative signed distance.
Definition at line 27 of file support_polygon.h.
Referenced by origin(), projectPoint(), signedDistance(), and SupportPlaneT().
| T momentum::SupportPlaneT< T >::offset = T(0) |
Plane offset in normal.dot(point) - offset = 0.
Definition at line 30 of file support_polygon.h.
Referenced by origin(), signedDistance(), and SupportPlaneT().
| Vector3<T> momentum::SupportPlaneT< T >::uAxis = Vector3<T>::UnitX() |
First unit in-plane basis axis used for 2D support-polygon coordinates.
Definition at line 33 of file support_polygon.h.
Referenced by coordinates(), pointFromCoordinates(), and SupportPlaneT().
| Vector3<T> momentum::SupportPlaneT< T >::vAxis = Vector3<T>::UnitZ() |
Second unit in-plane basis axis. Chosen to preserve the default Y-up world-XZ coordinates.
Definition at line 36 of file support_polygon.h.
Referenced by coordinates(), pointFromCoordinates(), and SupportPlaneT().