Merge pull request #141 from sebcrozet/no_identity_fail
Remove implementations of `Rotation`, `Translation` and `Transformation` for the `Identity` type.
This commit is contained in:
commit
8711a8602e
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "nalgebra"
|
name = "nalgebra"
|
||||||
version = "0.2.18"
|
version = "0.2.19"
|
||||||
authors = [ "Sébastien Crozet <developer@crozet.re>" ] # FIXME: add the contributors.
|
authors = [ "Sébastien Crozet <developer@crozet.re>" ] # FIXME: add the contributors.
|
||||||
|
|
||||||
description = "Linear algebra library for computer physics, computer graphics and general low-dimensional linear algebra for Rust."
|
description = "Linear algebra library for computer physics, computer graphics and general low-dimensional linear algebra for Rust."
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -10,7 +10,7 @@ bench:
|
||||||
cargo bench
|
cargo bench
|
||||||
|
|
||||||
doc:
|
doc:
|
||||||
cargo doc
|
cargo doc --no-deps
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
cargo clean
|
cargo clean
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
use std::ops::Mul;
|
use std::ops::Mul;
|
||||||
use num::{Zero, One};
|
use num::One;
|
||||||
use structs::mat;
|
use structs::mat;
|
||||||
use traits::operations::{Inv, Transpose};
|
use traits::operations::{Inv, Transpose};
|
||||||
use traits::geometry::{Translation, Translate, Rotation, Rotate, Transformation, Transform,
|
use traits::geometry::{Translate, Rotate, Transform, AbsoluteRotate};
|
||||||
AbsoluteRotate};
|
|
||||||
|
|
||||||
impl One for mat::Identity {
|
impl One for mat::Identity {
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -42,43 +41,6 @@ impl Transpose for mat::Identity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<V: Zero> Translation<V> for mat::Identity {
|
|
||||||
#[inline]
|
|
||||||
fn translation(&self) -> V {
|
|
||||||
::zero()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn inv_translation(&self) -> V {
|
|
||||||
::zero()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn append_translation_mut(&mut self, _: &V) {
|
|
||||||
panic!("Attempted to translate the identity matrix.")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn append_translation(&self, _: &V) -> mat::Identity {
|
|
||||||
panic!("Attempted to translate the identity matrix.")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn prepend_translation_mut(&mut self, _: &V) {
|
|
||||||
panic!("Attempted to translate the identity matrix.")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn prepend_translation(&self, _: &V) -> mat::Identity {
|
|
||||||
panic!("Attempted to translate the identity matrix.")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn set_translation(&mut self, _: V) {
|
|
||||||
panic!("Attempted to translate the identity matrix.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<V: Clone> Translate<V> for mat::Identity {
|
impl<V: Clone> Translate<V> for mat::Identity {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn translate(&self, v: &V) -> V {
|
fn translate(&self, v: &V) -> V {
|
||||||
|
@ -91,43 +53,6 @@ impl<V: Clone> Translate<V> for mat::Identity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<V: Zero> Rotation<V> for mat::Identity {
|
|
||||||
#[inline]
|
|
||||||
fn rotation(&self) -> V {
|
|
||||||
::zero()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn inv_rotation(&self) -> V {
|
|
||||||
::zero()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn append_rotation_mut(&mut self, _: &V) {
|
|
||||||
panic!("Attempted to rotate the identity matrix.")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn append_rotation(&self, _: &V) -> mat::Identity {
|
|
||||||
panic!("Attempted to rotate the identity matrix.")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn prepend_rotation_mut(&mut self, _: &V) {
|
|
||||||
panic!("Attempted to rotate the identity matrix.")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn prepend_rotation(&self, _: &V) -> mat::Identity {
|
|
||||||
panic!("Attempted to rotate the identity matrix.")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn set_rotation(&mut self, _: V) {
|
|
||||||
panic!("Attempted to rotate the identity matrix.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<V: Clone> Rotate<V> for mat::Identity {
|
impl<V: Clone> Rotate<V> for mat::Identity {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn rotate(&self, v: &V) -> V {
|
fn rotate(&self, v: &V) -> V {
|
||||||
|
@ -147,43 +72,6 @@ impl<V: Clone> AbsoluteRotate<V> for mat::Identity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<M: One> Transformation<M> for mat::Identity {
|
|
||||||
#[inline]
|
|
||||||
fn transformation(&self) -> M {
|
|
||||||
::one()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn inv_transformation(&self) -> M {
|
|
||||||
::one()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn append_transformation_mut(&mut self, _: &M) {
|
|
||||||
panic!("Attempted to transform the identity matrix.")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn append_transformation(&self, _: &M) -> mat::Identity {
|
|
||||||
panic!("Attempted to transform the identity matrix.")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn prepend_transformation_mut(&mut self, _: &M) {
|
|
||||||
panic!("Attempted to transform the identity matrix.")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn prepend_transformation(&self, _: &M) -> mat::Identity {
|
|
||||||
panic!("Attempted to transform the identity matrix.")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn set_transformation(&mut self, _: M) {
|
|
||||||
panic!("Attempted to transform the identity matrix.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<V: Clone> Transform<V> for mat::Identity {
|
impl<V: Clone> Transform<V> for mat::Identity {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn transform(&self, v: &V) -> V {
|
fn transform(&self, v: &V) -> V {
|
||||||
|
|
Loading…
Reference in New Issue