OpenClonk
C4FragTransform Class Reference

#include <C4FoW.h>

Public Member Functions

 C4FragTransform ()=default
 
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::C4FragTransform ( )
default

Member Function Documentation

◆ Get2x3()

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

Definition at line 54 of file C4FoW.h.

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  }

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

Here is the caller graph for this function:

◆ Scale()

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

Definition at line 45 of file C4FoW.h.

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

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

Here is the caller graph for this function:

◆ Translate()

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

Definition at line 38 of file C4FoW.h.

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

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

Here is the caller graph for this function:

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