2014-05-26 17:10:04 +00:00
|
|
|
// Copyright 2013-2014 The CGMath Developers. For a full listing of the authors,
|
2015-03-14 02:49:46 +00:00
|
|
|
// refer to the Cargo.toml file at the top-level directory of this distribution.
|
2013-07-11 23:18:05 +00:00
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2014-05-25 11:10:44 +00:00
|
|
|
//! Computer graphics-centric math.
|
2014-05-25 20:52:01 +00:00
|
|
|
//!
|
|
|
|
//! This crate provides useful mathematical primitives and operations on them.
|
2014-05-25 21:35:46 +00:00
|
|
|
//! It is organized into one module per primitive. The core structures are
|
|
|
|
//! vectors and matrices. A strongly-typed interface is provided, to prevent
|
|
|
|
//! mixing units or violating mathematical invariants.
|
|
|
|
//!
|
|
|
|
//! Transformations are not usually done directly on matrices, but go through
|
|
|
|
//! transformation objects that can be converted to matrices. Rotations go
|
|
|
|
//! through the `Basis` types, which are guaranteed to be orthogonal matrices.
|
|
|
|
//! Despite this, one can directly create a limited rotation matrix using the
|
|
|
|
//! `look_at`, `from_angle`, `from_euler`, and `from_axis_angle` methods.
|
|
|
|
//! These are provided for convenience.
|
2014-05-25 20:52:01 +00:00
|
|
|
|
2015-12-20 20:24:56 +00:00
|
|
|
#![cfg_attr(feature = "unstable", feature(augmented_assignments, op_assign_traits))]
|
|
|
|
|
2015-04-05 01:19:11 +00:00
|
|
|
extern crate num as rust_num;
|
2015-03-26 01:58:33 +00:00
|
|
|
extern crate rustc_serialize;
|
2015-03-15 02:53:57 +00:00
|
|
|
extern crate rand;
|
2014-08-23 12:34:33 +00:00
|
|
|
|
2014-08-16 04:51:09 +00:00
|
|
|
// Re-exports
|
|
|
|
|
2015-03-01 06:29:47 +00:00
|
|
|
pub use array::*;
|
|
|
|
pub use matrix::*;
|
|
|
|
pub use quaternion::*;
|
|
|
|
pub use vector::*;
|
|
|
|
|
|
|
|
pub use angle::*;
|
|
|
|
pub use point::*;
|
|
|
|
pub use rotation::*;
|
|
|
|
pub use transform::*;
|
|
|
|
|
|
|
|
pub use projection::*;
|
|
|
|
|
2014-08-16 04:51:09 +00:00
|
|
|
pub use approx::ApproxEq;
|
2015-03-01 06:29:47 +00:00
|
|
|
pub use num::*;
|
2014-08-16 04:51:09 +00:00
|
|
|
|
2015-04-05 02:14:03 +00:00
|
|
|
pub use rust_num::{One, Zero, one, zero};
|
|
|
|
|
2014-08-16 04:51:09 +00:00
|
|
|
// Modules
|
|
|
|
|
2016-03-25 04:27:57 +00:00
|
|
|
pub mod prelude;
|
|
|
|
|
2015-12-12 11:17:03 +00:00
|
|
|
mod macros;
|
|
|
|
|
2014-08-16 04:51:09 +00:00
|
|
|
mod array;
|
|
|
|
|
|
|
|
mod matrix;
|
|
|
|
mod quaternion;
|
|
|
|
mod vector;
|
|
|
|
|
|
|
|
mod angle;
|
|
|
|
mod point;
|
|
|
|
mod rotation;
|
|
|
|
mod transform;
|
|
|
|
|
|
|
|
mod projection;
|
|
|
|
|
|
|
|
mod approx;
|
|
|
|
mod num;
|