From 02615af1fdae2ef3d4a0ab34ab2ce6c9c12bb793 Mon Sep 17 00:00:00 2001 From: Quaternions <krakow20@gmail.com> Date: Wed, 19 Mar 2025 16:12:32 -0700 Subject: [PATCH] common: integer: angle constructor --- lib/common/src/integer.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/common/src/integer.rs b/lib/common/src/integer.rs index a9364e72d..a9b0cee18 100644 --- a/lib/common/src/integer.rs +++ b/lib/common/src/integer.rs @@ -401,6 +401,10 @@ impl Angle32{ pub const NEG_FRAC_PI_2:Self=Self(-1<<30); pub const PI:Self=Self(-1<<31); #[inline] + pub const fn raw(num:i32)->Self{ + Self(num) + } + #[inline] pub const fn wrap_from_i64(theta:i64)->Self{ //take lower bits //note: this was checked on compiler explorer and compiles to 1 instruction!