Berserk
Public Member Functions | Static Public Member Functions | List of all members
Transformf Class Reference

3d space transform wrapper class More...

#include <Transformf.hpp>

Public Member Functions

 Transformf ()=default
 
TransformfRotateX (float angleRad)
 
TransformfRotateY (float angleRad)
 
TransformfRotateZ (float angleRad)
 
TransformfRotate (const Vec3f &axis, float angleRad)
 
TransformfScaleX (float scale)
 
TransformfScaleY (float scale)
 
TransformfScaleZ (float scale)
 
TransformfScale (const Vec3f &scale)
 
TransformfScale (float scale)
 
TransformfTranslate (const Vec3f &t)
 
Vec3f Transform (const Vec3f &v) const
 
Vec3f TransformAsNormal (const Vec3f &v) const
 
Mat4x4f ToTransformMat () const
 
Mat4x4f ToInverseTransformMat () const
 
Mat4x4f ToNormalMat () const
 
const QuatfGetRotation () const
 
const Vec3fGetOffset () const
 
const Vec3fGetScale () const
 
QuatfGetRotation ()
 
Vec3fGetOffset ()
 
Vec3fGetScale ()
 
void GetBasisRotation (Vec3f &x, Vec3f &y, Vec3f &z) const
 

Static Public Member Functions

static Transformf LookAt (const Vec3f &eye, const Vec3f &dir, const Vec3f &up)
 

Detailed Description

3d space transform wrapper class

Represent 3D space transformation object, i.e. space rotation as the quaternion, origin offset and space scale.

The logic applied to some vertices set in the spaces as follows:

Could be converted to the matrix form if required.

Constructor & Destructor Documentation

◆ Transformf()

Transformf::Transformf ( )
default

Member Function Documentation

◆ GetBasisRotation()

void Transformf::GetBasisRotation ( Vec3f x,
Vec3f y,
Vec3f z 
) const
inline

◆ GetOffset() [1/2]

Vec3f& Transformf::GetOffset ( )
inline

◆ GetOffset() [2/2]

const Vec3f& Transformf::GetOffset ( ) const
inline

◆ GetRotation() [1/2]

Quatf& Transformf::GetRotation ( )
inline

◆ GetRotation() [2/2]

const Quatf& Transformf::GetRotation ( ) const
inline

◆ GetScale() [1/2]

Vec3f& Transformf::GetScale ( )
inline

◆ GetScale() [2/2]

const Vec3f& Transformf::GetScale ( ) const
inline

◆ LookAt()

static Transformf Transformf::LookAt ( const Vec3f eye,
const Vec3f dir,
const Vec3f up 
)
inlinestatic

GL style look at view matrix

Parameters
eyePosition of the viewer
dirView view direction
upUp vector for proper orientation
Returns
View transformation

◆ Rotate()

Transformf& Transformf::Rotate ( const Vec3f axis,
float  angleRad 
)
inline

◆ RotateX()

Transformf& Transformf::RotateX ( float  angleRad)
inline

◆ RotateY()

Transformf& Transformf::RotateY ( float  angleRad)
inline

◆ RotateZ()

Transformf& Transformf::RotateZ ( float  angleRad)
inline

◆ Scale() [1/2]

Transformf& Transformf::Scale ( const Vec3f scale)
inline

◆ Scale() [2/2]

Transformf& Transformf::Scale ( float  scale)
inline

◆ ScaleX()

Transformf& Transformf::ScaleX ( float  scale)
inline

◆ ScaleY()

Transformf& Transformf::ScaleY ( float  scale)
inline

◆ ScaleZ()

Transformf& Transformf::ScaleZ ( float  scale)
inline

◆ ToInverseTransformMat()

Mat4x4f Transformf::ToInverseTransformMat ( ) const
inline
Warning
Suppose that rotation is normalised quaternion
Returns
4x4 inverse transform matrix, that ToInverseTransformMat * ToTransformMat = identity

◆ ToNormalMat()

Mat4x4f Transformf::ToNormalMat ( ) const
inline
Returns
Normal matrix, required for proper normals transformation in the vertex shaders

◆ ToTransformMat()

Mat4x4f Transformf::ToTransformMat ( ) const
inline
Returns
4x4 transform matrix with embedded rotation, scale and translate operations

◆ Transform()

Vec3f Transformf::Transform ( const Vec3f v) const
inline

◆ TransformAsNormal()

Vec3f Transformf::TransformAsNormal ( const Vec3f v) const
inline

◆ Translate()

Transformf& Transformf::Translate ( const Vec3f t)
inline

The documentation for this class was generated from the following file: