Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
momentum::SupportPlaneT< T > Struct Template Reference

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.

Detailed Description

template<typename T>
struct momentum::SupportPlaneT< T >

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.

Constructor & Destructor Documentation

◆ SupportPlaneT()

template<typename T>
momentum::SupportPlaneT< T >::SupportPlaneT ( const Vector3< T > & planeNormal = Vector3<T>::UnitY(),
T planeOffset = T(0),
const Vector3< T > & uAxisHint = Vector3<T>::UnitX() )
explicit

Construct an oriented support plane and in-plane coordinate basis.

Parameters
planeNormalPlane normal before normalization.
planeOffsetPlane offset matching planeNormal; normalized with the normal.
uAxisHintPreferred 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.

Member Function Documentation

◆ coordinates()

template<typename T>
Vector2< T > momentum::SupportPlaneT< T >::coordinates ( const Vector3< T > & point) const
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().

◆ origin()

template<typename T>
Vector3< T > momentum::SupportPlaneT< T >::origin ( ) const
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().

◆ pointFromCoordinates()

template<typename T>
Vector3< T > momentum::SupportPlaneT< T >::pointFromCoordinates ( const Vector2< T > & point) const
nodiscard

Return the world-space point with the given 2D support-plane coordinates.

Definition at line 114 of file support_polygon.cpp.

References origin(), uAxis, and vAxis.

◆ projectPoint()

template<typename T>
Vector3< T > momentum::SupportPlaneT< T >::projectPoint ( const Vector3< T > & point) const
nodiscard

Return point projected orthogonally onto the plane.

Definition at line 103 of file support_polygon.cpp.

References normal, and signedDistance().

Referenced by coordinates().

◆ signedDistance()

template<typename T>
T momentum::SupportPlaneT< T >::signedDistance ( const Vector3< T > & point) const
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().

Member Data Documentation

◆ normal

template<typename T>
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().

◆ offset

template<typename T>
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().

◆ uAxis

template<typename T>
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().

◆ vAxis

template<typename T>
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().


The documentation for this struct was generated from the following files: