diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index 2675817e..37ca57f9 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -73,6 +73,7 @@ mod transform_ops; mod transform_simba; mod reflection; +mod reflection_alias; mod orthographic; mod perspective; @@ -104,6 +105,7 @@ pub use self::transform::*; pub use self::transform_alias::*; pub use self::reflection::*; +pub use self::reflection_alias::*; pub use self::orthographic::Orthographic3; pub use self::perspective::Perspective3; diff --git a/src/geometry/reflection.rs b/src/geometry/reflection.rs index 87166b81..a48b8024 100644 --- a/src/geometry/reflection.rs +++ b/src/geometry/reflection.rs @@ -22,7 +22,7 @@ impl>, const D: usize> Reflection> Reflection { - /// Creates a new reflection wrt the plane orthogonal to the given axis and bias. + /// Creates a new reflection wrt. the plane orthogonal to the given axis and bias. /// /// The bias is the position of the plane on the axis. In particular, a bias equal to zero /// represents a plane that passes through the origin. @@ -33,12 +33,21 @@ impl> Reflection { } } - /// The reflexion axis. + /// The reflection axis. #[must_use] pub fn axis(&self) -> &Vector { &self.axis } + /// The reflection bias. + /// + /// The bias is the position of the plane on the axis. In particular, a bias equal to zero + /// represents a plane that passes through the origin. + #[must_use] + pub fn bias(&self) -> T { + self.bias + } + // TODO: naming convention: reflect_to, reflect_assign ? /// Applies the reflection to the columns of `rhs`. pub fn reflect(&self, rhs: &mut Matrix) diff --git a/src/geometry/reflection_alias.rs b/src/geometry/reflection_alias.rs new file mode 100644 index 00000000..14f55a3a --- /dev/null +++ b/src/geometry/reflection_alias.rs @@ -0,0 +1,21 @@ +use crate::base::ArrayStorage; +use crate::geometry::Reflection; +use crate::Const; + +/// A 1-dimensional reflection. +pub type Reflection1 = Reflection, ArrayStorage>; + +/// A 2-dimensional reflection. +pub type Reflection2 = Reflection, ArrayStorage>; + +/// A 3-dimensional reflection. +pub type Reflection3 = Reflection, ArrayStorage>; + +/// A 4-dimensional reflection. +pub type Reflection4 = Reflection, ArrayStorage>; + +/// A 5-dimensional reflection. +pub type Reflection5 = Reflection, ArrayStorage>; + +/// A 6-dimensional reflection. +pub type Reflection6 = Reflection, ArrayStorage>;