MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / Ortho

Function Ortho

engine/Poseidon/Graphics/Shadow/ShadowMath.cpp:169–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169Mat4 Ortho(float l, float r, float b, float t, float n, float f)
170{
171 Mat4 m;
172 float rl = (r - l != 0.0f) ? (r - l) : 1e-6f;
173 float tb = (t - b != 0.0f) ? (t - b) : 1e-6f;
174 float fn = (f - n != 0.0f) ? (f - n) : 1e-6f;
175 m.at(0, 0) = 2.0f / rl;
176 m.at(1, 1) = 2.0f / tb;
177 m.at(2, 2) = -1.0f / fn; // zero-to-one depth: near plane -> 0, far plane -> 1
178 m.at(0, 3) = -(r + l) / rl;
179 m.at(1, 3) = -(t + b) / tb;
180 m.at(2, 3) = -n / fn;
181 m.at(3, 3) = 1.0f;
182 return m;
183}
184
185Mat4 Perspective(float fovYRadians, float aspect, float n, float f)
186{

Callers 6

FitOrthoFunction · 0.85
SnapToTexelGridFunction · 0.85
FitOrthoSphereFunction · 0.85
CascadeLightVPStableFunction · 0.85
OmniSphereLightVPFunction · 0.85

Calls 1

atMethod · 0.80

Tested by

no test coverage detected