rinia 0.0.8

Portable scalar abstractions for game and simulation math.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![cfg(feature = "mint")]

use crate::{Quat, QuatScalar};

impl<T: QuatScalar> From<mint::Quaternion<T>> for Quat<T> {
    #[inline]
    fn from(q: mint::Quaternion<T>) -> Self {
        Self { x: q.v.x, y: q.v.y, z: q.v.z, w: q.s }
    }
}

impl<T: QuatScalar> From<Quat<T>> for mint::Quaternion<T> {
    #[inline]
    fn from(q: Quat<T>) -> Self {
        Self { v: mint::Vector3 { x: q.x, y: q.y, z: q.z }, s: q.w }
    }
}