From a3e6cd26b5ae1f2d9b47df0e0811bfb0c11a2371 Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Sat, 9 Apr 2016 13:47:17 +1000 Subject: [PATCH] Document fields --- src/matrix.rs | 9 +++++++++ src/quaternion.rs | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/matrix.rs b/src/matrix.rs index 99c693f..08f550a 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -40,7 +40,9 @@ use vector::{Vector2, Vector3, Vector4}; #[repr(C, packed)] #[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable)] pub struct Matrix2 { + /// The first column of the matrix. pub x: Vector2, + /// The second column of the matrix. pub y: Vector2, } @@ -50,8 +52,11 @@ pub struct Matrix2 { #[repr(C, packed)] #[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable)] pub struct Matrix3 { + /// The first column of the matrix. pub x: Vector3, + /// The second column of the matrix. pub y: Vector3, + /// The third column of the matrix. pub z: Vector3, } @@ -61,9 +66,13 @@ pub struct Matrix3 { #[repr(C, packed)] #[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable)] pub struct Matrix4 { + /// The first column of the matrix. pub x: Vector4, + /// The second column of the matrix. pub y: Vector4, + /// The third column of the matrix. pub z: Vector4, + /// The fourth column of the matrix. pub w: Vector4, } diff --git a/src/quaternion.rs b/src/quaternion.rs index ea8d8e3..5bf47d8 100644 --- a/src/quaternion.rs +++ b/src/quaternion.rs @@ -36,7 +36,9 @@ use vector::{Vector3, VectorSpace, InnerSpace}; #[repr(C, packed)] #[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable)] pub struct Quaternion { + /// The scalar part of the quaternion. pub s: S, + /// The vector part of the quaternion. pub v: Vector3, }