From ce0178785ca84bc2964b6198892c31f9956dc224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Fri, 9 Jan 2015 23:01:46 +0100 Subject: [PATCH] Fix automatic text replacement on comments. --- src/lib.rs | 22 +++++++------- src/structs/iso.rs | 12 ++++---- src/structs/ortho.rs | 4 +-- src/structs/persp.rs | 4 +-- src/structs/pnt.rs | 64 +++++++++++++++++++-------------------- src/structs/pnt_macros.rs | 4 +-- src/structs/rot.rs | 10 +++--- src/traits/geometry.rs | 18 +++++------ src/traits/operations.rs | 2 +- src/traits/structure.rs | 26 ++++++++-------- 10 files changed, 83 insertions(+), 83 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 890879fa..fb1af57b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -42,7 +42,7 @@ fn main() { an optimized set of tools for computer graphics and physics. Those features include: * Vectors with static sizes: `Vec0`, `Vec1`, `Vec2`, `Vec3`, `Vec4`, `Vec5`, `Vec6`. -* Poisizes with static sizes: `Pnt0`, `Pnt1`, `Pnt2`, `Pnt3`, `Pnt4`, `Pnt5`, `Pnt6`. +* Points with static sizes: `Pnt0`, `Pnt1`, `Pnt2`, `Pnt3`, `Pnt4`, `Pnt5`, `Pnt6`. * Square matrices with static sizes: `Mat1`, `Mat2`, `Mat3`, `Mat4`, `Mat5`, `Mat6 `. * Rotation matrices: `Rot2`, `Rot3`, `Rot4`. * Quaternions: `Quat`, `UnitQuat`. @@ -315,7 +315,7 @@ pub fn orig() -> P { Orig::orig() } -/// Returns the center of two poisizes. +/// Returns the center of two points. #[inline] pub fn center, V: Copy>(a: &P, b: &P) -> P { let _2 = one::() + one(); @@ -325,13 +325,13 @@ pub fn center, V: Copy>(a: &P, b: &P) -> P { /* * FloatPnt */ -/// Returns the distance between two poisizes. +/// Returns the distance between two points. #[inline(always)] pub fn dist, V: Norm>(a: &P, b: &P) -> N { a.dist(b) } -/// Returns the squared distance between two poisizes. +/// Returns the squared distance between two points. #[inline(always)] pub fn sqdist, V: Norm>(a: &P, b: &P) -> N { a.sqdist(b) @@ -409,7 +409,7 @@ pub fn append_translation>(m: &M, v: &V) -> M { * Translate

*/ -/// Applies a translation to a poisize. +/// Applies a translation to a point. /// /// ```rust /// extern crate "nalgebra" as na; @@ -429,7 +429,7 @@ pub fn translate>(m: &M, p: &P) -> P { m.translate(p) } -/// Applies an inverse translation to a poisize. +/// Applies an inverse translation to a point. /// /// ```rust /// extern crate "nalgebra" as na; @@ -576,18 +576,18 @@ pub fn inv_rotate>(m: &M, v: &V) -> V { * RotationWithTranslation */ -/// Rotates a copy of `m` by `amount` using `center` as the pivot poisize. +/// Rotates a copy of `m` by `amount` using `center` as the pivot point. #[inline(always)] -pub fn append_rotation_wrt_poisize + Copy, +pub fn append_rotation_wrt_point + Copy, AV, M: RotationWithTranslation>( m: &M, amount: &AV, center: &LV) -> M { - RotationWithTranslation::append_rotation_wrt_poisize_cpy(m, amount, center) + RotationWithTranslation::append_rotation_wrt_point_cpy(m, amount, center) } -/// Rotates a copy of `m` by `amount` using `m.translation()` as the pivot poisize. +/// Rotates a copy of `m` by `amount` using `m.translation()` as the pivot point. #[inline(always)] pub fn append_rotation_wrt_center + Copy, AV, @@ -745,7 +745,7 @@ pub fn from_homogeneous>(m: &M) -> Res { /// Samples the unit sphere living on the dimension as the samples types. /// -/// The number of sampling poisize is implementation-specific. It is always uniform. +/// The number of sampling point is implementation-specific. It is always uniform. #[inline(always)] pub fn sample_sphere(f: F) { UniformSphereSample::sample(f) diff --git a/src/structs/iso.rs b/src/structs/iso.rs index 9dc72adf..1005cb96 100644 --- a/src/structs/iso.rs +++ b/src/structs/iso.rs @@ -52,29 +52,29 @@ pub struct Iso4 { } impl Iso3 { - /// Reorient and translate this transformation such that its local `x` axis poisizes to a given + /// Reorient and translate this transformation such that its local `x` axis points to a given /// direction. Note that the usually known `look_at` function does the same thing but with the /// `z` axis. See `look_at_z` for that. /// /// # Arguments /// * eye - The new translation of the transformation. - /// * at - The poisize to look at. `at - eye` is the direction the matrix `x` axis will be + /// * at - The point to look at. `at - eye` is the direction the matrix `x` axis will be /// aligned with. - /// * up - Vector poisizeing up. The only requirement of this parameter is to not be colinear + /// * up - Vector pointing up. The only requirement of this parameter is to not be colinear /// with `at`. Non-colinearity is not checked. pub fn look_at(&mut self, eye: &Pnt3, at: &Pnt3, up: &Vec3) { self.rotation.look_at(&(*at - *eye), up); self.translation = eye.as_vec().clone(); } - /// Reorient and translate this transformation such that its local `z` axis poisizes to a given + /// Reorient and translate this transformation such that its local `z` axis points to a given /// direction. /// /// # Arguments /// * eye - The new translation of the transformation. - /// * at - The poisize to look at. `at - eye` is the direction the matrix `x` axis will be + /// * at - The point to look at. `at - eye` is the direction the matrix `x` axis will be /// aligned with - /// * up - Vector poisizeing `up`. The only requirement of this parameter is to not be colinear + /// * up - Vector pointing `up`. The only requirement of this parameter is to not be colinear /// with `at`. Non-colinearity is not checked. pub fn look_at_z(&mut self, eye: &Pnt3, at: &Pnt3, up: &Vec3) { self.rotation.look_at_z(&(*at - *eye), up); diff --git a/src/structs/ortho.rs b/src/structs/ortho.rs index dc500561..fd030bec 100644 --- a/src/structs/ortho.rs +++ b/src/structs/ortho.rs @@ -96,7 +96,7 @@ impl Ortho3 { self.zfar = zfar } - /// Projects a poisize. + /// Projects a point. #[inline] pub fn project_pnt(&self, p: &Pnt3) -> Pnt3 { // FIXME: optimize that @@ -204,7 +204,7 @@ impl OrthoMat3 { self.mat.m34 = -(zfar + znear) / (zfar - znear); } - /// Projects a poisize. + /// Projects a point. #[inline] pub fn project_pnt(&self, p: &Pnt3) -> Pnt3 { Pnt3::new( diff --git a/src/structs/persp.rs b/src/structs/persp.rs index dc43beb0..b4b98d70 100644 --- a/src/structs/persp.rs +++ b/src/structs/persp.rs @@ -102,7 +102,7 @@ impl Persp3 { self.zfar = zfar; } - /// Projects a poisize. + /// Projects a point. #[inline] pub fn project_pnt(&self, p: &Pnt3) -> Pnt3 { // FIXME: optimize that @@ -231,7 +231,7 @@ impl PerspMat3 { self.mat.m34 = zfar * znear * _2 / (znear - zfar); } - /// Projects a poisize. + /// Projects a point. #[inline] pub fn project_pnt(&self, p: &Pnt3) -> Pnt3 { let _1: N = ::one(); diff --git a/src/structs/pnt.rs b/src/structs/pnt.rs index 528e4737..cf9f2aee 100644 --- a/src/structs/pnt.rs +++ b/src/structs/pnt.rs @@ -1,6 +1,6 @@ -//! Poisizes with dimensions known at compile-time. +//! Points with dimensions known at compile-time. -#![allow(missing_docs)] // we allow missing to avoid having to document the poisize components. +#![allow(missing_docs)] // we allow missing to avoid having to document the point components. use std::mem; use std::slice::{Iter, IterMut}; @@ -14,28 +14,28 @@ use traits::geometry::{Orig, FromHomogeneous, ToHomogeneous}; use structs::vec::{Vec1, Vec2, Vec3, Vec4, Vec5, Vec6}; -/// Poisize of dimension 0. +/// Point of dimension 0. #[derive(Eq, PartialEq, RustcDecodable, Clone, Rand, Show, Copy)] pub struct Pnt0; impl Pnt0 { - /// Creates a new poisize. + /// Creates a new point. #[inline] pub fn new() -> Pnt0 { Pnt0 } - /// Creates a new poisize. The parameter is not taken in account. + /// Creates a new point. The parameter is not taken in account. #[inline] pub fn new_repeat(_: N) -> Pnt0 { Pnt0 } } -/// Poisize of dimension 1. +/// Point of dimension 1. #[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] pub struct Pnt1 { - /// First component of the poisize. + /// First component of the point. pub x: N } @@ -70,12 +70,12 @@ pnt_to_homogeneous_impl!(Pnt1, Pnt2, y, x); pnt_from_homogeneous_impl!(Pnt1, Pnt2, y, x); num_float_pnt_impl!(Pnt1, Vec1); -/// Poisize of dimension 2. +/// Point of dimension 2. #[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] pub struct Pnt2 { - /// First component of the poisize. + /// First component of the point. pub x: N, - /// Second component of the poisize. + /// Second component of the point. pub y: N } @@ -110,14 +110,14 @@ pnt_to_homogeneous_impl!(Pnt2, Pnt3, z, x, y); pnt_from_homogeneous_impl!(Pnt2, Pnt3, z, x, y); num_float_pnt_impl!(Pnt2, Vec2); -/// Poisize of dimension 3. +/// Point of dimension 3. #[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] pub struct Pnt3 { - /// First component of the poisize. + /// First component of the point. pub x: N, - /// Second component of the poisize. + /// Second component of the point. pub y: N, - /// Third component of the poisize. + /// Third component of the point. pub z: N } @@ -152,16 +152,16 @@ pnt_to_homogeneous_impl!(Pnt3, Pnt4, w, x, y, z); pnt_from_homogeneous_impl!(Pnt3, Pnt4, w, x, y, z); num_float_pnt_impl!(Pnt3, Vec3); -/// Poisize of dimension 4. +/// Point of dimension 4. #[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] pub struct Pnt4 { - /// First component of the poisize. + /// First component of the point. pub x: N, - /// Second component of the poisize. + /// Second component of the point. pub y: N, - /// Third component of the poisize. + /// Third component of the point. pub z: N, - /// Fourth component of the poisize. + /// Fourth component of the point. pub w: N } @@ -196,18 +196,18 @@ pnt_to_homogeneous_impl!(Pnt4, Pnt5, a, x, y, z, w); pnt_from_homogeneous_impl!(Pnt4, Pnt5, a, x, y, z, w); num_float_pnt_impl!(Pnt4, Vec4); -/// Poisize of dimension 5. +/// Point of dimension 5. #[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] pub struct Pnt5 { - /// First component of the poisize. + /// First component of the point. pub x: N, - /// Second component of the poisize. + /// Second component of the point. pub y: N, - /// Third component of the poisize. + /// Third component of the point. pub z: N, - /// Fourth component of the poisize. + /// Fourth component of the point. pub w: N, - /// Fifth of the poisize. + /// Fifth of the point. pub a: N } @@ -242,20 +242,20 @@ pnt_to_homogeneous_impl!(Pnt5, Pnt6, b, x, y, z, w, a); pnt_from_homogeneous_impl!(Pnt5, Pnt6, b, x, y, z, w, a); num_float_pnt_impl!(Pnt5, Vec5); -/// Poisize of dimension 6. +/// Point of dimension 6. #[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] pub struct Pnt6 { - /// First component of the poisize. + /// First component of the point. pub x: N, - /// Second component of the poisize. + /// Second component of the point. pub y: N, - /// Third component of the poisize. + /// Third component of the point. pub z: N, - /// Fourth component of the poisize. + /// Fourth component of the point. pub w: N, - /// Fifth of the poisize. + /// Fifth of the point. pub a: N, - /// Sixth component of the poisize. + /// Sixth component of the point. pub b: N } diff --git a/src/structs/pnt_macros.rs b/src/structs/pnt_macros.rs index e9d40e0f..f026a246 100644 --- a/src/structs/pnt_macros.rs +++ b/src/structs/pnt_macros.rs @@ -60,7 +60,7 @@ macro_rules! pnt_sub_vec_impl( macro_rules! pnt_as_vec_impl( ($t: ident, $tv: ident, $($compN: ident),+) => ( impl $t { - /// Converts this poisize to its associated vector. + /// Converts this point to its associated vector. #[inline] pub fn to_vec(self) -> $tv { $tv::new( @@ -68,7 +68,7 @@ macro_rules! pnt_as_vec_impl( ) } - /// Converts a reference to this poisize to a reference to its associated vector. + /// Converts a reference to this point to a reference to its associated vector. #[inline] pub fn as_vec<'a>(&'a self) -> &'a $tv { unsafe { diff --git a/src/structs/rot.rs b/src/structs/rot.rs index 384cf2c4..a87ce47c 100644 --- a/src/structs/rot.rs +++ b/src/structs/rot.rs @@ -167,14 +167,14 @@ impl Rot3 { } impl Rot3 { - /// Reorient this matrix such that its local `x` axis poisizes to a given poisize. Note that the + /// Reorient this matrix such that its local `x` axis points to a given point. Note that the /// usually known `look_at` function does the same thing but with the `z` axis. See `look_at_z` /// for that. /// /// # Arguments - /// * at - The poisize to look at. It is also the direction the matrix `x` axis will be aligned + /// * at - The point to look at. It is also the direction the matrix `x` axis will be aligned /// with - /// * up - Vector poisizeing `up`. The only requirement of this parameter is to not be colinear + /// * up - Vector pointing `up`. The only requirement of this parameter is to not be colinear /// with `at`. Non-colinearity is not checked. pub fn look_at(&mut self, at: &Vec3, up: &Vec3) { let xaxis = Norm::normalize_cpy(at); @@ -187,11 +187,11 @@ impl Rot3 { xaxis.z , yaxis.z , zaxis.z) } - /// Reorient this matrix such that its local `z` axis poisizes to a given poisize. + /// Reorient this matrix such that its local `z` axis points to a given point. /// /// # Arguments /// * at - The look direction, that is, direction the matrix `y` axis will be aligned with - /// * up - Vector poisizeing `up`. The only requirement of this parameter is to not be colinear + /// * up - Vector pointing `up`. The only requirement of this parameter is to not be colinear /// with `at`. Non-colinearity is not checked. pub fn look_at_z(&mut self, at: &Vec3, up: &Vec3) { let zaxis = Norm::normalize_cpy(at); diff --git a/src/traits/geometry.rs b/src/traits/geometry.rs index e5c1d67b..f797db14 100644 --- a/src/traits/geometry.rs +++ b/src/traits/geometry.rs @@ -30,7 +30,7 @@ pub trait Translation { } /// Trait of objects able to translate other objects. This is typically -/// implemented by vectors to translate poisizes. +/// implemented by vectors to translate points. pub trait Translate { /// Apply a translation to an object. fn translate(&self, &V) -> V; @@ -77,20 +77,20 @@ pub trait Rotate { /// Various composition of rotation and translation. /// -/// Utilities to make rotations with regard to a poisize different than the origin. All those +/// Utilities to make rotations with regard to a point different than the origin. All those /// operations are the composition of rotations and translations. /// /// Those operations are automatically implemented in term of the `Rotation` and `Translation` /// traits. pub trait RotationWithTranslation + Copy, AV>: Rotation + Translation + Sized { - /// Applies a rotation centered on a specific poisize. + /// Applies a rotation centered on a specific point. /// /// # Arguments /// * `t` - the object to be rotated. /// * `amount` - the rotation to apply. - /// * `poisize` - the center of rotation. + /// * `point` - the center of rotation. #[inline] - fn append_rotation_wrt_poisize_cpy(&self, amount: &AV, center: &LV) -> Self { + fn append_rotation_wrt_point_cpy(&self, amount: &AV, center: &LV) -> Self { let mut res = Translation::append_translation_cpy(self, &-*center); res.append_rotation(amount); @@ -107,7 +107,7 @@ pub trait RotationWithTranslation + Copy, AV>: Rotation /// * `amount` - the rotation to be applied /// * `center` - the new center of rotation #[inline] - fn append_rotation_wrt_poisize(&mut self, amount: &AV, center: &LV) { + fn append_rotation_wrt_point(&mut self, amount: &AV, center: &LV) { self.append_translation(&-*center); self.append_rotation(amount); self.append_translation(center); @@ -120,7 +120,7 @@ pub trait RotationWithTranslation + Copy, AV>: Rotation /// * `amount` - the rotation to apply. #[inline] fn append_rotation_wrt_center_cpy(&self, amount: &AV) -> Self { - RotationWithTranslation::append_rotation_wrt_poisize_cpy(self, amount, &self.translation()) + RotationWithTranslation::append_rotation_wrt_point_cpy(self, amount, &self.translation()) } /// Applies a rotation centered on the translation of `m`. @@ -132,7 +132,7 @@ pub trait RotationWithTranslation + Copy, AV>: Rotation #[inline] fn append_rotation_wrt_center(&mut self, amount: &AV) { let center = self.translation(); - self.append_rotation_wrt_poisize(amount, ¢er) + self.append_rotation_wrt_point(amount, ¢er) } } @@ -274,6 +274,6 @@ pub trait UniformSphereSample { pub trait Orig { /// The trivial origin. fn orig() -> Self; - /// Returns true if this poisizes is exactly the trivial origin. + /// Returns true if this points is exactly the trivial origin. fn is_orig(&self) -> bool; } diff --git a/src/traits/operations.rs b/src/traits/operations.rs index b04e5f47..14e0845f 100644 --- a/src/traits/operations.rs +++ b/src/traits/operations.rs @@ -71,7 +71,7 @@ impl POrdering { } } -/// Poisizewise ordering operations. +/// Pointwise ordering operations. pub trait POrd { /// Returns the infimum of this value and another fn inf(&self, other: &Self) -> Self; diff --git a/src/traits/structure.rs b/src/traits/structure.rs index 4fd20c7d..b84e5e2d 100644 --- a/src/traits/structure.rs +++ b/src/traits/structure.rs @@ -16,7 +16,7 @@ pub trait BaseNum: Copy + Zero + One + Absolute + Axpy { } -/// Basic floating-poisize number numeric trait. +/// Basic floating-point number numeric trait. pub trait BaseFloat: Float + BaseNum { /// Archimedes' constant. fn pi() -> Self; @@ -226,13 +226,13 @@ pub trait IterableMut { /* * Vec related traits. */ -/// Trait that relates a poisize of an affine space to a vector of the associated vector space. -#[deprecated = "This will be removed in the future. Use poisize + vector operations instead."] +/// Trait that relates a point of an affine space to a vector of the associated vector space. +#[deprecated = "This will be removed in the future. Use point + vector operations instead."] pub trait VecAsPnt

{ - /// Converts this poisize to its associated vector. + /// Converts this point to its associated vector. fn to_pnt(self) -> P; - /// Converts a reference to this poisize to a reference to its associated vector. + /// Converts a reference to this point to a reference to its associated vector. fn as_pnt<'a>(&'a self) -> &'a P; } @@ -252,21 +252,21 @@ pub trait FloatVec: NumVec + Norm + Basis { /* * Pnt related traits. */ -/// Trait that relates a poisize of an affine space to a vector of the associated vector space. +/// Trait that relates a point of an affine space to a vector of the associated vector space. pub trait PntAsVec { - /// Converts this poisize to its associated vector. + /// Converts this point to its associated vector. fn to_vec(self) -> V; - /// Converts a reference to this poisize to a reference to its associated vector. + /// Converts a reference to this point to a reference to its associated vector. fn as_vec<'a>(&'a self) -> &'a V; // NOTE: this is used in some places to overcome some limitations untill the trait reform is // done on rustc. - /// Sets the coordinates of this poisize to match those of a given vector. + /// Sets the coordinates of this point to match those of a given vector. fn set_coords(&mut self, coords: V); } -/// Trait grouping most common operations on poisizes. +/// Trait grouping most common operations on points. // XXX: the vector space element `V` should be an associated type. Though this would prevent V from // having bounds (they are not supported yet). So, for now, we will just use a type parameter. pub trait NumPnt: @@ -284,15 +284,15 @@ pub trait NumPnt: Index { // FIXME: + Sub } -/// Trait of poisizes with components implementing the `BaseFloat` trait. +/// Trait of points with components implementing the `BaseFloat` trait. pub trait FloatPnt>: NumPnt + Sized { - /// Computes the square distance between two poisizes. + /// Computes the square distance between two points. #[inline] fn sqdist(&self, other: &Self) -> N { (*self - *other).sqnorm() } - /// Computes the distance between two poisizes. + /// Computes the distance between two points. #[inline] fn dist(&self, other: &Self) -> N { (*self - *other).norm()