mousetrap v0.2.0
Loading...
Searching...
No Matches
mousetrap::GLTransform Class Reference

transform, operates in OpenGL coordinate system More...

#include <gl_transform.hpp>

Public Member Functions

 GLTransform ()
 construct a identity
 
Vector2f apply_to (Vector2f gl_coords)
 apply transform to mousetrap::Vector2f
 
Vector3f apply_to (Vector3f gl_coords)
 apply transform to mousetrap::Vector3f
 
GLTransform combine_with (GLTransform)
 combin two transforms
 
void rotate (Angle, Vector2f gl_coords)
 rotate transform
 
void translate (Vector2f gl_offset)
 translate transform
 
void scale (float x, float y)
 scale transform
 
void reset ()
 make transform identity
 

Public Attributes

glm::mat4x4 transform
 transform data
 

Detailed Description

transform, operates in OpenGL coordinate system

Member Function Documentation

◆ apply_to() [1/2]

Vector2f mousetrap::GLTransform::apply_to ( Vector2f  gl_coords)

apply transform to mousetrap::Vector2f

Parameters
gl_coordsvector in 2d space
Returns
result in 2d space

References apply_to().

Referenced by apply_to().

◆ apply_to() [2/2]

Vector3f mousetrap::GLTransform::apply_to ( Vector3f  gl_coords)

apply transform to mousetrap::Vector3f

Parameters
gl_coordsvector in 3d space
Returns
result in 3d space

References transform.

◆ combine_with()

GLTransform mousetrap::GLTransform::combine_with ( GLTransform  other)

combin two transforms

Parameters
other
Returns
result of self * other

References GLTransform(), and transform.

◆ rotate()

void mousetrap::GLTransform::rotate ( Angle  angle,
Vector2f  gl_coords 
)

rotate transform

Parameters
angle
gl_coordsorigin point of rotation

References mousetrap::Angle::as_radians(), and transform.

◆ scale()

void mousetrap::GLTransform::scale ( float  x,
float  y 
)

scale transform

Parameters
xhorizontal scale
yvertical scale

References transform.

◆ translate()

void mousetrap::GLTransform::translate ( Vector2f  gl_offset)

translate transform

Parameters
gl_offsetoffset in 2d space

References transform.


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