#include <RigidCoord.h>
Static Public Attributes | |
static constexpr sofa::Size | total_size = 3 |
Compile-time constant specifying the number of scalars within this vector (equivalent to the size() method) More... | |
static constexpr sofa::Size | spatial_dimensions = 2 |
Compile-time constant specifying the number of dimensions of space (NOT equivalent to total_size for rigids) More... | |
Public Member Functions | |
constexpr | RigidCoord (const Vec2 &posCenter, const Real &orient) |
constexpr | RigidCoord () |
constexpr void | clear () |
constexpr void | operator+= (const RigidDeriv< 2, real > &a) |
constexpr RigidCoord< 2, real > | operator+ (const RigidDeriv< 2, real > &a) const |
constexpr RigidCoord< 2, real > | operator- (const RigidCoord< 2, real > &a) const |
constexpr RigidCoord< 2, real > | operator+ (const RigidCoord< 2, real > &a) const |
constexpr RigidCoord< 2, real > | operator- () const |
constexpr void | operator+= (const RigidCoord< 2, real > &a) |
template<typename real2 > | |
constexpr void | operator*= (real2 a) |
template<typename real2 > | |
constexpr void | operator/= (real2 a) |
template<typename real2 > | |
constexpr RigidCoord< 2, real > | operator* (real2 a) const |
template<typename real2 > | |
constexpr RigidCoord< 2, real > | operator/ (real2 a) const |
constexpr Real | operator* (const RigidCoord< 2, real > &a) const |
dot product, mostly used to compute residuals as sqrt(x*x) More... | |
Real | norm2 () const |
Squared norm. More... | |
real | norm () const |
Euclidean norm. More... | |
constexpr Vec2 & | getCenter () |
constexpr Real & | getOrientation () |
constexpr const Vec2 & | getCenter () const |
constexpr const Real & | getOrientation () const |
Vec2 | rotate (const Vec2 &v) const |
Vec2 | inverseRotate (const Vec2 &v) const |
constexpr Vec2 | translate (const Vec2 &v) const |
constexpr RigidCoord< 2, real > | translate (const RigidCoord< 2, real > &c) const |
constexpr void | multRight (const RigidCoord< 2, real > &c) |
Apply a transformation with respect to itself. More... | |
constexpr Vec2 | mult (const Vec2 &v) const |
compute the product with another frame on the right More... | |
constexpr RigidCoord< 2, real > | mult (const RigidCoord< 2, real > &c) const |
compute the product with another frame on the right More... | |
template<class Mat > | |
void | writeRotationMatrix (Mat &m) const |
template<class Mat > | |
void | fromMatrix (const Mat &m) |
Set from the given matrix. More... | |
template<class Mat > | |
void | toMatrix (Mat &m) const |
Write to the given matrix. More... | |
constexpr void | writeOpenGlMatrix (float m[16]) const |
Write the OpenGL transformation matrix. More... | |
constexpr Vec2 | vectorToChild (const Vec2 &v) const |
compute the projection of a vector from the parent frame to the child More... | |
constexpr Vec2 | projectPoint (const Vec2 &v) const |
Apply the transform to a point, i.e. project a point from the child frame to the parent frame (translation and rotation) More... | |
constexpr Vec2 | projectVector (const Vec2 &v) const |
Apply the transform to a vector, i.e. project a vector from the child frame to the parent frame (rotation only, no translation added) More... | |
constexpr Vec2 | unprojectPoint (const Vec2 &v) const |
Apply the inverse transform to a point, i.e. project a point from the parent frame to the child frame (translation and rotation) More... | |
constexpr Vec2 | unprojectVector (const Vec2 &v) const |
Apply the inverse transform to a vector, i.e. project a vector from the parent frame to the child frame (rotation only, no translation) More... | |
constexpr Vec2 | pointToParent (const Vec2 &v) const |
obsolete. Use projectPoint. More... | |
constexpr Vec2 | pointToChild (const Vec2 &v) const |
obsolete. Use unprojectPoint. More... | |
constexpr real * | ptr () |
constexpr const real * | ptr () const |
constexpr real & | operator[] (Size i) |
Access to i-th element. More... | |
constexpr const real & | operator[] (Size i) const |
Const access to i-th element. More... | |
Tests operators | |
constexpr bool | operator== (const RigidCoord< 2, real > &b) const |
constexpr bool | operator!= (const RigidCoord< 2, real > &b) const |
Static Public Member Functions | |
static RigidCoord | rand (SReal a) |
Random rigid transform composed of 2 random translations and a random angle. More... | |
static constexpr RigidCoord< 2, real > | identity () |
template<typename V > | |
static constexpr HomogeneousVec | toHomogeneous (V v, real r=1.) |
create a homogeneous vector from a 2d vector More... | |
template<typename V > | |
static constexpr Vec2 | fromHomogeneous (V v) |
create a 2d vector from a homogeneous vector More... | |
static constexpr Size | max_size () |
static constexpr Size | size () |
Friends | |
std::ostream & | operator<< (std::ostream &out, const RigidCoord< 2, real > &v) |
write to an output stream More... | |
std::istream & | operator>> (std::istream &in, RigidCoord< 2, real > &v) |
read from an input stream More... | |
|
staticconstexpr |
Compile-time constant specifying the number of dimensions of space (NOT equivalent to total_size for rigids)
|
staticconstexpr |
Compile-time constant specifying the number of scalars within this vector (equivalent to the size() method)
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlinestaticconstexpr |
create a 2d vector from a homogeneous vector
|
inline |
Set from the given matrix.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlinestaticconstexpr |
|
inline |
|
inlinestaticconstexpr |
|
inlineconstexpr |
compute the product with another frame on the right
|
inlineconstexpr |
compute the product with another frame on the right
|
inlineconstexpr |
Apply a transformation with respect to itself.
|
inline |
Euclidean norm.
|
inline |
Squared norm.
|
inlineconstexpr |
|
inlineconstexpr |
dot product, mostly used to compute residuals as sqrt(x*x)
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Access to i-th element.
|
inlineconstexpr |
Const access to i-th element.
|
inlineconstexpr |
obsolete. Use unprojectPoint.
|
inlineconstexpr |
obsolete. Use projectPoint.
|
inlineconstexpr |
Apply the transform to a point, i.e. project a point from the child frame to the parent frame (translation and rotation)
|
inlineconstexpr |
Apply the transform to a vector, i.e. project a vector from the child frame to the parent frame (rotation only, no translation added)
|
inlineconstexpr |
|
inlineconstexpr |
|
inlinestatic |
Random rigid transform composed of 2 random translations and a random angle.
a | Range of each random value: (-a,+a) |
|
inline |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
create a homogeneous vector from a 2d vector
|
inline |
Write to the given matrix.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Apply the inverse transform to a point, i.e. project a point from the parent frame to the child frame (translation and rotation)
|
inlineconstexpr |
Apply the inverse transform to a vector, i.e. project a vector from the parent frame to the child frame (rotation only, no translation)
|
inlineconstexpr |
compute the projection of a vector from the parent frame to the child
|
inlineconstexpr |
Write the OpenGL transformation matrix.
|
inline |
|
friend |
write to an output stream
|
friend |
read from an input stream