From 96a2a568009e4301f1f1bc0a2f1da1062689724c Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Tue, 25 Sep 2018 10:07:53 +0700 Subject: [PATCH] Use 3 space indents to avoid triggering syntax highlighting. --- nalgebra-glm/src/ext/matrix_projection.rs | 54 +++++++++---------- .../src/gtx/rotate_normalized_axis.rs | 14 ++--- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/nalgebra-glm/src/ext/matrix_projection.rs b/nalgebra-glm/src/ext/matrix_projection.rs index 8b445b5f..bb6ae81b 100644 --- a/nalgebra-glm/src/ext/matrix_projection.rs +++ b/nalgebra-glm/src/ext/matrix_projection.rs @@ -5,9 +5,9 @@ use aliases::{TVec2, TVec3, TVec4, TMat4}; /// Define a picking region. /// /// # Parameters -/// * `center`: Specify the center of a picking region in window coordinates. -/// * `delta`: Specify the width and height, respectively, of the picking region in window coordinates. -/// * `viewport`: Rendering viewport +/// * `center`: Specify the center of a picking region in window coordinates. +/// * `delta`: Specify the width and height, respectively, of the picking region in window coordinates. +/// * `viewport`: Rendering viewport pub fn pick_matrix(center: &TVec2, delta: &TVec2, viewport: &TVec4) -> TMat4 { let shift = TVec3::new( (viewport.z - (center.x - viewport.x) * na::convert(2.0)) / delta.x, @@ -22,10 +22,10 @@ pub fn pick_matrix(center: &TVec2, delta: &TVec2, viewport: &TVec /// Map the specified object coordinates `(obj.x, obj.y, obj.z)` into window coordinates using OpenGL near and far clip planes definition. /// /// # Parameters -/// * `obj`: Specify the object coordinates. -/// * `model`: Specifies the current modelview matrix. -/// * `proj`: Specifies the current projection matrix. -/// * `viewport`: Specifies the current viewport. +/// * `obj`: Specify the object coordinates. +/// * `model`: Specifies the current modelview matrix. +/// * `proj`: Specifies the current projection matrix. +/// * `viewport`: Specifies the current viewport. pub fn project(obj: &TVec3, model: &TMat4, proj: &TMat4, viewport: TVec4) -> TVec3 { project_no(obj, model, proj, viewport) } @@ -35,10 +35,10 @@ pub fn project(obj: &TVec3, model: &TMat4, proj: &TMat4, viewp /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) /// /// # Parameters -/// * `obj`: Specify the object coordinates. -/// * `model`: Specifies the current modelview matrix. -/// * `proj`: Specifies the current projection matrix. -/// * `viewport`: Specifies the current viewport. +/// * `obj`: Specify the object coordinates. +/// * `model`: Specifies the current modelview matrix. +/// * `proj`: Specifies the current projection matrix. +/// * `viewport`: Specifies the current viewport. pub fn project_no(obj: &TVec3, model: &TMat4, proj: &TMat4, viewport: TVec4) -> TVec3 { let proj = project_zo(obj, model, proj, viewport); TVec3::new(proj.x, proj.y, proj.z * na::convert(0.5) + na::convert(0.5)) @@ -49,10 +49,10 @@ pub fn project_no(obj: &TVec3, model: &TMat4, proj: &TMat4, vi /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) /// /// # Parameters -/// * `obj`: Specify the object coordinates. -/// * `model`: Specifies the current modelview matrix. -/// * `proj`: Specifies the current projection matrix. -/// * `viewport`: Specifies the current viewport. +/// * `obj`: Specify the object coordinates. +/// * `model`: Specifies the current modelview matrix. +/// * `proj`: Specifies the current projection matrix. +/// * `viewport`: Specifies the current viewport. pub fn project_zo(obj: &TVec3, model: &TMat4, proj: &TMat4, viewport: TVec4) -> TVec3 { let normalized = proj * model * TVec4::new(obj.x, obj.y, obj.z, N::one()); let scale = N::one() / normalized.w; @@ -67,10 +67,10 @@ pub fn project_zo(obj: &TVec3, model: &TMat4, proj: &TMat4, vi /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates using OpenGL near and far clip planes definition. /// /// # Parameters -/// * `obj`: Specify the window coordinates to be mapped. -/// * `model`: Specifies the current modelview matrix. -/// * `proj`: Specifies the current projection matrix. -/// * `viewport`: Specifies the current viewport. +/// * `obj`: Specify the window coordinates to be mapped. +/// * `model`: Specifies the current modelview matrix. +/// * `proj`: Specifies the current projection matrix. +/// * `viewport`: Specifies the current viewport. pub fn unproject(win: &TVec3, model: &TMat4, proj: &TMat4, viewport: TVec4) -> TVec3 { unproject_no(win, model, proj, viewport) } @@ -80,10 +80,10 @@ pub fn unproject(win: &TVec3, model: &TMat4, proj: &TMat4, vie /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) /// /// # Parameters -/// * `obj`: Specify the window coordinates to be mapped. -/// * `model`: Specifies the current modelview matrix. -/// * `proj`: Specifies the current projection matrix. -/// * `viewport`: Specifies the current viewport. +/// * `obj`: Specify the window coordinates to be mapped. +/// * `model`: Specifies the current modelview matrix. +/// * `proj`: Specifies the current projection matrix. +/// * `viewport`: Specifies the current viewport. pub fn unproject_no(win: &TVec3, model: &TMat4, proj: &TMat4, viewport: TVec4) -> TVec3 { let _2: N = na::convert(2.0); let transform = (proj * model).try_inverse().unwrap_or(TMat4::zeros()); @@ -103,10 +103,10 @@ pub fn unproject_no(win: &TVec3, model: &TMat4, proj: &TMat4, /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) /// /// # Parameters -/// * `obj`: Specify the window coordinates to be mapped. -/// * `model`: Specifies the current modelview matrix. -/// * `proj`: Specifies the current projection matrix. -/// * `viewport`: Specifies the current viewport. +/// * `obj`: Specify the window coordinates to be mapped. +/// * `model`: Specifies the current modelview matrix. +/// * `proj`: Specifies the current projection matrix. +/// * `viewport`: Specifies the current viewport. pub fn unproject_zo(win: &TVec3, model: &TMat4, proj: &TMat4, viewport: TVec4) -> TVec3 { let _2: N = na::convert(2.0); let transform = (proj * model).try_inverse().unwrap_or(TMat4::zeros()); diff --git a/nalgebra-glm/src/gtx/rotate_normalized_axis.rs b/nalgebra-glm/src/gtx/rotate_normalized_axis.rs index 0a8d63fa..eff71376 100644 --- a/nalgebra-glm/src/gtx/rotate_normalized_axis.rs +++ b/nalgebra-glm/src/gtx/rotate_normalized_axis.rs @@ -5,9 +5,9 @@ use aliases::{Qua, TMat4, TVec3}; /// Builds a rotation 4 * 4 matrix created from a normalized axis and an angle. /// /// # Parameters -/// * `m` - Input matrix multiplied by this rotation matrix. -/// * `angle` - Rotation angle expressed in radians. -/// * `axis` - Rotation axis, must be normalized. +/// * `m` - Input matrix multiplied by this rotation matrix. +/// * `angle` - Rotation angle expressed in radians. +/// * `axis` - Rotation axis, must be normalized. pub fn rotate_normalized_axis(m: &TMat4, angle: N, axis: &TVec3) -> TMat4 { m * Rotation3::from_axis_angle(&Unit::new_unchecked(*axis), angle).to_homogeneous() } @@ -15,9 +15,9 @@ pub fn rotate_normalized_axis(m: &TMat4, angle: N, axis: &TVec3) /// Rotates a quaternion from a vector of 3 components normalized axis and an angle. /// /// # Parameters -/// * `q` - Source orientation -/// * `angle` - Angle expressed in radians. -/// * `axis` - Normalized axis of the rotation, must be normalized. +/// * `q` - Source orientation +/// * `angle` - Angle expressed in radians. +/// * `axis` - Normalized axis of the rotation, must be normalized. pub fn quat_rotate_normalized_axis(q: &Qua, angle: N, axis: &TVec3) -> Qua { q * UnitQuaternion::from_axis_angle(&Unit::new_unchecked(*axis), angle).unwrap() -} \ No newline at end of file +}