[−][src]Type Definition quick_maths::Transform4
type Transform4<T = DefaultFloat> = Transform<T, 4>;
3D transformation, where 4 represents the dimension of the matrix used.
Implementations
impl<T: Float> Transform4<T>
[src]
pub fn new(m: Mat4<T>) -> Self
[src]
pub fn scale(by: Vec3<T>) -> Self
[src]
pub fn rot(axis: Vec3<T>, theta: T) -> Self
[src]
pub fn translate(by: Vec3<T>) -> Self
[src]
pub fn orthographic(z_near: T, z_far: T) -> Self
[src]
pub fn perspective(fov: T, near: T, far: T) -> Self
[src]
Perspective transformation
pub fn look_at(pos: Vec3<T>, at: Vec3<T>, up: Vec3<T>) -> Self
[src]
A transformation that orients something as if it's looking towards "at" from "pos".
pub fn apply_point(&self, pt: &Vec3<T>) -> Vec3<T>
[src]
Applies this transformation as if to a point.
pub fn apply_vec(&self, vec: &Vec3<T>) -> Vec3<T>
[src]
Applies this transformation as if applying it to a vector What this means operationally is no transformations.
pub fn apply_normal(&self, n: &Vec3<T>) -> Vec3<T>
[src]
Applies this transformation as if applying it to a (surface) normal vector
pub fn apply_ray(&self, r: &Ray3<T>) -> Ray3<T>
[src]
Applies this transform to a ray (convenience for applying point to origin and vector to direction)