MCPcopy Create free account
hub / github.com/RenderKit/embree / ImInvLength

Function ImInvLength

tutorials/common/imgui/imgui_internal.h:466–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464static inline float ImLengthSqr(const ImVec2& lhs) { return (lhs.x * lhs.x) + (lhs.y * lhs.y); }
465static inline float ImLengthSqr(const ImVec4& lhs) { return (lhs.x * lhs.x) + (lhs.y * lhs.y) + (lhs.z * lhs.z) + (lhs.w * lhs.w); }
466static inline float ImInvLength(const ImVec2& lhs, float fail_value) { float d = (lhs.x * lhs.x) + (lhs.y * lhs.y); if (d > 0.0f) return ImRsqrt(d); return fail_value; }
467static inline float ImFloor(float f) { return (float)(int)(f); }
468static inline float ImFloorSigned(float f) { return (float)((f >= 0 || (float)(int)f == f) ? (int)f : (int)f - 1); } // Decent replacement for floorf()
469static inline ImVec2 ImFloor(const ImVec2& v) { return ImVec2((float)(int)(v.x), (float)(int)(v.y)); }

Callers

nothing calls this directly

Calls 1

ImRsqrtFunction · 0.85

Tested by

no test coverage detected