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);