forked from M-Labs/nalgebra
Fix some comments.
This commit is contained in:
parent
eea13ffa7d
commit
2a6302cd54
@ -77,13 +77,8 @@ pub fn floor<N: Real, D: Dimension>(x: &Vec<N, D>) -> Vec<N, D>
|
|||||||
// a * b + c
|
// a * b + c
|
||||||
//}
|
//}
|
||||||
|
|
||||||
/// Returns the fractional part of `x`.
|
|
||||||
pub fn fract<N: Real>(x: N) -> N {
|
|
||||||
x.fract()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns the fractional part of each component of `x`.
|
/// Returns the fractional part of each component of `x`.
|
||||||
pub fn fract2<N: Real, D: Dimension>(x: &Vec<N, D>) -> Vec<N, D>
|
pub fn fract<N: Real, D: Dimension>(x: &Vec<N, D>) -> Vec<N, D>
|
||||||
where DefaultAllocator: Alloc<N, D> {
|
where DefaultAllocator: Alloc<N, D> {
|
||||||
x.map(|x| x.fract())
|
x.map(|x| x.fract())
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ use na::{Real, Unit, Rotation3, Matrix4, U3, U4};
|
|||||||
use traits::Number;
|
use traits::Number;
|
||||||
use aliases::{Vec, Mat};
|
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<N: Real>(angle: N, v: &Vec<N, U3>) -> Mat<N, U4, U4> {
|
pub fn rotation<N: Real>(angle: N, v: &Vec<N, U3>) -> Mat<N, U4, U4> {
|
||||||
Rotation3::from_axis_angle(&Unit::new_normalize(*v), angle).to_homogeneous()
|
Rotation3::from_axis_angle(&Unit::new_normalize(*v), angle).to_homogeneous()
|
||||||
}
|
}
|
||||||
@ -13,7 +13,7 @@ pub fn scaling<N: Number>(v: &Vec<N, U3>) -> Mat<N, U4, U4> {
|
|||||||
Matrix4::new_nonuniform_scaling(v)
|
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<N: Number>(v: &Vec<N, U3>) -> Mat<N, U4, U4> {
|
pub fn translation<N: Number>(v: &Vec<N, U3>) -> Mat<N, U4, U4> {
|
||||||
Matrix4::new_translation(v)
|
Matrix4::new_translation(v)
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ extern crate nalgebra as na;
|
|||||||
|
|
||||||
pub use aliases::*;
|
pub use aliases::*;
|
||||||
pub use constructors::*;
|
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 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 matrix::{transpose, determinant, inverse, matrix_comp_mult, outer_product};
|
||||||
pub use traits::{Dimension, Number, Alloc};
|
pub use traits::{Dimension, Number, Alloc};
|
||||||
|
Loading…
Reference in New Issue
Block a user