OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4FragTransform Class Reference

#include <C4FoW.h>

Public Member Functions

 C4FragTransform ()
 
void Translate (float dx, float dy)
 
void Scale (float sx, float sy)
 
void Get2x3 (float transform[6])
 

Detailed Description

Simple transformation class which allows translation and scales in x and y. This is typically used to initialize shader uniforms to transform fragment coordinates to some texture coordinates (e.g. landscape coordinates or light texture coordinates).

Definition at line 32 of file C4FoW.h.

Constructor & Destructor Documentation

C4FragTransform::C4FragTransform ( )
inline

Definition at line 35 of file C4FoW.h.

35 : x(1.0f), y(1.0f), x0(0.0f), y0(0.0f) {}

Member Function Documentation

void C4FragTransform::Get2x3 ( float  transform[6])
inline

Definition at line 54 of file C4FoW.h.

Referenced by C4FoWRegion::GetFragTransform(), and C4FoWAmbient::GetFragTransform().

55  {
56  transform[0] = x;
57  transform[1] = 0.f;
58  transform[2] = x0;
59  transform[3] = 0.f;
60  transform[4] = y;
61  transform[5] = y0;
62  }

Here is the caller graph for this function:

void C4FragTransform::Scale ( float  sx,
float  sy 
)
inline

Definition at line 45 of file C4FoW.h.

Referenced by C4FoWRegion::GetFragTransform(), and C4FoWAmbient::GetFragTransform().

46  {
47  x *= sx;
48  y *= sy;
49 
50  x0 *= sx;
51  y0 *= sy;
52  }

Here is the caller graph for this function:

void C4FragTransform::Translate ( float  dx,
float  dy 
)
inline

Definition at line 38 of file C4FoW.h.

Referenced by C4FoWRegion::GetFragTransform(), and C4FoWAmbient::GetFragTransform().

39  {
40  x0 += dx;
41  y0 += dy;
42  }

Here is the caller graph for this function:


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