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

Function v_norm3_safe

include/vecmath/dag_vecMath_common.h:269–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);
272 vec4f len = v_splat_x(v_sqrt_x(lenSq));
273 return v_sel(v_div(a, len), def, v_is_unsafe_positive_divisor(lenSq));
274}
275VECTORCALL VECMATH_FINLINE vec4f v_norm2_safe(vec4f a, vec4f def)
276{
277 vec4f lenSq = v_length2_sq(a);

Callers 4

safe_normalize3Function · 0.85
v_mat33_make_from_lookFunction · 0.85
v_angle_cosFunction · 0.85
v_angle_cos_xFunction · 0.85

Calls 6

v_length3_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