|
Core 1.0
|
A transformation defined as the composition of a rotation, a translation and a scale. More...
#include <frame.h>
Public Member Functions | |
| FrameScaled (const Matrix &=Matrix::Identity, const Vector &=Vector::Null, const Vector &=Vector(1.0)) | |
| Creates a frame. | |
| FrameScaled (const Vector &, const Vector &) | |
| Creates a frame given the translation and scaling vectors. | |
| FrameScaled (const Vector &, const double &=1.0) | |
| Creates a frame given the translation and scale. | |
| FrameScaled (const Frame &, const Vector &=Vector(1.0)) | |
| Creates a frame. | |
| FrameScaled (const Frame2 &, const Vector &=Vector(1.0)) | |
| Creates a frame. | |
| ~FrameScaled () | |
| Empty. | |
| Matrix | R () const |
| Returns the rotation matrix of the frame. | |
| Vector | T () const |
| Returns the translation vector of the frame. | |
| Vector | S () const |
| Get scaling vector from transformation. | |
| void | Rotate (const Vector &) |
| Rotate the shape. | |
| void | ObjectRotate (const Vector &) |
| Rotate the shape in object coordinates (does not modify the translation vector). | |
| void | Scale (const Vector &) |
| Scale the shape. | |
| void | Scale (const double &) |
| Scale the shape. | |
| void | Translate (const Vector &) |
| Translate the shape. | |
| FrameScaled | Inverse () const |
| Compute and return the inverse transformation. | |
| Matrix4 | GetMatrix4 () const |
| Get the homogeneous matrix out of the frame. | |
| Vector | Transform (const Vector &) const |
| Transforms a given input point. | |
| Vector | InverseTransform (const Vector &) const |
| Inverse transformation of a given input point. | |
| Vector | TransformDirection (const Vector &) const |
| Transforms a given input normal. | |
| Vector | InverseTransformDirection (const Vector &) const |
| Transforms a given input normal. | |
| void | Compose (const FrameScaled &) |
| Compose two frames. | |
| FrameScaled | Composed (const FrameScaled &) const |
| Compose two frames. | |
| void | Lerp (const FrameScaled &, const FrameScaled &, const double &) |
| Linear interpolation of two frames. | |
Static Public Member Functions | |
| static FrameScaled | Translation (const Vector &) |
| Creates a translation transformation. | |
| static FrameScaled | Rotation (const Vector &) |
| Creates a rotation frame. | |
| static FrameScaled | Rotation (const Vector &, const double &) |
| Create a rotation frame about an arbitrary axis. | |
| static FrameScaled | Rotation (const Vector &, const Vector &) |
| Create a frame that rotates a normalized vector into another one. | |
| static FrameScaled | Scaling (const Vector &) |
| Create a scaling frame. | |
| static FrameScaled | Scaling (const double &) |
| Create a uniform scaling frame. | |
Static Public Attributes | |
| static const FrameScaled | Id |
| Identity. | |
Protected Attributes | |
| Vector | s |
| Scaling vector. | |
| Protected Attributes inherited from Frame | |
| Matrix | r = Matrix::Identity |
| Rotation matrix. | |
| Vector | t = Vector::Null |
| Translation vector. | |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const FrameScaled &frame) |
| Overloaded. | |
Additional Inherited Members | |
| Protected Member Functions inherited from Frame | |
| Frame (const Matrix &=Matrix::Identity, const Vector &=Vector::Null) | |
| Creates a frame given a rotation matrix and a translation vector. | |
| Frame (const Vector &, const Vector &, const Vector &, const Vector &) | |
| Creates a frame given the origin and its orthogonal unit vectors. | |
| Frame (const Frame2 &) | |
| Creates a frame from another planar frame. | |
| ~Frame () | |
| Empty. | |
| Matrix | R () const |
| Returns the rotation matrix of the frame. | |
| Vector | T () const |
| Returns the translation vector of the frame. | |
| void | Compose (const Frame &) |
| Compose the frame with another one. | |
| Frame | Composed (const Frame &) const |
| Compose the frame with another one. | |
| Frame | Inverse () const |
| Compute the inverse transformation. | |
| Vector | Transform (const Vector &) const |
| Transform a point out of the frame coordinate system. | |
| Vector | InverseTransform (const Vector &) const |
| Transform a point into the frame coordinate system. | |
| Vector | TransformDirection (const Vector &) const |
| Transform a direction vector out of the frame coordinate system. | |
| Vector | InverseTransformDirection (const Vector &) const |
| Transform a direction vector into the frame coordinate system. | |
| Ray | Transform (const Ray &) const |
| Transform a ray out of the frame coordinate system. | |
| Ray | InverseTransform (const Ray &) const |
| Transform a ray into the frame coordinate system. | |
| Vector | CircleVertex (const double &, int=1, int=2) const |
| Compute the coordinates of a point on a circle inside the frame;. | |
| Vector | CircleNormal (const double &, int=1, int=2) const |
| Compute the coordinates of the normal a point on a circle inside the frame;. | |
| Vector | SphereVertex (const double &, const double &, const double &, int=1, int=2, int=0) const |
| Compute the coordinates of a point on a sphere inside the frame. | |
| Vector | SphereNormal (const double &, const double &, int=1, int=2, int=0) const |
| Compute the coordinates of the normal of a point on a sphere inside the frame. | |
| Static Protected Member Functions inherited from Frame | |
| static Frame | Translation (const Vector &) |
| Creates a translation transformation. | |
| static Frame | Rotation (const Vector &) |
| Creates a rotation frame. | |
| static Frame | Rotation (const Vector &, const double &) |
| Create a rotation frame about an arbitrary axis. | |
| static Frame | Rotation (const Vector &, const Vector &) |
| Create a frame that rotates a normalized vector into another one. | |
| static Frame | Canonical (const Vector &, const Vector &) |
| Given a point and a direction, compute the frame that brings these into a canonical coordinate system. | |
| static Frame | Orthonormal (const Vector &, const Vector &) |
| Compute a frame given an origin and direction vector. | |
| Static Protected Attributes inherited from Frame | |
| static const Frame | Id |
| Identity. | |
A transformation defined as the composition of a rotation, a translation and a scale.
The data-structure groups the rotation matrix, the translation and scaling vectors.
The orientation of the frame should be defined by the appropriate rotation matrix.
In general, a FrameScaled is defined by its rotation matrix, and a translation and scaling vector:
When there is no rotation, the rotation matrix can be defined using the identity matrix:
It is also possible and simpler to use:
|
explicit |
|
explicit |
Creates a frame.
| frame | The frame. |
| s | Scaling. |
Creates a frame.
| frame | The frame. |
| s | Scaling. |
| void FrameScaled::Compose | ( | const FrameScaled & | frame | ) |
Compose two frames.
| frame | The frame. |
| FrameScaled FrameScaled::Composed | ( | const FrameScaled & | frame | ) | const |
Compose two frames.
| frame | The frame. |
Inverse transformation of a given input point.
| p | Point. |
Transforms a given input normal.
| n | Normal vector. |
| void FrameScaled::Lerp | ( | const FrameScaled & | a, |
| const FrameScaled & | b, | ||
| const double & | alpha ) |
Linear interpolation of two frames.
| a,b | The two frames. |
| alpha | Interpolation parameter. |
| void FrameScaled::ObjectRotate | ( | const Vector & | r | ) |
Rotate the shape in object coordinates (does not modify the translation vector).
| r | Rotation vector representing the rotation angles around x, y and z axes. |
| void FrameScaled::Rotate | ( | const Vector & | r | ) |
Rotate the shape.
| r | Rotation vector representing the rotation angles around x, y and z axes. |
|
static |
Creates a rotation frame.
| a | A vector of angles (expressed in radians) that defines the rotation around x-y-z axes. |
|
static |
Create a rotation frame about an arbitrary axis.
| axis | Axis. |
| angle | Angle (should be in radian). |
|
static |
Create a frame that rotates a normalized vector into another one.
| a,b | Initial and final vectors (should be normalized). |
| void FrameScaled::Scale | ( | const double & | u | ) |
Scale the shape.
| u | Scaling factor. |
| void FrameScaled::Scale | ( | const Vector & | u | ) |
Scale the shape.
| u | Scaling vector. |
|
static |
Create a uniform scaling frame.
| s | Scaling. |
|
static |
Create a scaling frame.
| s | Scaling vector. |
Transforms a given input point.
| p | Point. |
Transforms a given input normal.
| n | Normal vector. |
| void FrameScaled::Translate | ( | const Vector & | t | ) |
Translate the shape.
| t | Translation vector. |
|
static |
Creates a translation transformation.
| t | Translation vector. |
|
friend |
Overloaded.
| s | Stream. |
| frame | The frame. |