Castor3D 0.16.0
Multiplatform 3D engine
|
Matrix basic operations. More...
Functions | |
template<typename T , typename U > | |
static Matrix4x4< T > & | rotate (Matrix4x4< T > &matrix, QuaternionT< U > const &orientation) |
Rotation function, builds a rotation matrix from the quaternion in parameter. | |
template<typename T , typename U > | |
static Matrix4x4< T > & | setRotate (Matrix4x4< T > &matrix, QuaternionT< U > const &orientation) |
Rotation function, builds a rotation matrix from the quaternion in parameter. | |
template<typename T , typename U > | |
static void | getRotate (Matrix4x4< T > const &matrix, QuaternionT< U > &orientation) |
Rotation function, builds a rotation matrix from the quaternion in parameter. | |
template<typename T > | |
static Matrix4x4< T > & | yaw (Matrix4x4< T > &matrix, Angle const &angle) |
Rotation function, around Y axis. Builds a rotation matrix from the angle in parameter. | |
template<typename T > | |
static Matrix4x4< T > & | pitch (Matrix4x4< T > &matrix, Angle const &angle) |
Rotation function, around X axis. Builds a rotation matrix from the angle in parameter. | |
template<typename T > | |
static Matrix4x4< T > & | roll (Matrix4x4< T > &matrix, Angle const &angle) |
Rotation function, around Z axis. Builds a rotation matrix from the angle in parameter. | |
template<typename T , typename U > | |
static Matrix4x4< T > & | scale (Matrix4x4< T > &matrix, U x, U y, U z) |
Scale function. Scales matrix from the three values in parameter. | |
template<typename T , typename U > | |
static Matrix4x4< T > & | scale (Matrix4x4< T > &matrix, Point3< U > const &scaling) |
Scale function. Scales matrix from the value in parameter. | |
template<typename T , typename U > | |
static Matrix4x4< T > & | setScale (Matrix4x4< T > &matrix, U x, U y, U z) |
Scale function. Scales matrix from the three values in parameter. | |
template<typename T , typename U > | |
static Matrix4x4< T > & | setScale (Matrix4x4< T > &matrix, Point3< U > const &scaling) |
Scale function. Scales matrix from the value in parameter. | |
template<typename T , typename U > | |
static Matrix4x4< T > & | translate (Matrix4x4< T > &matrix, U x, U y, U z) |
Translate function. Translates a matrix from the three values in parameter. | |
template<typename T , typename U > | |
static Matrix4x4< T > & | translate (Matrix4x4< T > &matrix, Point3< U > const &translation) |
Translate function. Translates a matrix from the value in parameter. | |
template<typename T , typename U > | |
static Matrix4x4< T > & | setTranslate (Matrix4x4< T > &matrix, U x, U y, U z) |
Translate function. Translates a matrix from the three values in parameter. | |
template<typename T , typename U > | |
static Matrix4x4< T > & | setTranslate (Matrix4x4< T > &matrix, Point3< U > const &translation) |
Translate function. Translates a matrix from the value in parameter. | |
template<typename T , typename U , typename V > | |
static Matrix4x4< T > & | setTransform (Matrix4x4< T > &matrix, Point3< U > const &position, Point3< U > const &scaling, QuaternionT< V > const &orientation) |
Retrieves transformation matrix from translation, scaling and rotation. | |
template<typename T , typename U , typename V > | |
static Matrix4x4< T > & | transform (Matrix4x4< T > &matrix, Point3< U > const &position, Point3< U > const &scaling, QuaternionT< V > const &orientation) |
Retrieves transformation matrix from translation, scaling and rotation. | |
template<typename T , typename U > | |
static Point3< U > | getTransformed (Matrix4x4< T > const &matrix, Point3< U > const &value) |
Transforms the position/scale through a transformation matrix. | |
template<typename T , typename U > | |
static Quaternion | getTransformed (Matrix4x4< T > const &matrix, Quaternion const &value) |
Transforms the orientation through a transformation matrix. | |
template<typename T , typename U , typename V > | |
static void | decompose (Matrix4x4< T > const &matrix, Point3< U > &position, Point3< U > &scaling, QuaternionT< V > &rotation) |
Retrieves the given transformation matrix components. | |
template<typename T > | |
static Matrix4x4< T > | reverseDepth (Matrix4x4< T > const &matrix) |
Inverts depth for given projection matrix. | |
template<typename T , typename U > | |
static Matrix4x4< T > & | perspective (Matrix4x4< T > &matrix, Angle const &fovy, U aspect, U zNear, U zFar) |
Builds a matrix that sets a centered perspective projection from the given parameters. | |
template<typename T , typename U > | |
static Matrix4x4< T > & | perspective (Matrix4x4< T > &matrix, Angle const &fovy, U aspect, U zNear) |
Builds a matrix that sets a centered infinite perspective projection from the given parameters. | |
template<typename T > | |
static Matrix4x4< T > | perspective (Angle const &fovy, T aspect, T nearVal, T farVal) |
Builds a matrix that sets a centered perspective projection from the given parameters. | |
template<typename T > | |
static Matrix4x4< T > | perspective (Angle const &fovy, T aspect, T nearVal) |
Builds a matrix that sets a centered infinite perspective projection from the given parameters. | |
template<typename T , typename U > | |
static Matrix4x4< T > & | frustum (Matrix4x4< T > &matrix, U left, U right, U bottom, U top, U nearVal, U farVal) |
Builds a matrix that sets a non centered perspective projection from the given parameters. | |
template<typename T > | |
static Matrix4x4< T > | frustum (T left, T right, T bottom, T top, T nearVal, T farVal) |
Builds a matrix that sets a non centered perspective projection from the given parameters. | |
template<typename T , typename U > | |
static Matrix4x4< T > & | ortho (Matrix4x4< T > &matrix, U left, U right, U bottom, U top, U zNear, U zFar) |
Builds a matrix that sets a non centered orthogonal projection from the given parameters. | |
template<typename T > | |
static Matrix4x4< T > | ortho (T left, T right, T bottom, T top, T zNear, T zFar) |
Builds a matrix that sets a non centered orthogonal projection from the given parameters. | |
template<typename T , typename U > | |
static Matrix4x4< T > & | lookAt (Matrix4x4< T > &matrix, Point3< U > const &eye, Point3< U > const ¢er, Point3< U > const &up) |
Builds a view matrix that looks at a given point. | |
template<typename T > | |
static Matrix4x4< T > | lookAt (Point3< T > const &eye, Point3< T > const ¢er, Point3< T > const &up) |
Builds a view matrix that looks at a given point. | |
template<typename T > | |
static Matrix4x4< T > & | switchHand (Matrix4x4< T > &matrix) |
Switches the handness of a matrix (from right to left or left to right) | |
template<typename T > | |
static Matrix4x4< T > | getSwitchHand (Matrix4x4< T > const &matrix) |
Switches the handness of a matrix (from right to left or left to right) | |
template<typename T , typename U > | |
static Matrix3x3< T > & | rotate (Matrix3x3< T > &matrix, Angle orientation) |
Rotation function, builds a rotation matrix from the quaternion in parameter. | |
template<typename T , typename U > | |
static Matrix3x3< T > & | setRotate (Matrix3x3< T > &matrix, Angle orientation) |
Rotation function, builds a rotation matrix from the quaternion in parameter. | |
template<typename T , typename U > | |
static void | getRotate (Matrix3x3< T > const &matrix, Angle orientation) |
Rotation function, builds a rotation matrix from the quaternion in parameter. | |
template<typename T , typename U > | |
static Matrix3x3< T > & | scale (Matrix3x3< T > &matrix, U x, U y) |
Scale function. Scales matrix from the three values in parameter. | |
template<typename T , typename U > | |
static Matrix3x3< T > & | scale (Matrix3x3< T > &matrix, Point2< U > const &scaling) |
Scale function. Scales matrix from the value in parameter. | |
template<typename T , typename U > | |
static Matrix3x3< T > & | setScale (Matrix3x3< T > &matrix, U x, U y) |
Scale function. Scales matrix from the three values in parameter. | |
template<typename T , typename U > | |
static Matrix3x3< T > & | setScale (Matrix3x3< T > &matrix, Point2< U > const &scaling) |
Scale function. Scales matrix from the value in parameter. | |
template<typename T , typename U > | |
static Matrix3x3< T > & | translate (Matrix3x3< T > &matrix, U x, U y) |
Translate function. Translates a matrix from the three values in parameter. | |
template<typename T , typename U > | |
static Matrix3x3< T > & | translate (Matrix3x3< T > &matrix, Point2< U > const &translation) |
Translate function. Translates a matrix from the value in parameter. | |
template<typename T , typename U > | |
static Matrix3x3< T > & | setTranslate (Matrix3x3< T > &matrix, U x, U y) |
Translate function. Translates a matrix from the three values in parameter. | |
template<typename T , typename U > | |
static Matrix3x3< T > & | setTranslate (Matrix3x3< T > &matrix, Point2< U > const &translation) |
Translate function. Translates a matrix from the value in parameter. | |
template<typename T , typename U , typename V > | |
static Matrix3x3< T > & | setTransform (Matrix3x3< T > &matrix, Point2< U > const &position, Point2< U > const &scaling, Angle orientation) |
Retrieves transformation matrix from translation, scaling and rotation. | |
template<typename T , typename U , typename V > | |
static Matrix3x3< T > & | transform (Matrix3x3< T > &matrix, Point2< U > const &position, Point2< U > const &scaling, Angle orientation) |
Retrieves transformation matrix from translation, scaling and rotation. | |
Matrix basic operations.
|
static |
Retrieves the given transformation matrix components.
[in] | matrix | The transformation matrix. |
[out] | position | The position component. |
[out] | scaling | The scaling component. |
[out] | rotation | The rotation component. |
|
static |
Builds a matrix that sets a non centered perspective projection from the given parameters.
[out] | matrix | The matrix that will receive the perspective matrix |
[in] | left | Left clipping plane value |
[in] | right | Right clipping plane value |
[in] | bottom | Bottom clipping plane value |
[in] | top | Top clipping plane value |
[in] | nearVal | Near clipping plane value |
[in] | farVal | Far clipping plane value |
|
static |
Builds a matrix that sets a non centered perspective projection from the given parameters.
[in] | left | Left clipping plane value |
[in] | right | Right clipping plane value |
[in] | bottom | Bottom clipping plane value |
[in] | top | Top clipping plane value |
[in] | nearVal | Near clipping plane value |
[in] | farVal | Far clipping plane value |
|
static |
Rotation function, builds a rotation matrix from the quaternion in parameter.
[in] | matrix | The matrix holding the scale transformation |
[out] | orientation | Receives the rotation |
|
static |
Rotation function, builds a rotation matrix from the quaternion in parameter.
[in] | matrix | The matrix holding the scale transformation |
[out] | orientation | Receives the rotation |
|
static |
Switches the handness of a matrix (from right to left or left to right)
[in] | matrix | The matrix to switch |
|
static |
Transforms the position/scale through a transformation matrix.
[out] | matrix | The transformation matrix |
[in] | value | The position/scale. |
|
static |
Transforms the orientation through a transformation matrix.
[out] | matrix | The transformation matrix. |
[in] | value | The orientation. |
|
static |
Builds a view matrix that looks at a given point.
[out] | matrix | The matrix that will receive the perspective matrix |
[in] | eye | The eye position |
[in] | center | The point to look at |
[in] | up | The up direction |
|
static |
Builds a view matrix that looks at a given point.
[in] | eye | The eye position |
[in] | center | The point to look at |
[in] | up | The up direction |
|
static |
Builds a matrix that sets a non centered orthogonal projection from the given parameters.
[out] | matrix | The matrix that will receive the perspective matrix |
[in] | left | Left clipping plane value |
[in] | right | Right clipping plane value |
[in] | bottom | Bottom clipping plane value |
[in] | top | Top clipping plane value |
[in] | zNear | Near clipping plane value |
[in] | zFar | Far clipping plane value |
|
static |
Builds a matrix that sets a non centered orthogonal projection from the given parameters.
[in] | left | Left clipping plane value |
[in] | right | Right clipping plane value |
[in] | bottom | Bottom clipping plane value |
[in] | top | Top clipping plane value |
[in] | zNear | Near clipping plane value |
[in] | zFar | Far clipping plane value |
|
static |
Builds a matrix that sets a centered infinite perspective projection from the given parameters.
[in] | fovy | Y Field of View |
[in] | aspect | Width / Height ratio |
[in] | nearVal | Near clipping plane value |
|
static |
Builds a matrix that sets a centered perspective projection from the given parameters.
[in] | fovy | Y Field of View |
[in] | aspect | Width / Height ratio |
[in] | nearVal | Near clipping plane value |
[in] | farVal | Far clipping plane value |
|
static |
Builds a matrix that sets a centered infinite perspective projection from the given parameters.
[out] | matrix | The matrix that will receive the perspective matrix |
[in] | fovy | Y Field of View |
[in] | aspect | Width / Height ratio |
[in] | zNear | Near clipping plane value |
|
static |
Builds a matrix that sets a centered perspective projection from the given parameters.
[out] | matrix | The matrix that will receive the perspective matrix |
[in] | fovy | Y Field of View |
[in] | aspect | Width / Height ratio |
[in] | zNear | Near clipping plane value |
[in] | zFar | Far clipping plane value |
|
static |
Rotation function, around X axis. Builds a rotation matrix from the angle in parameter.
[out] | matrix | The matrix that will receive the rotation matrix |
[in] | angle | The rotation angle |
|
static |
Inverts depth for given projection matrix.
[in] | matrix | The projection matrix. |
|
static |
Rotation function, around Z axis. Builds a rotation matrix from the angle in parameter.
[out] | matrix | The matrix that will receive the rotation matrix |
[in] | angle | The rotation angle |
|
static |
Rotation function, builds a rotation matrix from the quaternion in parameter.
[out] | matrix | The matrix that will receive the rotation matrix |
[in] | orientation | The quaterion used to compute the matrix |
|
static |
Rotation function, builds a rotation matrix from the quaternion in parameter.
[out] | matrix | The matrix that will receive the rotation matrix |
[in] | orientation | The quaterion used to compute the matrix |
|
static |
Scale function. Scales matrix from the value in parameter.
[out] | matrix | The matrix that will be scaled |
[in] | scaling | The scale value |
|
static |
Scale function. Scales matrix from the three values in parameter.
[out] | matrix | The matrix that will be scaled |
[in] | x,y | The scale values |
|
static |
Scale function. Scales matrix from the value in parameter.
[out] | matrix | The matrix that will be scaled |
[in] | scaling | The scale value |
|
static |
Scale function. Scales matrix from the three values in parameter.
[out] | matrix | The matrix that will be scaled |
[in] | x,y,z | The scale values |
|
static |
Rotation function, builds a rotation matrix from the quaternion in parameter.
[out] | matrix | The matrix that will receive the rotation matrix |
[in] | orientation | The quaterion used to compute the matrix |
|
static |
Rotation function, builds a rotation matrix from the quaternion in parameter.
[out] | matrix | The matrix that will receive the rotation matrix |
[in] | orientation | The quaterion used to compute the matrix |
|
static |
Scale function. Scales matrix from the value in parameter.
[out] | matrix | The matrix that will be scaled |
[in] | scaling | The scale value |
|
static |
Scale function. Scales matrix from the three values in parameter.
[out] | matrix | The matrix that will be scaled |
[in] | x,y | The scale values |
|
static |
Scale function. Scales matrix from the value in parameter.
[out] | matrix | The matrix that will be scaled |
[in] | scaling | The scale value |
|
static |
Scale function. Scales matrix from the three values in parameter.
[out] | matrix | The matrix that will be scaled |
[in] | x,y,z | The scale values |
|
static |
Retrieves transformation matrix from translation, scaling and rotation.
[out] | matrix | Receives the transformation |
[in] | position | The translation value |
[in] | scaling | The scaling value |
[in] | orientation | The rotation value |
|
static |
Retrieves transformation matrix from translation, scaling and rotation.
[out] | matrix | Receives the transformation |
[in] | position | The translation value |
[in] | scaling | The scaling value |
[in] | orientation | The rotation value |
|
static |
Translate function. Translates a matrix from the value in parameter.
[out] | matrix | The matrix that will be translated |
[in] | translation | The translate value |
|
static |
Translate function. Translates a matrix from the three values in parameter.
[out] | matrix | The matrix that will be translated |
[in] | x,y | The translate values |
|
static |
Translate function. Translates a matrix from the value in parameter.
[out] | matrix | The matrix that will be translated |
[in] | translation | The translate value |
|
static |
Translate function. Translates a matrix from the three values in parameter.
[out] | matrix | The matrix that will be translated |
[in] | x,y,z | The translate values |
|
static |
Switches the handness of a matrix (from right to left or left to right)
[in,out] | matrix | The matrix to switch, receives the switched matrix |
|
static |
Retrieves transformation matrix from translation, scaling and rotation.
[out] | matrix | Receives the transformation |
[in] | position | The translation value |
[in] | scaling | The scaling value |
[in] | orientation | The rotation value |
|
static |
Retrieves transformation matrix from translation, scaling and rotation.
[out] | matrix | Receives the transformation |
[in] | position | The translation value |
[in] | scaling | The scaling value |
[in] | orientation | The rotation value |
|
static |
Translate function. Translates a matrix from the value in parameter.
[out] | matrix | The matrix that will be translated |
[in] | translation | The translate value |
|
static |
Translate function. Translates a matrix from the three values in parameter.
[out] | matrix | The matrix that will be translated |
[in] | x,y | The translate values |
|
static |
Translate function. Translates a matrix from the value in parameter.
[out] | matrix | The matrix that will be translated |
[in] | translation | The translate value |
|
static |
Translate function. Translates a matrix from the three values in parameter.
[out] | matrix | The matrix that will be translated |
[in] | x,y,z | The translate values |
|
static |
Rotation function, around Y axis. Builds a rotation matrix from the angle in parameter.
[out] | matrix | The matrix that will receive the rotation matrix |
[in] | angle | The rotation angle |