From 2a6302cd54da66078aac5e9a1979b15df3bf5197 Mon Sep 17 00:00:00 2001 From: sebcrozet Date: Sat, 22 Sep 2018 18:42:38 +0200 Subject: [PATCH] Fix some comments. --- nalgebra-glm/src/common.rs | 7 +------ nalgebra-glm/src/gtx/transform.rs | 4 ++-- nalgebra-glm/src/lib.rs | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/nalgebra-glm/src/common.rs b/nalgebra-glm/src/common.rs index 98c80252..e24e873f 100644 --- a/nalgebra-glm/src/common.rs +++ b/nalgebra-glm/src/common.rs @@ -77,13 +77,8 @@ pub fn floor(x: &Vec) -> Vec // a * b + c //} -/// Returns the fractional part of `x`. -pub fn fract(x: N) -> N { - x.fract() -} - /// Returns the fractional part of each component of `x`. -pub fn fract2(x: &Vec) -> Vec +pub fn fract(x: &Vec) -> Vec where DefaultAllocator: Alloc { x.map(|x| x.fract()) } diff --git a/nalgebra-glm/src/gtx/transform.rs b/nalgebra-glm/src/gtx/transform.rs index bf63b19f..68f54f06 100644 --- a/nalgebra-glm/src/gtx/transform.rs +++ b/nalgebra-glm/src/gtx/transform.rs @@ -3,7 +3,7 @@ use na::{Real, Unit, Rotation3, Matrix4, U3, U4}; use traits::Number; use aliases::{Vec, Mat}; -/// Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in radians. +/// A rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in radians. pub fn rotation(angle: N, v: &Vec) -> Mat { Rotation3::from_axis_angle(&Unit::new_normalize(*v), angle).to_homogeneous() } @@ -13,7 +13,7 @@ pub fn scaling(v: &Vec) -> Mat { Matrix4::new_nonuniform_scaling(v) } -/// Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars. +/// A 4 * 4 translation matrix created from the scaling factor on each axis. pub fn translation(v: &Vec) -> Mat { Matrix4::new_translation(v) } diff --git a/nalgebra-glm/src/lib.rs b/nalgebra-glm/src/lib.rs index 89a29660..64d08e89 100644 --- a/nalgebra-glm/src/lib.rs +++ b/nalgebra-glm/src/lib.rs @@ -8,7 +8,7 @@ extern crate nalgebra as na; pub use aliases::*; pub use constructors::*; -pub use common::{abs, ceil, clamp, clamp2, clamp3, float_bits_to_int, float_bits_to_int_vec, float_bits_to_uint, float_bits_to_uint_vec, floor, fract, fract2, int_bits_to_float, int_bits_to_float_vec, mix, modf, modf_vec, round, sign, smoothstep, step, step_scalar, step_vec, trunc, uint_bits_to_float, uint_bits_to_float_scalar}; +pub use common::{abs, ceil, clamp, clamp2, clamp3, float_bits_to_int, float_bits_to_int_vec, float_bits_to_uint, float_bits_to_uint_vec, floor, fract, int_bits_to_float, int_bits_to_float_vec, mix, modf, modf_vec, round, sign, smoothstep, step, step_scalar, step_vec, trunc, uint_bits_to_float, uint_bits_to_float_scalar}; pub use geometric::{reflect_vec, cross, distance, dot, faceforward, length, magnitude, normalize, refract_vec}; pub use matrix::{transpose, determinant, inverse, matrix_comp_mult, outer_product}; pub use traits::{Dimension, Number, Alloc};