From 5e32fbe4ae5e8296c853cc45078dd68a8e49b438 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 28 Sep 2024 20:16:43 -0700 Subject: [PATCH] absrel idea --- absrel/Cargo.toml | 6 ++++++ absrel/src/abs.rs | 3 +++ absrel/src/lib.rs | 2 ++ absrel/src/rel.rs | 7 +++++++ 4 files changed, 18 insertions(+) create mode 100644 absrel/Cargo.toml create mode 100644 absrel/src/abs.rs create mode 100644 absrel/src/lib.rs create mode 100644 absrel/src/rel.rs diff --git a/absrel/Cargo.toml b/absrel/Cargo.toml new file mode 100644 index 0000000..52c4252 --- /dev/null +++ b/absrel/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "absrel" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/absrel/src/abs.rs b/absrel/src/abs.rs new file mode 100644 index 0000000..b043ce6 --- /dev/null +++ b/absrel/src/abs.rs @@ -0,0 +1,3 @@ +/// This type represents an absolute value, such as a coordinate for a world position. +/// This is called a euclidean point in Geometric Algebra. +pub struct Absolute(T); diff --git a/absrel/src/lib.rs b/absrel/src/lib.rs new file mode 100644 index 0000000..ca4cd33 --- /dev/null +++ b/absrel/src/lib.rs @@ -0,0 +1,2 @@ +pub mod abs; +pub mod rel; diff --git a/absrel/src/rel.rs b/absrel/src/rel.rs new file mode 100644 index 0000000..3778b34 --- /dev/null +++ b/absrel/src/rel.rs @@ -0,0 +1,7 @@ +/// This type represents the difference between two absolute values. +/// This is called an ideal point in Geometric Algebra. +/// After you get your time delta or position delta, +/// implement your number-crunching logic using this type. +/// Once the calculation is complete, it can be added to an absolute value +/// with the effect of offsetting the value to a new absolute value. +pub struct Relative(T);