From 681305e9bf725872af906acb707627b26b3c8e67 Mon Sep 17 00:00:00 2001 From: MartinRJ Fayray Date: Thu, 25 Oct 2012 07:36:33 +0200 Subject: BUG-540: Math updates by Moon Metty. Reviewed by Chieron Tenk. --- indra/llmath/llmath.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/llmath/llmath.h') diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index b93f89d674..95e6f68895 100644 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -1,4 +1,4 @@ -/** +/** * @file llmath.h * @brief Useful math constants and macros. * @@ -81,6 +81,9 @@ const F32 OO_LN2 = 1.4426950408889634073599246810019f; const F32 F_ALMOST_ZERO = 0.0001f; const F32 F_ALMOST_ONE = 1.0f - F_ALMOST_ZERO; +const F32 GIMBAL_THRESHOLD = 0.000436f; // sets the gimballock threshold 0.025 away from +/-90 degrees +// formula: GIMBAL_THRESHOLD = sin(DEG_TO_RAD * gimbal_threshold_angle); + // BUG: Eliminate in favor of F_APPROXIMATELY_ZERO above? const F32 FP_MAG_THRESHOLD = 0.0000001f; -- cgit v1.2.3 From e0a015920d3c0f793cadb88b7b8c4cedca61d2fb Mon Sep 17 00:00:00 2001 From: Ricky Curtice Date: Sun, 2 Mar 2014 14:33:57 -0800 Subject: STORM-1920: Richard fixed and optimized a ton more math. From Richard: There are a bunch of things I changed...mainly I eliminated all the grid_offset nonsense and instead simply calculate the tick index for the current drag position and use that to generate a snapped position as needed. I still use approx_equal because I want grid numbers to light up even when they aren't the axis you are currently snapping to. --- indra/llmath/llmath.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llmath/llmath.h') diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index b93f89d674..5abd9a0d06 100755 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -72,6 +72,7 @@ const F32 F_E = 2.71828182845904523536f; const F32 F_SQRT2 = 1.4142135623730950488016887242097f; const F32 F_SQRT3 = 1.73205080756888288657986402541f; const F32 OO_SQRT2 = 0.7071067811865475244008443621049f; +const F32 OO_SQRT3 = 0.577350269189625764509f; const F32 DEG_TO_RAD = 0.017453292519943295769236907684886f; const F32 RAD_TO_DEG = 57.295779513082320876798154814105f; const F32 F_APPROXIMATELY_ZERO = 0.00001f; -- cgit v1.2.3