frame.cpp
420 Vec trans = point + Quaternion(inverseTransformOf(rotation.axis()), rotation.angle()).rotate(position()-point) - t_;
825 void Frame::getCoordinatesOfFrom(const float src[3], float res[3], const Frame* const from) const
Vec transformOfIn(const Vec &src, const Frame *const in) const
Returns the in transform of the vector whose coordinates in the Frame coordinate system is src (conve...
Definition: frame.cpp:905
void setTranslationAndRotationWithConstraint(Vec &translation, Quaternion &rotation)
Same as setTranslationAndRotation(), but translation and orientation are modified to satisfy the cons...
Definition: frame.cpp:595
Definition: camera.h:29
virtual void initFromDOMElement(const QDomElement &element)
Restores the Frame state from a QDomElement created by domElement().
Definition: frame.cpp:1011
void getRotation(double &q0, double &q1, double &q2, double &q3) const
The q are set to the rotation() of the Frame.
Definition: frame.cpp:308
virtual QDomElement domElement(const QString &name, QDomDocument &document) const
Returns an XML QDomElement that represents the Frame.
Definition: frame.cpp:994
void getCoordinatesOfFrom(const float src[3], float res[3], const Frame *const from) const
Same as coordinatesOfFrom(), but with float parameters.
Definition: frame.cpp:825
Quaternion inverse() const
Returns the inverse Quaternion (inverse rotation).
Definition: quaternion.h:205
Vec localCoordinatesOf(const Vec &src) const
Returns the Frame coordinates of a point src defined in the referenceFrame() coordinate system (conve...
Definition: frame.cpp:731
void setPositionAndOrientation(const Vec &position, const Quaternion &orientation)
Same as successive calls to setPosition() and then setOrientation().
Definition: frame.cpp:462
void translate(Vec &t)
Same as translate(const Vec&) but t may be modified to satisfy the translation constraint().
Definition: frame.cpp:335
void getLocalCoordinatesOf(const float src[3], float res[3]) const
Same as localCoordinatesOf(), but with float parameters.
Definition: frame.cpp:801
void alignWithFrame(const Frame *const frame, bool move=false, float threshold=0.0f)
Aligns the Frame with frame, so that two of their axis are parallel.
Definition: frame.cpp:1055
void getCoordinatesOf(const float src[3], float res[3]) const
Same as coordinatesOf(), but with float parameters.
Definition: frame.cpp:785
void setOrientationWithConstraint(Quaternion &orientation)
Same as setOrientation(), but orientation is modified so that the potential constraint() of the Frame...
Definition: frame.cpp:631
bool settingAsReferenceFrameWillCreateALoop(const Frame *const frame)
Returns true if setting frame as the Frame's referenceFrame() would create a loop in the Frame hierar...
Definition: frame.cpp:680
void getLocalTransformOf(const float src[3], float res[3]) const
Same as localTransformOf(), but with float parameters.
Definition: frame.cpp:942
const GLdouble * matrix() const
Returns the 4x4 OpenGL transformation matrix represented by the Frame.
Definition: frame.cpp:123
void setTranslationWithConstraint(Vec &translation)
Same as setTranslation(), but translation is modified so that the potential constraint() of the Frame...
Definition: frame.cpp:565
void getCoordinatesOfIn(const float src[3], float res[3], const Frame *const in) const
Same as coordinatesOfIn(), but with float parameters.
Definition: frame.cpp:817
void rotateAroundPoint(Quaternion &rotation, const Vec &point)
Makes the Frame rotate() by rotation around point.
Definition: frame.cpp:414
FARSA_UTIL_TEMPLATE const T max(const T &t1, const U &t2)
void setPositionAndOrientationWithConstraint(Vec &position, Quaternion &orientation)
Same as setPositionAndOrientation() but position and orientation are modified to satisfy the constrai...
Definition: frame.cpp:641
void setRotationWithConstraint(Quaternion &rotation)
Same as setRotation(), but rotation is modified so that the potential constraint() of the Frame is sa...
Definition: frame.cpp:579
Vec translation() const
Returns the Frame translation, defined with respect to the referenceFrame().
Definition: frame.h:228
Vec coordinatesOf(const Vec &src) const
Returns the Frame coordinates of a point src defined in the world coordinate system (converts from wo...
Definition: frame.cpp:702
void getInverseTransformOf(const float src[3], float res[3]) const
Same as inverseTransformOf(), but with float parameters.
Definition: frame.cpp:934
void getPosition(float &x, float &y, float &z) const
x, y and z are set to the position() of the Frame.
Definition: frame.cpp:492
void setRotation(const Quaternion &rotation)
Set the current rotation Quaternion.
Definition: frame.h:215
void getOrientation(double &q0, double &q1, double &q2, double &q3) const
Get the current orientation of the frame (same as orientation()).
Definition: frame.cpp:526
void rotate(Quaternion &q)
Same as rotate(const Quaternion&) but q may be modified to satisfy the rotation constraint().
Definition: frame.cpp:376
void getInverseCoordinatesOf(const float src[3], float res[3]) const
Same as inverseCoordinatesOf(), but with float parameters.
Definition: frame.cpp:793
void getMatrix(GLdouble m[4][4]) const
Fills m with the OpenGL representation of the Quaternion rotation.
Definition: quaternion.cpp:317
void setTranslation(const Vec &translation)
Sets the translation() of the frame, locally defined with respect to the referenceFrame().
Definition: frame.h:201
Quaternion orientation() const
Returns the orientation of the Frame, defined in the world coordinate system.
Definition: frame.cpp:546
Vec inverseRotate(const Vec &v) const
Returns the image of v by the Quaternion inverse() rotation.
Definition: quaternion.cpp:68
void setPositionWithConstraint(Vec &position)
Same as setPosition(), but position is modified so that the potential constraint() of the Frame is sa...
Definition: frame.cpp:621
void getLocalInverseCoordinatesOf(const float src[3], float res[3]) const
Same as localInverseCoordinatesOf(), but with float parameters.
Definition: frame.cpp:809
void getLocalInverseTransformOf(const float src[3], float res[3]) const
Same as localInverseTransformOf(), but with float parameters.
Definition: frame.cpp:950
void projectOnLine(const Vec &origin, const Vec &direction)
Translates the Frame so that its position() lies on the line defined by origin and direction (defined...
Definition: frame.cpp:1133
double angle() const
Returns the angle (in radians) of the rotation represented by the Quaternion.
Definition: quaternion.cpp:234
Quaternion normalized() const
Returns a normalized version of the Quaternion.
Definition: quaternion.h:238
void getTransformOfFrom(const float src[3], float res[3], const Frame *const from) const
Same as transformOfFrom(), but with float parameters.
Definition: frame.cpp:966
Vec coordinatesOfIn(const Vec &src, const Frame *const in) const
Returns the in coordinates of the point whose position in the Frame coordinate system is src (convert...
Definition: frame.cpp:764
const GLdouble * worldMatrix() const
Returns the 4x4 OpenGL transformation matrix represented by the Frame.
Definition: frame.cpp:196
Vec localInverseTransformOf(const Vec &src) const
Returns the referenceFrame() transform of a vector src defined in the Frame coordinate system (conver...
Definition: frame.cpp:881
The Quaternion class represents 3D rotations and orientations.
Definition: quaternion.h:66
virtual void constrainRotation(Quaternion &rotation, Frame *const frame)
Filters the rotation applied to the frame.
Definition: constraint.h:142
const Frame * referenceFrame() const
Returns the reference Frame, in which coordinates system the Frame is defined.
Definition: frame.h:262
void setReferenceFrame(const Frame *const refFrame)
Sets the referenceFrame() of the Frame.
Definition: frame.cpp:665
Vec axis() const
Returns the normalized axis direction of the rotation represented by the Quaternion.
Definition: quaternion.cpp:219
void setPosition(const Vec &position)
Sets the position() of the Frame, defined in the world coordinate system.
Definition: frame.cpp:443
void setConstraint(Constraint *const constraint)
Sets the constraint() attached to the Frame.
Definition: frame.h:361
Vec localTransformOf(const Vec &src) const
Returns the Frame transform of a vector src defined in the referenceFrame() coordinate system (conver...
Definition: frame.cpp:872
The Frame class represents a coordinate system, defined by a position and an orientation.
Definition: frame.h:121
virtual void constrainTranslation(Vec &translation, Frame *const frame)
Filters the translation applied to the frame.
Definition: constraint.h:133
void getTransformOf(const float src[3], float res[3]) const
Same as transformOf(), but with float parameters.
Definition: frame.cpp:926
Quaternion rotation() const
Returns the Frame rotation, defined with respect to the referenceFrame().
Definition: frame.h:237
void getTranslation(float &x, float &y, float &z) const
Fill x, y and z with the translation() of the Frame.
Definition: frame.cpp:291
void getWorldMatrix(GLdouble m[4][4]) const
float[4][4] parameter version of worldMatrix().
Definition: frame.cpp:211
Vec transformOf(const Vec &src) const
Returns the Frame transform of a vector src defined in the world coordinate system (converts vectors ...
Definition: frame.cpp:843
Vec rotate(const Vec &v) const
Returns the image of v by the Quaternion rotation.
Definition: quaternion.cpp:76
void getTransformOfIn(const float src[3], float res[3], const Frame *const in) const
Same as transformOfIn(), but with float parameters.
Definition: frame.cpp:958
void setOrientation(const Quaternion &orientation)
Sets the orientation() of the Frame, defined in the world coordinate system.
Definition: frame.cpp:505
Vec inverseCoordinatesOf(const Vec &src) const
Returns the world coordinates of the point whose position in the Frame coordinate system is src (conv...
Definition: frame.cpp:715
void getMatrix(GLdouble m[4][4]) const
GLdouble[4][4] version of matrix().
Definition: frame.cpp:131
Vec position() const
Returns the position of the Frame, defined in the world coordinate system.
Definition: frame.cpp:537
void setTranslationAndRotation(const Vec &translation, const Quaternion &rotation)
Same as successive calls to setTranslation() and then setRotation().
Definition: frame.cpp:483
Vec inverseTransformOf(const Vec &src) const
Returns the world transform of the vector whose coordinates in the Frame coordinate system is src (co...
Definition: frame.cpp:856
Frame inverse() const
Returns a Frame representing the inverse of the Frame space transformation.
Definition: frame.cpp:164
void projectOnAxis(const Vec &direction)
Projects the Vec on the axis of direction direction that passes through the origin.
Definition: vec.cpp:34
Vec coordinatesOfFrom(const Vec &src, const Frame *const from) const
Returns the Frame coordinates of the point whose position in the from coordinate system is src (conve...
Definition: frame.cpp:749
void setFromMatrix(const GLdouble m[4][4])
This is an overloaded method provided for convenience.
Definition: frame.cpp:228
Vec transformOfFrom(const Vec &src, const Frame *const from) const
Returns the Frame transform of the vector whose coordinates in the from coordinate system is src (con...
Definition: frame.cpp:890
void modified()
This signal is emitted whenever the position() or the orientation() of the Frame is modified...
Constraint * constraint() const
Returns the current constraint applied to the Frame.
Definition: frame.h:356
Vec localInverseCoordinatesOf(const Vec &src) const
Returns the referenceFrame() coordinates of a point src defined in the Frame coordinate system (conve...
Definition: frame.cpp:740