MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / v_norm4_safe

Function v_norm4_safe

include/vecmath/dag_vecMath_common.h:263–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263VECTORCALL VECMATH_FINLINE vec4f v_norm4_safe(vec4f a, vec4f def)
264{
265 vec4f lenSq = v_length4_sq(a);
266 vec4f len = v_splat_x(v_sqrt_x(lenSq));
267 return v_sel(v_div(a, len), def, v_is_unsafe_positive_divisor(lenSq));
268}
269VECTORCALL VECMATH_FINLINE vec4f v_norm3_safe(vec3f a, vec3f def)
270{
271 vec4f lenSq = v_length3_sq(a);

Callers 3

safe_normalize4Function · 0.85

Calls 6

v_length4_sqFunction · 0.70
v_splat_xFunction · 0.70
v_sqrt_xFunction · 0.70
v_selFunction · 0.70
v_divFunction · 0.70

Tested by

no test coverage detected