From 0dbe69ddb79e535d99c389cd05a55b7f4f671dc4 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Mon, 8 Oct 2018 09:42:02 +0700 Subject: [PATCH] Reformat parameter listings in docs. --- nalgebra-glm/src/ext/matrix_projection.rs | 75 ++++++++++--------- nalgebra-glm/src/ext/matrix_transform.rs | 71 ++++++++++-------- .../src/gtx/rotate_normalized_axis.rs | 18 +++-- 3 files changed, 91 insertions(+), 73 deletions(-) diff --git a/nalgebra-glm/src/ext/matrix_projection.rs b/nalgebra-glm/src/ext/matrix_projection.rs index b5d2f393..b8d2fc8d 100644 --- a/nalgebra-glm/src/ext/matrix_projection.rs +++ b/nalgebra-glm/src/ext/matrix_projection.rs @@ -4,10 +4,11 @@ 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 +/// # 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. 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, @@ -21,11 +22,12 @@ 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. +/// # Parameters: +/// +/// * `obj` - Specify the object coordinates. +/// * `model` - Specifies the current modelview matrix. +/// * `proj` - Specifies the current projection matrix. +/// * `viewport` - Specifies the current viewport. /// /// # See also: /// @@ -42,11 +44,12 @@ 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. +/// # Parameters: +/// +/// * `obj` - Specify the object coordinates. +/// * `model` - Specifies the current modelview matrix. +/// * `proj` - Specifies the current projection matrix. +/// * `viewport` - Specifies the current viewport. /// /// # See also: /// @@ -64,11 +67,12 @@ 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. +/// # Parameters: +/// +/// * `obj` - Specify the object coordinates. +/// * `model` - Specifies the current modelview matrix. +/// * `proj` - Specifies the current projection matrix. +/// * `viewport` - Specifies the current viewport. /// /// # See also: /// @@ -90,11 +94,12 @@ 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. +/// # 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. /// /// # See also: /// @@ -111,11 +116,12 @@ 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. +/// # 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. /// /// # See also: /// @@ -142,11 +148,12 @@ 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. +/// # 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. /// /// # See also: /// diff --git a/nalgebra-glm/src/ext/matrix_transform.rs b/nalgebra-glm/src/ext/matrix_transform.rs index 420718f9..af2408fd 100644 --- a/nalgebra-glm/src/ext/matrix_transform.rs +++ b/nalgebra-glm/src/ext/matrix_transform.rs @@ -11,10 +11,11 @@ pub fn identity() -> TMat /// Build a look at view matrix based on the right handedness. /// -/// # Parameters -/// * `eye` − Position of the camera -/// * `center` − Position where the camera is looking at -/// * `u` − Normalized up vector, how the camera is oriented. Typically `(0, 1, 0)` +/// # Parameters: +/// +/// * `eye` − Position of the camera. +/// * `center` − Position where the camera is looking at. +/// * `u` − Normalized up vector, how the camera is oriented. Typically `(0, 1, 0)`. /// /// # See also: /// @@ -26,10 +27,11 @@ pub fn look_at(eye: &TVec3, center: &TVec3, up: &TVec3) -> TMa /// Build a left handed look at view matrix. /// -/// # Parameters -/// * `eye` − Position of the camera -/// * `center` − Position where the camera is looking at -/// * `u` − Normalized up vector, how the camera is oriented. Typically `(0, 1, 0)` +/// # Parameters: +/// +/// * `eye` − Position of the camera. +/// * `center` − Position where the camera is looking at. +/// * `u` − Normalized up vector, how the camera is oriented. Typically `(0, 1, 0)`. /// /// # See also: /// @@ -41,10 +43,11 @@ pub fn look_at_lh(eye: &TVec3, center: &TVec3, up: &TVec3) -> /// Build a right handed look at view matrix. /// -/// # Parameters -/// * `eye` − Position of the camera -/// * `center` − Position where the camera is looking at -/// * `u` − Normalized up vector, how the camera is oriented. Typically `(0, 1, 0)` +/// # Parameters: +/// +/// * `eye` − Position of the camera. +/// * `center` − Position where the camera is looking at. +/// * `u` − Normalized up vector, how the camera is oriented. Typically `(0, 1, 0)`. /// /// # See also: /// @@ -56,10 +59,11 @@ pub fn look_at_rh(eye: &TVec3, center: &TVec3, up: &TVec3) -> /// Builds a rotation 4 * 4 matrix created from an axis vector and an angle and right-multiply it to `m`. /// -/// # Parameters -/// * `m` − Input matrix multiplied by this rotation matrix. -/// * `angle` − Rotation angle expressed in radians. -/// * `axis` − Rotation axis, recommended to be normalized. +/// # Parameters: +/// +/// * `m` − Input matrix multiplied by this rotation matrix. +/// * `angle` − Rotation angle expressed in radians. +/// * `axis` − Rotation axis, recommended to be normalized. /// /// # See also: /// @@ -74,9 +78,10 @@ pub fn rotate(m: &TMat4, angle: N, axis: &TVec3) -> TMat4 { /// Builds a rotation 4 * 4 matrix around the X axis and right-multiply it to `m`. /// -/// # Parameters -/// * `m` − Input matrix multiplied by this rotation matrix. -/// * `angle` − Rotation angle expressed in radians. +/// # Parameters: +/// +/// * `m` − Input matrix multiplied by this rotation matrix. +/// * `angle` − Rotation angle expressed in radians. /// /// # See also: /// @@ -91,9 +96,10 @@ pub fn rotate_x(m: &TMat4, angle: N) -> TMat4 { /// Builds a rotation 4 * 4 matrix around the Y axis and right-multiply it to `m`. /// -/// # Parameters -/// * `m` − Input matrix multiplied by this rotation matrix. -/// * `angle` − Rotation angle expressed in radians. +/// # Parameters: +/// +/// * `m` − Input matrix multiplied by this rotation matrix. +/// * `angle` − Rotation angle expressed in radians. /// /// # See also: /// @@ -108,9 +114,10 @@ pub fn rotate_y(m: &TMat4, angle: N) -> TMat4 { /// Builds a rotation 4 * 4 matrix around the Z axis and right-multiply it to `m`. /// -/// # Parameters -/// * `m` − Input matrix multiplied by this rotation matrix. -/// * `angle` − Rotation angle expressed in radians. +/// # Parameters: +/// +/// * `m` − Input matrix multiplied by this rotation matrix. +/// * `angle` − Rotation angle expressed in radians. /// /// # See also: /// @@ -125,9 +132,10 @@ pub fn rotate_z(m: &TMat4, angle: N) -> TMat4 { /// Builds a scale 4 * 4 matrix created from 3 scalars and right-multiply it to `m`. /// -/// # Parameters -/// * `m` − Input matrix multiplied by this scale matrix. -/// * `v` − Ratio of scaling for each axis. +/// # Parameters: +/// +/// * `m` − Input matrix multiplied by this scale matrix. +/// * `v` − Ratio of scaling for each axis. /// /// # See also: /// @@ -142,9 +150,10 @@ pub fn scale(m: &TMat4, v: &TVec3) -> TMat4 { /// Builds a translation 4 * 4 matrix created from a vector of 3 components and right-multiply it to `m`. /// -/// # Parameters -/// * `m` − Input matrix multiplied by this translation matrix. -/// * `v` − Coordinates of a translation vector. +/// # Parameters: +/// +/// * `m` − Input matrix multiplied by this translation matrix. +/// * `v` − Coordinates of a translation vector. /// /// # See also: /// diff --git a/nalgebra-glm/src/gtx/rotate_normalized_axis.rs b/nalgebra-glm/src/gtx/rotate_normalized_axis.rs index eff71376..1ac9a7dc 100644 --- a/nalgebra-glm/src/gtx/rotate_normalized_axis.rs +++ b/nalgebra-glm/src/gtx/rotate_normalized_axis.rs @@ -4,20 +4,22 @@ 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. +/// # Parameters: +/// +/// * `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() } /// 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. +/// # Parameters: +/// +/// * `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() }