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

Function Normalize

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

Source from the content-addressed store, hash-verified

22}
23
24Vec3 Normalize(const Vec3& v)
25{
26 float len = Length(v);
27 if (len <= 1e-20f)
28 {
29 return {0.0f, 0.0f, 0.0f};
30 }
31 float inv = 1.0f / len;
32 return {v.x * inv, v.y * inv, v.z * inv};
33}
34
35Vec3 Lerp(const Vec3& a, const Vec3& b, float t)
36{

Callers 9

LookAtFunction · 0.85
LightViewFunction · 0.85
ShadowBiasFunction · 0.85
BuildShadowCascadesFunction · 0.85
SunDirectionFunction · 0.85
NormalizeMethod · 0.85
TriShadowDepthProbeFunction · 0.85

Calls 1

LengthFunction · 0.85

Tested by 2

SunDirectionFunction · 0.68
TriShadowDepthProbeFunction · 0.68