Merge pull request #215 from tomaka/new-rust-1.0
Merge the rust-1.0 branch into master
This commit is contained in:
commit
84fa175901
5 changed files with 8 additions and 5 deletions
|
@ -14,13 +14,17 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
language: rust
|
language: rust
|
||||||
|
|
||||||
|
rust:
|
||||||
|
- 1.0.0-beta.4
|
||||||
|
- nightly
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- secure: S0l5RmsFJgbDdzXjHsCluexb1R9RklpxZMJgr9RcieeqSqaJDPUht53yBZDyuk04/KzEbtM5yxogJd2tcv2E4EogPLL8oG77GItNc/i6jy4TLUjU28WKOMiBvYA/1rhb7f/DEQgj7DtIHP/rQGKH8goUdJfqGbk7EawP7FSxC2Y=
|
- secure: S0l5RmsFJgbDdzXjHsCluexb1R9RklpxZMJgr9RcieeqSqaJDPUht53yBZDyuk04/KzEbtM5yxogJd2tcv2E4EogPLL8oG77GItNc/i6jy4TLUjU28WKOMiBvYA/1rhb7f/DEQgj7DtIHP/rQGKH8goUdJfqGbk7EawP7FSxC2Y=
|
||||||
script:
|
script:
|
||||||
- cargo build
|
- cargo build
|
||||||
- cargo test
|
- cargo test
|
||||||
- cargo bench
|
|
||||||
- cargo doc
|
- cargo doc
|
||||||
after_script:
|
after_script:
|
||||||
# the doc directory needs to be in the root for rust-ci
|
# the doc directory needs to be in the root for rust-ci
|
||||||
|
|
|
@ -276,10 +276,11 @@ impl<S: BaseFloat> One for Deg<S> {
|
||||||
fn one() -> Deg<S> { deg(one()) }
|
fn one() -> Deg<S> { deg(one()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const PI_2: f64 = f64::consts::PI * 2f64;
|
||||||
impl<S: BaseFloat>
|
impl<S: BaseFloat>
|
||||||
Angle<S> for Rad<S> {
|
Angle<S> for Rad<S> {
|
||||||
#[inline] fn from<A: Angle<S>>(theta: A) -> Rad<S> { theta.to_rad() }
|
#[inline] fn from<A: Angle<S>>(theta: A) -> Rad<S> { theta.to_rad() }
|
||||||
#[inline] fn full_turn() -> Rad<S> { rad(cast(f64::consts::PI_2).unwrap()) }
|
#[inline] fn full_turn() -> Rad<S> { rad(cast(PI_2).unwrap()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<S: BaseFloat>
|
impl<S: BaseFloat>
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
|
|
||||||
#![crate_type = "rlib"]
|
#![crate_type = "rlib"]
|
||||||
#![crate_type = "dylib"]
|
#![crate_type = "dylib"]
|
||||||
#![feature(plugin, core, custom_derive)]
|
|
||||||
|
|
||||||
//! Computer graphics-centric math.
|
//! Computer graphics-centric math.
|
||||||
//!
|
//!
|
||||||
|
|
|
@ -133,7 +133,6 @@ pub trait Rotation3<S: BaseNum>: Rotation<S, Vector3<S>, Point3<S>>
|
||||||
/// matrix:
|
/// matrix:
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// #![feature(core)]
|
|
||||||
/// use cgmath::rad;
|
/// use cgmath::rad;
|
||||||
/// use cgmath::Vector2;
|
/// use cgmath::Vector2;
|
||||||
/// use cgmath::{Matrix, ToMatrix2};
|
/// use cgmath::{Matrix, ToMatrix2};
|
||||||
|
|
|
@ -237,7 +237,7 @@ impl<S: BaseFloat + 'static> Transform3<S> for AffineMatrix3<S> {}
|
||||||
|
|
||||||
/// A trait that allows extracting components (rotation, translation, scale)
|
/// A trait that allows extracting components (rotation, translation, scale)
|
||||||
/// from an arbitrary transformations
|
/// from an arbitrary transformations
|
||||||
pub trait ToComponents<S, V: Vector<S>, P: Point<S, V>, R: Rotation<S, V, P>> {
|
pub trait ToComponents<S: BaseNum, V: Vector<S>, P: Point<S, V>, R: Rotation<S, V, P>> {
|
||||||
/// Extract the (scale, rotation, translation) triple
|
/// Extract the (scale, rotation, translation) triple
|
||||||
fn decompose(&self) -> (V, R, V);
|
fn decompose(&self) -> (V, R, V);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue