#include <Frame.h>

Public Types | |
| typedef Vec< 3, SReal > | Vec3 |
| typedef helper::Quater< SReal > | Quat |
| typedef Mat< 3, 3, SReal > | Mat33 |
Public Member Functions | |
| Frame (const Vec3 &origin, const Mat33 &m) | |
| Define the local frame using origin and basis vectors. | |
| Frame (const Vec3 &origin, const Quat &orientation, const Vec3 &scale=Vec3(1, 1, 1)) | |
| Define the local frame using three transforms. | |
| Frame (const Vec3 &origin) | |
| Define the local frame without rotation. | |
| Frame () | |
| Default constructor set the transformation to identity. | |
| void | setTransform (const Vec3 &origin, const Quat &orientation, const Vec3 &scale) |
| Define the local frame using three transforms. | |
| void | clear () |
| Reset the transformation to identity. | |
| Vec3 & | getOrigin () |
| Origin of the local frame in the reference frame,. | |
| const Vec3 & | getOrigin () const |
| Origin of the local frame in the reference frame,. | |
| void | setOrigin (const Vec3 &origin) |
| Set the origin of the local frame in the reference frame,. | |
| Mat33 & | getBasis () |
| The columns represent the base vectors of the local frame wrt the reference frame. | |
| const Mat33 & | getBasis () const |
| The columns represent the base vectors of the local frame wrt the reference frame. | |
| void | setBasis (const Mat33 &m) |
| The columns represent the base vectors of the local frame wrt the reference frame. | |
| void | multRight (const Frame &c) |
| Apply a transformation defined in the child frame (mult. right). | |
| Frame | mult (const Frame &c) const |
| compute the product with another frame on the right | |
| void | writeOpenGlMatrix (float *m) const |
| Write the OpenGL transformation matrix to a float[16]. | |
| void | writeOpenGlMatrix (double *m) const |
| Write the OpenGL transformation matrix to a double[16]. | |
| template<class V > | |
| V | projectVector (const V &v) const |
| compute the projection of a vector from the local frame to the reference frame | |
| template<class V > | |
| V | projectPoint (const V &v) const |
| compute the projection of a point from the local frame to the reference frame | |
| Frame | inversed () const |
| Transformation from the reference frame to the local frame. | |
Static Public Member Functions | |
| static Frame | identity () |
| The identity transform. | |
Private Attributes | |
| Vec3 | origin_ |
| Mat33 | basis_ |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const Frame &c) |
The transformation is not necessarily rigid.
When defined using (origin, rotation, scale), the transfrom can be seen as three frame displacements starting from the reference frame: translation, then rotation along the new origin, then scale along the new axes. Conversely, the projection of a point from the local frame to the reference frame undergoes scaling, then rotation, then translation. Vectors do not undergo translation since they model directions or displacement.
The product F1F2 can be seen as a frame displacement F1 starting from the reference frame followed by a frame displacement F2 starting from the new frame. It is used in frame hierarchies to model the transfromation frome frame 2 wrt the reference frame.
Definition at line 48 of file Frame.h.
| typedef Mat<3,3,SReal> sofa::defaulttype::Frame::Mat33 |
| typedef Vec<3,SReal> sofa::defaulttype::Frame::Vec3 |
| sofa::defaulttype::Frame::Frame | ( | const Vec3 & | origin, | |
| const Quat & | orientation, | |||
| const Vec3 & | scale = Vec3(1,1,1) | |||
| ) |
Define the local frame using three transforms.
Definition at line 44 of file Frame.cpp.
References setTransform().
| sofa::defaulttype::Frame::Frame | ( | const Vec3 & | origin | ) |
| sofa::defaulttype::Frame::Frame | ( | ) |
Default constructor set the transformation to identity.
Definition at line 55 of file Frame.cpp.
References clear().
Referenced by inversed().
| void sofa::defaulttype::Frame::clear | ( | ) |
| const Frame::Mat33 & sofa::defaulttype::Frame::getBasis | ( | ) | const |
| Frame::Mat33 & sofa::defaulttype::Frame::getBasis | ( | ) |
The columns represent the base vectors of the local frame wrt the reference frame.
Definition at line 81 of file Frame.cpp.
References basis_.
Referenced by multRight(), and sofa::defaulttype::operator<<().
| const Frame::Vec3 & sofa::defaulttype::Frame::getOrigin | ( | ) | const |
| Frame::Vec3 & sofa::defaulttype::Frame::getOrigin | ( | ) |
Origin of the local frame in the reference frame,.
Definition at line 68 of file Frame.cpp.
References origin_.
Referenced by multRight(), and sofa::defaulttype::operator<<().
| Frame sofa::defaulttype::Frame::identity | ( | ) | [static] |
| Frame sofa::defaulttype::Frame::inversed | ( | ) | const |
compute the product with another frame on the right
Definition at line 122 of file Frame.cpp.
References multRight().
| void sofa::defaulttype::Frame::multRight | ( | const Frame & | c | ) |
Apply a transformation defined in the child frame (mult. right).
Definition at line 115 of file Frame.cpp.
References basis_, getBasis(), getOrigin(), and origin_.
Referenced by mult().
| V sofa::defaulttype::Frame::projectPoint | ( | const V & | v | ) | const [inline] |
compute the projection of a point from the local frame to the reference frame
Definition at line 122 of file Frame.h.
References origin_, and projectVector().
| V sofa::defaulttype::Frame::projectVector | ( | const V & | v | ) | const [inline] |
compute the projection of a vector from the local frame to the reference frame
Definition at line 111 of file Frame.h.
References basis_.
Referenced by projectPoint().
| void sofa::defaulttype::Frame::setBasis | ( | const Mat33 & | m | ) |
| void sofa::defaulttype::Frame::setOrigin | ( | const Vec3 & | origin | ) |
Set the origin of the local frame in the reference frame,.
Definition at line 76 of file Frame.cpp.
References origin_.
Referenced by setTransform().
| void sofa::defaulttype::Frame::setTransform | ( | const Vec3 & | origin, | |
| const Quat & | orientation, | |||
| const Vec3 & | scale | |||
| ) |
Define the local frame using three transforms.
Definition at line 94 of file Frame.cpp.
References basis_, setOrigin(), and sofa::helper::Quater< Real >::toMatrix().
Referenced by Frame().
| void sofa::defaulttype::Frame::writeOpenGlMatrix | ( | double * | m | ) | const |
| void sofa::defaulttype::Frame::writeOpenGlMatrix | ( | float * | m | ) | const |
Write the OpenGL transformation matrix to a float[16].
Write the OpenGL transformation matrix.
Definition at line 130 of file Frame.cpp.
References basis_, and origin_.
Referenced by sofa::simulation::VisualDrawVisitor::processNodeTopDown().
| std::ostream& operator<< | ( | std::ostream & | out, | |
| const Frame & | c | |||
| ) | [friend] |
Mat33 sofa::defaulttype::Frame::basis_ [private] |
Definition at line 56 of file Frame.h.
Referenced by clear(), Frame(), getBasis(), inversed(), multRight(), projectVector(), setBasis(), setTransform(), and writeOpenGlMatrix().
Vec3 sofa::defaulttype::Frame::origin_ [private] |
Definition at line 55 of file Frame.h.
Referenced by clear(), getOrigin(), inversed(), multRight(), projectPoint(), setOrigin(), and writeOpenGlMatrix().
1.5.7.1