MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / GetCubeMapRotation

Function GetCubeMapRotation

Source/Graphics/cubemap.cpp:38–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36#include <Internal/profiler.h>
37
38mat4 GetCubeMapRotation(int i) {
39 mat4 rot[2];
40 if (i == 0) {
41 rot[0].SetRotationY(PI_f * -0.5f);
42 rot[1].SetRotationZ(PI_f);
43 return rot[0] * rot[1];
44 } else if (i == 1) {
45 rot[0].SetRotationY(PI_f * 0.5f);
46 rot[1].SetRotationZ(PI_f);
47 return rot[0] * rot[1];
48 } else if (i == 2) {
49 rot[0].SetRotationX(PI_f * 0.5f);
50 return rot[0];
51 } else if (i == 3) {
52 rot[0].SetRotationX(PI_f * -0.5f);
53 return rot[0];
54 } else if (i == 4) {
55 rot[0].SetRotationY(PI_f);
56 rot[1].SetRotationZ(PI_f);
57 return rot[0] * rot[1];
58 } else if (i == 5) {
59 rot[0].SetRotationZ(PI_f);
60 return rot[0];
61 }
62 FatalError("Error", "Getting cube map rotation that is not 0-5");
63 return mat4();
64}
65
66GLuint cube_map_fbo = UINT_MAX;
67

Callers 2

CubemapMipChainFunction · 0.85
DrawCubeMapMethod · 0.85

Calls 5

SetRotationYMethod · 0.80
SetRotationZMethod · 0.80
SetRotationXMethod · 0.80
mat4Class · 0.70
FatalErrorFunction · 0.50

Tested by

no test coverage detected