MCPcopy Create free account
hub / github.com/OpenPathGuidingLibrary/openpgl / zero_fix

Function zero_fix

third-party/embreeSrc/common/math/vec3.h:76–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 template<typename T> __forceinline Vec3<T> sqrt ( const Vec3<T>& a ) { return Vec3<T>(sqrt (a.x), sqrt (a.y), sqrt (a.z)); }
75
76 template<typename T> __forceinline Vec3<T> zero_fix( const Vec3<T>& a )
77 {
78 return Vec3<T>(select(abs(a.x)<min_rcp_input,T(min_rcp_input),a.x),
79 select(abs(a.y)<min_rcp_input,T(min_rcp_input),a.y),
80 select(abs(a.z)<min_rcp_input,T(min_rcp_input),a.z));
81 }
82 template<typename T> __forceinline Vec3<T> rcp_safe(const Vec3<T>& a) { return rcp(zero_fix(a)); }
83
84 ////////////////////////////////////////////////////////////////////////////////

Callers 1

rcp_safeFunction · 0.70

Calls 2

selectFunction · 0.70
absFunction · 0.70

Tested by

no test coverage detected