diff options
author | tcmal <me@aria.rip> | 2024-08-25 17:44:23 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-25 17:44:23 +0100 |
commit | 439219e74090c7158f8dbc33fed4107a5eb7c003 (patch) | |
tree | 7ba62254b2d888578ff6c1c8de4f0f35c01c75dd /stockton-levels/src/coords.rs | |
parent | 04f17923d38171f07f72603a54237f20ca3572dd (diff) |
refactor(levels): no longer q3 specific
Diffstat (limited to 'stockton-levels/src/coords.rs')
-rw-r--r-- | stockton-levels/src/coords.rs | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/stockton-levels/src/coords.rs b/stockton-levels/src/coords.rs deleted file mode 100644 index 1b1fa55..0000000 --- a/stockton-levels/src/coords.rs +++ /dev/null @@ -1,41 +0,0 @@ -// This program is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation, either version 3 of the License, or (at your option) -// any later version. - -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. - -// You should have received a copy of the GNU General Public License along -// with this program. If not, see <http://www.gnu.org/licenses/>. -//! Marker traits for different co-ordinate systems, and functions to swizzle between them - -use na::base::Scalar; -use na::Vector3; -use std::ops::Neg; - -pub trait CoordSystem {} - -/// X points East, Y points South, Z points downwards -pub struct Q3System; -impl CoordSystem for Q3System {} - -/// X points east, Y points downwards, Z points inwards -pub struct VulkanSystem; -impl CoordSystem for VulkanSystem {} - -pub struct Swizzler; - -pub trait SwizzleFromTo<F: CoordSystem, T: CoordSystem> { - fn swizzle<U: Scalar + Copy + Neg<Output = U>>(vec: &mut Vector3<U>); -} - -impl SwizzleFromTo<Q3System, VulkanSystem> for Swizzler { - fn swizzle<U: Scalar + Copy + Neg<Output = U>>(vec: &mut Vector3<U>) { - let temp = vec.y; - vec.y = vec.z; - vec.z = -temp; - } -} |