diff --git a/src/cgmath/aabb.rs b/src/cgmath/aabb.rs index cb7ae9c..c6532cb 100644 --- a/src/cgmath/aabb.rs +++ b/src/cgmath/aabb.rs @@ -72,8 +72,8 @@ pub trait Aabb #[deriving(Clone, Eq)] pub struct Aabb2 { - min: Point2, - max: Point2, + pub min: Point2, + pub max: Point2, } impl Aabb2 { @@ -103,8 +103,8 @@ impl fmt::Show for Aabb2 { #[deriving(Clone, Eq)] pub struct Aabb3 { - min: Point3, - max: Point3, + pub min: Point3, + pub max: Point3, } impl Aabb3 { diff --git a/src/cgmath/angle.rs b/src/cgmath/angle.rs index afbd140..46e72e1 100644 --- a/src/cgmath/angle.rs +++ b/src/cgmath/angle.rs @@ -23,8 +23,8 @@ use std::num::{One, one, Zero, zero, cast}; use approx::ApproxEq; -#[deriving(Clone, Eq, Ord, Hash)] pub struct Rad { s: S } -#[deriving(Clone, Eq, Ord, Hash)] pub struct Deg { s: S } +#[deriving(Clone, Eq, Ord, Hash)] pub struct Rad { pub s: S } +#[deriving(Clone, Eq, Ord, Hash)] pub struct Deg { pub s: S } #[inline] pub fn rad(s: S) -> Rad { Rad { s: s } } #[inline] pub fn deg(s: S) -> Deg { Deg { s: s } } diff --git a/src/cgmath/array.rs b/src/cgmath/array.rs index 61ba8d4..24d063e 100644 --- a/src/cgmath/array.rs +++ b/src/cgmath/array.rs @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[macro_escape]; +#![macro_escape] use std::slice::{Items, MutItems}; diff --git a/src/cgmath/cylinder.rs b/src/cgmath/cylinder.rs index 17bf384..32c4298 100644 --- a/src/cgmath/cylinder.rs +++ b/src/cgmath/cylinder.rs @@ -20,7 +20,7 @@ use vector::Vec3; #[deriving(Clone, Eq)] pub struct Cylinder { - center: Point3, - axis: Vec3, - radius: S, + pub center: Point3, + pub axis: Vec3, + pub radius: S, } diff --git a/src/cgmath/frustum.rs b/src/cgmath/frustum.rs index d181b82..f0b0ee4 100644 --- a/src/cgmath/frustum.rs +++ b/src/cgmath/frustum.rs @@ -23,12 +23,12 @@ use partial_ord::PartOrdFloat; #[deriving(Clone, Eq)] pub struct Frustum { - left: Plane, - right: Plane, - bottom: Plane, - top: Plane, - near: Plane, - far: Plane, + pub left: Plane, + pub right: Plane, + pub bottom: Plane, + pub top: Plane, + pub near: Plane, + pub far: Plane, } impl> @@ -60,12 +60,12 @@ Frustum { #[deriving(Clone, Eq)] pub struct FrustumPoints { - near_top_left: Point3, - near_top_right: Point3, - near_bottom_left: Point3, - near_bottom_right: Point3, - far_top_left: Point3, - far_top_right: Point3, - far_bottom_left: Point3, - far_bottom_right: Point3, + pub near_top_left: Point3, + pub near_top_right: Point3, + pub near_bottom_left: Point3, + pub near_bottom_right: Point3, + pub far_top_left: Point3, + pub far_top_right: Point3, + pub far_bottom_left: Point3, + pub far_bottom_right: Point3, } diff --git a/src/cgmath/lib.rs b/src/cgmath/lib.rs index f16ad36..bb6576b 100644 --- a/src/cgmath/lib.rs +++ b/src/cgmath/lib.rs @@ -13,14 +13,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[crate_id="cgmath#0.1"]; -#[crate_type = "rlib"]; -#[crate_type = "dylib"]; -#[comment = "A mathematics library for computer graphics."]; -#[license = "ASL2"]; +#![crate_id="cgmath#0.1"] +#![crate_type = "rlib"] +#![crate_type = "dylib"] +#![comment = "A mathematics library for computer graphics."] +#![license = "ASL2"] -#[feature(globs)]; -#[feature(macro_rules)]; +#![feature(globs)] +#![feature(macro_rules)] pub mod array; pub mod matrix; diff --git a/src/cgmath/matrix.rs b/src/cgmath/matrix.rs index 6e4210e..c1b4f60 100644 --- a/src/cgmath/matrix.rs +++ b/src/cgmath/matrix.rs @@ -29,15 +29,15 @@ use partial_ord::PartOrdFloat; /// A 2 x 2, column major matrix #[deriving(Clone, Eq)] -pub struct Mat2 { x: Vec2, y: Vec2 } +pub struct Mat2 { pub x: Vec2, pub y: Vec2 } /// A 3 x 3, column major matrix #[deriving(Clone, Eq)] -pub struct Mat3 { x: Vec3, y: Vec3, z: Vec3 } +pub struct Mat3 { pub x: Vec3, pub y: Vec3, pub z: Vec3 } /// A 4 x 4, column major matrix #[deriving(Clone, Eq)] -pub struct Mat4 { x: Vec4, y: Vec4, z: Vec4, w: Vec4 } +pub struct Mat4 { pub x: Vec4, pub y: Vec4, pub z: Vec4, pub w: Vec4 } impl Mat2 { diff --git a/src/cgmath/obb.rs b/src/cgmath/obb.rs index c169d77..f89d483 100644 --- a/src/cgmath/obb.rs +++ b/src/cgmath/obb.rs @@ -20,14 +20,14 @@ use vector::{Vec2, Vec3}; #[deriving(Clone, Eq)] pub struct Obb2 { - center: Point2, - axis: Vec2, - extents: Vec2, + pub center: Point2, + pub axis: Vec2, + pub extents: Vec2, } #[deriving(Clone, Eq)] pub struct Obb3 { - center: Point3, - axis: Vec3, - extents: Vec3, + pub center: Point3, + pub axis: Vec3, + pub extents: Vec3, } diff --git a/src/cgmath/plane.rs b/src/cgmath/plane.rs index 1b772c5..0054333 100644 --- a/src/cgmath/plane.rs +++ b/src/cgmath/plane.rs @@ -43,8 +43,8 @@ use partial_ord::PartOrdFloat; /// superfluous negations (see _Real Time Collision Detection_, p. 55). #[deriving(Clone, Eq)] pub struct Plane { - n: Vec3, - d: S, + pub n: Vec3, + pub d: S, } impl> diff --git a/src/cgmath/point.rs b/src/cgmath/point.rs index 2313614..f1794f2 100644 --- a/src/cgmath/point.rs +++ b/src/cgmath/point.rs @@ -26,11 +26,11 @@ use partial_ord::PartOrdPrim; /// A point in 2-dimensional space. #[deriving(Eq, Clone, Hash)] -pub struct Point2 { x: S, y: S } +pub struct Point2 { pub x: S, pub y: S } /// A point in 3-dimensional space. #[deriving(Eq, Clone, Hash)] -pub struct Point3 { x: S, y: S, z: S } +pub struct Point3 { pub x: S, pub y: S, pub z: S } impl Point2 { diff --git a/src/cgmath/projection.rs b/src/cgmath/projection.rs index b743c2b..8c240db 100644 --- a/src/cgmath/projection.rs +++ b/src/cgmath/projection.rs @@ -71,10 +71,10 @@ pub trait Projection: ToMat4 { /// A perspective projection based on a vertical field-of-view angle. #[deriving(Clone, Eq)] pub struct PerspectiveFov { - fovy: A, - aspect: S, - near: S, - far: S, + pub fovy: A, + pub aspect: S, + pub near: S, + pub far: S, } impl> PerspectiveFov { @@ -146,9 +146,9 @@ impl> ToMat4 for PerspectiveFov { /// A perspective projection with arbitrary left/right/bottom/top distances #[deriving(Clone, Eq)] pub struct Perspective { - left: S, right: S, - bottom: S, top: S, - near: S, far: S, + pub left: S, right: S, + pub bottom: S, top: S, + pub near: S, far: S, } impl> @@ -197,9 +197,9 @@ impl ToMat4 for Perspective { /// An orthographic projection with arbitrary left/right/bottom/top distances #[deriving(Clone, Eq)] pub struct Ortho { - left: S, right: S, - bottom: S, top: S, - near: S, far: S, + pub left: S, right: S, + pub bottom: S, top: S, + pub near: S, far: S, } impl> diff --git a/src/cgmath/quaternion.rs b/src/cgmath/quaternion.rs index ae1b8ed..d1807aa 100644 --- a/src/cgmath/quaternion.rs +++ b/src/cgmath/quaternion.rs @@ -27,7 +27,7 @@ use partial_ord::PartOrdFloat; /// A quaternion in scalar/vector form #[deriving(Clone, Eq)] -pub struct Quat { s: S, v: Vec3 } +pub struct Quat { pub s: S, pub v: Vec3 } array!(impl Quat -> [S, ..4] _4) diff --git a/src/cgmath/ray.rs b/src/cgmath/ray.rs index f9d4125..b75c8dd 100644 --- a/src/cgmath/ray.rs +++ b/src/cgmath/ray.rs @@ -20,8 +20,8 @@ use vector::{Vector, Vec2, Vec3}; #[deriving(Clone, Eq)] pub struct Ray { - origin: P, - direction: V, + pub origin: P, + pub direction: V, } impl diff --git a/src/cgmath/rotation.rs b/src/cgmath/rotation.rs index 9623b0b..866e65e 100644 --- a/src/cgmath/rotation.rs +++ b/src/cgmath/rotation.rs @@ -135,7 +135,7 @@ pub trait Rotation3 /// to a subset of those implemented on `Mat2`. #[deriving(Eq, Clone)] pub struct Basis2 { - priv mat: Mat2 + mat: Mat2 } impl Basis2 { @@ -213,7 +213,7 @@ Rotation2 for Basis2 { /// been restricted to a subeset of those implemented on `Mat3`. #[deriving(Eq, Clone)] pub struct Basis3 { - priv mat: Mat3 + mat: Mat3 } impl> diff --git a/src/cgmath/sphere.rs b/src/cgmath/sphere.rs index 0153f35..652e03a 100644 --- a/src/cgmath/sphere.rs +++ b/src/cgmath/sphere.rs @@ -30,8 +30,8 @@ fn cast(n: T) -> U { #[deriving(Clone, Eq)] pub struct Sphere { - center: Point3, - radius: S, + pub center: Point3, + pub radius: S, } impl> Intersect>> for (Sphere, Ray3) { diff --git a/src/cgmath/transform.rs b/src/cgmath/transform.rs index 85ba383..e8dc1e0 100644 --- a/src/cgmath/transform.rs +++ b/src/cgmath/transform.rs @@ -71,9 +71,9 @@ pub trait Transform /// A generic transformation consisting of a rotation, /// displacement vector and scale amount. pub struct Decomposed { - scale: S, - rot: R, - disp: V, + pub scale: S, + pub rot: R, + pub disp: V, } impl @@ -169,7 +169,7 @@ fmt::Show for Decomposed,R> { /// A homogeneous transformation matrix. pub struct AffineMatrix3 { - mat: Mat4, + pub mat: Mat4, } impl> diff --git a/src/cgmath/vector.rs b/src/cgmath/vector.rs index fee05c2..eac8f4c 100644 --- a/src/cgmath/vector.rs +++ b/src/cgmath/vector.rs @@ -81,7 +81,7 @@ pub trait Vector macro_rules! vec( ($Self:ident <$S:ident> { $($field:ident),+ }, $n:expr) => ( #[deriving(Eq, Clone, Hash)] - pub struct $Self { $($field: S),+ } + pub struct $Self { $(pub $field: S),+ } impl<$S: Primitive> $Self<$S> { #[inline]