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

Function v_sphere_intersect

include/vecmath/dag_vecMath_common.h:1934–1957  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1932}
1933
1934VECTORCALL VECMATH_FINLINE int v_sphere_intersect(vec3f center, vec3f r,
1935 vec3f plane03X, const vec4f& plane03Y, const vec4f& plane03Z, const vec4f& plane03W,
1936 const vec4f& plane4, const vec4f& plane5)
1937{
1938 vec4f res03;
1939 res03 = v_madd(v_splat_x(center), plane03X, plane03W);
1940 res03 = v_madd(v_splat_y(center), plane03Y, res03);
1941 res03 = v_madd(v_splat_z(center), plane03Z, res03);
1942 res03 = v_add(res03, r);
1943 res03 = v_or(res03, v_add(v_add(v_dot3(center, plane4), r), v_splat_w(plane4)));
1944 res03 = v_or(res03, v_add(v_add(v_dot3(center, plane5), r), v_splat_w(plane5)));
1945
1946 if (v_test_vec_mask_neq_0(res03))
1947 return 0;
1948
1949 res03 = v_madd(v_splat_x(center), plane03X, plane03W);
1950 res03 = v_madd(v_splat_y(center), plane03Y, res03);
1951 res03 = v_madd(v_splat_z(center), plane03Z, res03);
1952 res03 = v_sub(res03, r);
1953 res03 = v_or(res03, v_add(v_sub(v_dot3(center, plane4), r), v_splat_w(plane4)));
1954 res03 = v_or(res03, v_add(v_sub(v_dot3(center, plane5), r), v_splat_w(plane5)));
1955
1956 return v_test_vec_mask_neq_0(res03) + 1;
1957}
1958
1959VECTORCALL VECMATH_FINLINE int v_is_visible_box_extent2(vec3f center, vec3f extent,//center and extent should be multiplied by 2
1960 vec4f plane03X, const vec4f& plane03Y, const vec4f& plane03Z, const vec4f& plane03W2,

Callers

nothing calls this directly

Calls 11

v_test_vec_mask_neq_0Function · 0.85
v_maddFunction · 0.70
v_splat_xFunction · 0.70
v_splat_yFunction · 0.70
v_splat_zFunction · 0.70
v_addFunction · 0.70
v_orFunction · 0.70
v_dot3Function · 0.70
v_splat_wFunction · 0.70
v_subFunction · 0.70
v_signmaskFunction · 0.70

Tested by

no test coverage detected