forked from M-Labs/nalgebra
Reformat parameter listings in docs.
This commit is contained in:
parent
e7610196b6
commit
0dbe69ddb7
@ -4,10 +4,11 @@ use aliases::{TVec2, TVec3, TVec4, TMat4};
|
|||||||
|
|
||||||
/// Define a picking region.
|
/// Define a picking region.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
|
///
|
||||||
/// * `center` - Specify the center of a picking region in window coordinates.
|
/// * `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.
|
/// * `delta` - Specify the width and height, respectively, of the picking region in window coordinates.
|
||||||
/// * `viewport` - Rendering viewport
|
/// * `viewport` - Rendering viewport.
|
||||||
pub fn pick_matrix<N: Real>(center: &TVec2<N>, delta: &TVec2<N>, viewport: &TVec4<N>) -> TMat4<N> {
|
pub fn pick_matrix<N: Real>(center: &TVec2<N>, delta: &TVec2<N>, viewport: &TVec4<N>) -> TMat4<N> {
|
||||||
let shift = TVec3::new(
|
let shift = TVec3::new(
|
||||||
(viewport.z - (center.x - viewport.x) * na::convert(2.0)) / delta.x,
|
(viewport.z - (center.x - viewport.x) * na::convert(2.0)) / delta.x,
|
||||||
@ -21,7 +22,8 @@ pub fn pick_matrix<N: Real>(center: &TVec2<N>, delta: &TVec2<N>, viewport: &TVec
|
|||||||
|
|
||||||
/// Map the specified object coordinates `(obj.x, obj.y, obj.z)` into window coordinates using OpenGL near and far clip planes definition.
|
/// Map the specified object coordinates `(obj.x, obj.y, obj.z)` into window coordinates using OpenGL near and far clip planes definition.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
|
///
|
||||||
/// * `obj` - Specify the object coordinates.
|
/// * `obj` - Specify the object coordinates.
|
||||||
/// * `model` - Specifies the current modelview matrix.
|
/// * `model` - Specifies the current modelview matrix.
|
||||||
/// * `proj` - Specifies the current projection matrix.
|
/// * `proj` - Specifies the current projection matrix.
|
||||||
@ -42,7 +44,8 @@ pub fn project<N: Real>(obj: &TVec3<N>, model: &TMat4<N>, proj: &TMat4<N>, viewp
|
|||||||
///
|
///
|
||||||
/// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
|
/// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
|
///
|
||||||
/// * `obj` - Specify the object coordinates.
|
/// * `obj` - Specify the object coordinates.
|
||||||
/// * `model` - Specifies the current modelview matrix.
|
/// * `model` - Specifies the current modelview matrix.
|
||||||
/// * `proj` - Specifies the current projection matrix.
|
/// * `proj` - Specifies the current projection matrix.
|
||||||
@ -64,7 +67,8 @@ pub fn project_no<N: Real>(obj: &TVec3<N>, model: &TMat4<N>, proj: &TMat4<N>, vi
|
|||||||
///
|
///
|
||||||
/// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
|
/// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
|
///
|
||||||
/// * `obj` - Specify the object coordinates.
|
/// * `obj` - Specify the object coordinates.
|
||||||
/// * `model` - Specifies the current modelview matrix.
|
/// * `model` - Specifies the current modelview matrix.
|
||||||
/// * `proj` - Specifies the current projection matrix.
|
/// * `proj` - Specifies the current projection matrix.
|
||||||
@ -90,7 +94,8 @@ pub fn project_zo<N: Real>(obj: &TVec3<N>, model: &TMat4<N>, proj: &TMat4<N>, vi
|
|||||||
|
|
||||||
/// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates using OpenGL near and far clip planes definition.
|
/// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates using OpenGL near and far clip planes definition.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
|
///
|
||||||
/// * `obj` - Specify the window coordinates to be mapped.
|
/// * `obj` - Specify the window coordinates to be mapped.
|
||||||
/// * `model` - Specifies the current modelview matrix.
|
/// * `model` - Specifies the current modelview matrix.
|
||||||
/// * `proj` - Specifies the current projection matrix.
|
/// * `proj` - Specifies the current projection matrix.
|
||||||
@ -111,7 +116,8 @@ pub fn unproject<N: Real>(win: &TVec3<N>, model: &TMat4<N>, proj: &TMat4<N>, vie
|
|||||||
///
|
///
|
||||||
/// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
|
/// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
|
///
|
||||||
/// * `obj` - Specify the window coordinates to be mapped.
|
/// * `obj` - Specify the window coordinates to be mapped.
|
||||||
/// * `model` - Specifies the current modelview matrix.
|
/// * `model` - Specifies the current modelview matrix.
|
||||||
/// * `proj` - Specifies the current projection matrix.
|
/// * `proj` - Specifies the current projection matrix.
|
||||||
@ -142,7 +148,8 @@ pub fn unproject_no<N: Real>(win: &TVec3<N>, model: &TMat4<N>, proj: &TMat4<N>,
|
|||||||
///
|
///
|
||||||
/// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
|
/// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
|
///
|
||||||
/// * `obj` - Specify the window coordinates to be mapped.
|
/// * `obj` - Specify the window coordinates to be mapped.
|
||||||
/// * `model` - Specifies the current modelview matrix.
|
/// * `model` - Specifies the current modelview matrix.
|
||||||
/// * `proj` - Specifies the current projection matrix.
|
/// * `proj` - Specifies the current projection matrix.
|
||||||
|
@ -11,10 +11,11 @@ pub fn identity<N: Number, D: Dimension>() -> TMat<N, D, D>
|
|||||||
|
|
||||||
/// Build a look at view matrix based on the right handedness.
|
/// Build a look at view matrix based on the right handedness.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
/// * `eye` − Position of the camera
|
///
|
||||||
/// * `center` − Position where the camera is looking at
|
/// * `eye` − Position of the camera.
|
||||||
/// * `u` − Normalized up vector, how the camera is oriented. Typically `(0, 1, 0)`
|
/// * `center` − Position where the camera is looking at.
|
||||||
|
/// * `u` − Normalized up vector, how the camera is oriented. Typically `(0, 1, 0)`.
|
||||||
///
|
///
|
||||||
/// # See also:
|
/// # See also:
|
||||||
///
|
///
|
||||||
@ -26,10 +27,11 @@ pub fn look_at<N: Real>(eye: &TVec3<N>, center: &TVec3<N>, up: &TVec3<N>) -> TMa
|
|||||||
|
|
||||||
/// Build a left handed look at view matrix.
|
/// Build a left handed look at view matrix.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
/// * `eye` − Position of the camera
|
///
|
||||||
/// * `center` − Position where the camera is looking at
|
/// * `eye` − Position of the camera.
|
||||||
/// * `u` − Normalized up vector, how the camera is oriented. Typically `(0, 1, 0)`
|
/// * `center` − Position where the camera is looking at.
|
||||||
|
/// * `u` − Normalized up vector, how the camera is oriented. Typically `(0, 1, 0)`.
|
||||||
///
|
///
|
||||||
/// # See also:
|
/// # See also:
|
||||||
///
|
///
|
||||||
@ -41,10 +43,11 @@ pub fn look_at_lh<N: Real>(eye: &TVec3<N>, center: &TVec3<N>, up: &TVec3<N>) ->
|
|||||||
|
|
||||||
/// Build a right handed look at view matrix.
|
/// Build a right handed look at view matrix.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
/// * `eye` − Position of the camera
|
///
|
||||||
/// * `center` − Position where the camera is looking at
|
/// * `eye` − Position of the camera.
|
||||||
/// * `u` − Normalized up vector, how the camera is oriented. Typically `(0, 1, 0)`
|
/// * `center` − Position where the camera is looking at.
|
||||||
|
/// * `u` − Normalized up vector, how the camera is oriented. Typically `(0, 1, 0)`.
|
||||||
///
|
///
|
||||||
/// # See also:
|
/// # See also:
|
||||||
///
|
///
|
||||||
@ -56,7 +59,8 @@ pub fn look_at_rh<N: Real>(eye: &TVec3<N>, center: &TVec3<N>, up: &TVec3<N>) ->
|
|||||||
|
|
||||||
/// Builds a rotation 4 * 4 matrix created from an axis vector and an angle and right-multiply it to `m`.
|
/// Builds a rotation 4 * 4 matrix created from an axis vector and an angle and right-multiply it to `m`.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
|
///
|
||||||
/// * `m` − Input matrix multiplied by this rotation matrix.
|
/// * `m` − Input matrix multiplied by this rotation matrix.
|
||||||
/// * `angle` − Rotation angle expressed in radians.
|
/// * `angle` − Rotation angle expressed in radians.
|
||||||
/// * `axis` − Rotation axis, recommended to be normalized.
|
/// * `axis` − Rotation axis, recommended to be normalized.
|
||||||
@ -74,7 +78,8 @@ pub fn rotate<N: Real>(m: &TMat4<N>, angle: N, axis: &TVec3<N>) -> TMat4<N> {
|
|||||||
|
|
||||||
/// Builds a rotation 4 * 4 matrix around the X axis and right-multiply it to `m`.
|
/// Builds a rotation 4 * 4 matrix around the X axis and right-multiply it to `m`.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
|
///
|
||||||
/// * `m` − Input matrix multiplied by this rotation matrix.
|
/// * `m` − Input matrix multiplied by this rotation matrix.
|
||||||
/// * `angle` − Rotation angle expressed in radians.
|
/// * `angle` − Rotation angle expressed in radians.
|
||||||
///
|
///
|
||||||
@ -91,7 +96,8 @@ pub fn rotate_x<N: Real>(m: &TMat4<N>, angle: N) -> TMat4<N> {
|
|||||||
|
|
||||||
/// Builds a rotation 4 * 4 matrix around the Y axis and right-multiply it to `m`.
|
/// Builds a rotation 4 * 4 matrix around the Y axis and right-multiply it to `m`.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
|
///
|
||||||
/// * `m` − Input matrix multiplied by this rotation matrix.
|
/// * `m` − Input matrix multiplied by this rotation matrix.
|
||||||
/// * `angle` − Rotation angle expressed in radians.
|
/// * `angle` − Rotation angle expressed in radians.
|
||||||
///
|
///
|
||||||
@ -108,7 +114,8 @@ pub fn rotate_y<N: Real>(m: &TMat4<N>, angle: N) -> TMat4<N> {
|
|||||||
|
|
||||||
/// Builds a rotation 4 * 4 matrix around the Z axis and right-multiply it to `m`.
|
/// Builds a rotation 4 * 4 matrix around the Z axis and right-multiply it to `m`.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
|
///
|
||||||
/// * `m` − Input matrix multiplied by this rotation matrix.
|
/// * `m` − Input matrix multiplied by this rotation matrix.
|
||||||
/// * `angle` − Rotation angle expressed in radians.
|
/// * `angle` − Rotation angle expressed in radians.
|
||||||
///
|
///
|
||||||
@ -125,7 +132,8 @@ pub fn rotate_z<N: Real>(m: &TMat4<N>, angle: N) -> TMat4<N> {
|
|||||||
|
|
||||||
/// Builds a scale 4 * 4 matrix created from 3 scalars and right-multiply it to `m`.
|
/// Builds a scale 4 * 4 matrix created from 3 scalars and right-multiply it to `m`.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
|
///
|
||||||
/// * `m` − Input matrix multiplied by this scale matrix.
|
/// * `m` − Input matrix multiplied by this scale matrix.
|
||||||
/// * `v` − Ratio of scaling for each axis.
|
/// * `v` − Ratio of scaling for each axis.
|
||||||
///
|
///
|
||||||
@ -142,7 +150,8 @@ pub fn scale<N: Number>(m: &TMat4<N>, v: &TVec3<N>) -> TMat4<N> {
|
|||||||
|
|
||||||
/// Builds a translation 4 * 4 matrix created from a vector of 3 components and right-multiply it to `m`.
|
/// Builds a translation 4 * 4 matrix created from a vector of 3 components and right-multiply it to `m`.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
|
///
|
||||||
/// * `m` − Input matrix multiplied by this translation matrix.
|
/// * `m` − Input matrix multiplied by this translation matrix.
|
||||||
/// * `v` − Coordinates of a translation vector.
|
/// * `v` − Coordinates of a translation vector.
|
||||||
///
|
///
|
||||||
|
@ -4,7 +4,8 @@ use aliases::{Qua, TMat4, TVec3};
|
|||||||
|
|
||||||
/// Builds a rotation 4 * 4 matrix created from a normalized axis and an angle.
|
/// Builds a rotation 4 * 4 matrix created from a normalized axis and an angle.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
|
///
|
||||||
/// * `m` - Input matrix multiplied by this rotation matrix.
|
/// * `m` - Input matrix multiplied by this rotation matrix.
|
||||||
/// * `angle` - Rotation angle expressed in radians.
|
/// * `angle` - Rotation angle expressed in radians.
|
||||||
/// * `axis` - Rotation axis, must be normalized.
|
/// * `axis` - Rotation axis, must be normalized.
|
||||||
@ -14,8 +15,9 @@ pub fn rotate_normalized_axis<N: Real>(m: &TMat4<N>, angle: N, axis: &TVec3<N>)
|
|||||||
|
|
||||||
/// Rotates a quaternion from a vector of 3 components normalized axis and an angle.
|
/// Rotates a quaternion from a vector of 3 components normalized axis and an angle.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters:
|
||||||
/// * `q` - Source orientation
|
///
|
||||||
|
/// * `q` - Source orientation.
|
||||||
/// * `angle` - Angle expressed in radians.
|
/// * `angle` - Angle expressed in radians.
|
||||||
/// * `axis` - Normalized axis of the rotation, must be normalized.
|
/// * `axis` - Normalized axis of the rotation, must be normalized.
|
||||||
pub fn quat_rotate_normalized_axis<N: Real>(q: &Qua<N>, angle: N, axis: &TVec3<N>) -> Qua<N> {
|
pub fn quat_rotate_normalized_axis<N: Real>(q: &Qua<N>, angle: N, axis: &TVec3<N>) -> Qua<N> {
|
||||||
|
Loading…
Reference in New Issue
Block a user