Remove unused code

This commit is contained in:
Hanno Braun 2024-09-25 19:33:52 +02:00
parent ab32b708e9
commit f57417f32a

View File

@ -2,7 +2,7 @@ use std::ops;
use nalgebra::Perspective3;
use crate::{Line, Scalar};
use crate::Scalar;
use super::{Aabb, Point, Segment, Triangle, Vector};
@ -62,11 +62,6 @@ impl Transform {
Vector::from(self.0.transform_vector(&vector.to_na()))
}
/// Transform the given line
pub fn transform_line(&self, line: &Line<3>) -> Line<3> {
line.transform(self)
}
/// Transform the given segment
pub fn transform_segment(&self, segment: &Segment<3>) -> Segment<3> {
let [a, b] = &segment.points();
@ -157,31 +152,10 @@ impl ops::Mul<Self> for Transform {
mod tests {
use approx::assert_abs_diff_eq;
use crate::{Line, Point, Scalar, Vector};
use crate::{Scalar, Vector};
use super::Transform;
#[test]
fn transform() {
let line = Line::from_origin_and_direction(
Point::from([1., 0., 0.]),
Vector::from([0., 1., 0.]),
);
let transform = Transform::translation([1., 2., 3.])
* Transform::rotation(Vector::unit_z() * (Scalar::PI / 2.));
let line = transform.transform_line(&line);
assert_abs_diff_eq!(
line,
Line::from_origin_and_direction(
Point::from([1., 3., 3.]),
Vector::from([-1., 0., 0.]),
),
epsilon = Scalar::from(1e-8),
);
}
#[test]
fn extract_rotation_translation() {
let rotation =