Fix abomonation integration.
This commit is contained in:
parent
afef66227e
commit
48f80d99cc
4
Makefile
4
Makefile
|
@ -2,10 +2,10 @@ all:
|
||||||
cargo check --features "debug arbitrary serde-serialize"
|
cargo check --features "debug arbitrary serde-serialize"
|
||||||
|
|
||||||
doc:
|
doc:
|
||||||
cargo doc --no-deps --features "debug arbitrary serde-serialize"
|
cargo doc --no-deps --features "debug arbitrary serde-serialize abomonation"
|
||||||
|
|
||||||
bench:
|
bench:
|
||||||
cargo bench
|
cargo bench
|
||||||
|
|
||||||
test:
|
test:
|
||||||
cargo test --features "debug arbitrary serde-serialize"
|
cargo test --features "debug arbitrary serde-serialize abomonation-serialize"
|
||||||
|
|
|
@ -46,11 +46,11 @@ pub struct Isometry<N: Real, D: DimName, R>
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "abomonation-serialize")]
|
#[cfg(feature = "abomonation-serialize")]
|
||||||
impl<N, D, R> Abomonation for IsometryBase<N, D, R>
|
impl<N, D, R> Abomonation for Isometry<N, D, R>
|
||||||
where N: Scalar,
|
where N: Real,
|
||||||
D: DimName,
|
D: DimName,
|
||||||
R: Abomonation,
|
R: Abomonation,
|
||||||
TranslationBase<N, D>: Abomonation,
|
Translation<N, D>: Abomonation,
|
||||||
DefaultAllocator: Allocator<N, D>
|
DefaultAllocator: Allocator<N, D>
|
||||||
{
|
{
|
||||||
unsafe fn entomb(&self, writer: &mut Vec<u8>) {
|
unsafe fn entomb(&self, writer: &mut Vec<u8>) {
|
||||||
|
|
|
@ -71,10 +71,10 @@ where DefaultAllocator: Allocator<N, D>,
|
||||||
|
|
||||||
|
|
||||||
#[cfg(feature = "abomonation-serialize")]
|
#[cfg(feature = "abomonation-serialize")]
|
||||||
impl<N, D> Abomonation for PointBase<N, D>
|
impl<N, D> Abomonation for Point<N, D>
|
||||||
where N: Scalar,
|
where N: Scalar,
|
||||||
D: DimName,
|
D: DimName,
|
||||||
ColumnVector<N, D>: Abomonation,
|
VectorN<N, D>: Abomonation,
|
||||||
DefaultAllocator: Allocator<N, D>
|
DefaultAllocator: Allocator<N, D>
|
||||||
{
|
{
|
||||||
unsafe fn entomb(&self, writer: &mut Vec<u8>) {
|
unsafe fn entomb(&self, writer: &mut Vec<u8>) {
|
||||||
|
|
|
@ -29,7 +29,7 @@ pub struct Quaternion<N: Real> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "abomonation-serialize")]
|
#[cfg(feature = "abomonation-serialize")]
|
||||||
impl<N: Real> Abomonation for QuaternionBase<N>
|
impl<N: Real> Abomonation for Quaternion<N>
|
||||||
where Vector4<N>: Abomonation
|
where Vector4<N>: Abomonation
|
||||||
{
|
{
|
||||||
unsafe fn entomb(&self, writer: &mut Vec<u8>) {
|
unsafe fn entomb(&self, writer: &mut Vec<u8>) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ impl<N: Scalar, D: DimName> Clone for Rotation<N, D>
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "abomonation-serialize")]
|
#[cfg(feature = "abomonation-serialize")]
|
||||||
impl<N, D> Abomonation for RotationBase<N, D>
|
impl<N, D> Abomonation for Rotation<N, D>
|
||||||
where N: Scalar,
|
where N: Scalar,
|
||||||
D: DimName,
|
D: DimName,
|
||||||
MatrixN<N, D>: Abomonation,
|
MatrixN<N, D>: Abomonation,
|
||||||
|
|
|
@ -43,8 +43,8 @@ pub struct Similarity<N: Real, D: DimName, R>
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "abomonation-serialize")]
|
#[cfg(feature = "abomonation-serialize")]
|
||||||
impl<N: Scalar, D: DimName, R> Abomonation for SimilarityBase<N, D, R>
|
impl<N: Real, D: DimName, R> Abomonation for Similarity<N, D, R>
|
||||||
where IsometryBase<N, D, R>: Abomonation,
|
where Isometry<N, D, R>: Abomonation,
|
||||||
DefaultAllocator: Allocator<N, D>
|
DefaultAllocator: Allocator<N, D>
|
||||||
{
|
{
|
||||||
unsafe fn entomb(&self, writer: &mut Vec<u8>) {
|
unsafe fn entomb(&self, writer: &mut Vec<u8>) {
|
||||||
|
|
|
@ -48,7 +48,7 @@ impl<N: Scalar, D: DimName> Clone for Translation<N, D>
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "abomonation-serialize")]
|
#[cfg(feature = "abomonation-serialize")]
|
||||||
impl<N, D> Abomonation for TranslationBase<N, D>
|
impl<N, D> Abomonation for Translation<N, D>
|
||||||
where N: Scalar,
|
where N: Scalar,
|
||||||
D: DimName,
|
D: DimName,
|
||||||
VectorN<N, D>: Abomonation,
|
VectorN<N, D>: Abomonation,
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
extern crate rand;
|
|
||||||
extern crate nalgebra;
|
|
||||||
extern crate abomonation;
|
|
||||||
|
|
||||||
use rand::random;
|
use rand::random;
|
||||||
use abomonation::{Abomonation, encode, decode};
|
use abomonation::{Abomonation, encode, decode};
|
||||||
use nalgebra::{
|
use na::{
|
||||||
DMatrix, Matrix3x4, Point3, Translation3, Rotation3, Isometry3, Quaternion,
|
DMatrix, Matrix3x4, Point3, Translation3, Rotation3, Isometry3, Quaternion,
|
||||||
IsometryMatrix3, Similarity3, SimilarityMatrix3
|
IsometryMatrix3, Similarity3, SimilarityMatrix3
|
||||||
};
|
};
|
|
@ -4,3 +4,4 @@ mod matrix;
|
||||||
mod matrix_slice;
|
mod matrix_slice;
|
||||||
mod blas;
|
mod blas;
|
||||||
mod serde;
|
mod serde;
|
||||||
|
mod abomonation;
|
||||||
|
|
|
@ -83,7 +83,7 @@ quickcheck!(
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Quaterion * Vector == RotationBase * Vector
|
* Quaterion * Vector == Rotation * Vector
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
fn unit_quaternion_mul_vector(q: UnitQuaternion<f64>, v: Vector3<f64>, p: Point3<f64>) -> bool {
|
fn unit_quaternion_mul_vector(q: UnitQuaternion<f64>, v: Vector3<f64>, p: Point3<f64>) -> bool {
|
||||||
|
|
|
@ -79,7 +79,7 @@ quickcheck!(
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* RotationBase matrix between vectors.
|
* Rotation matrix between vectors.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
fn rotation_between_is_anticommutative_2(a: Vector2<f64>, b: Vector2<f64>) -> bool {
|
fn rotation_between_is_anticommutative_2(a: Vector2<f64>, b: Vector2<f64>) -> bool {
|
||||||
|
@ -132,7 +132,7 @@ quickcheck!(
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* RotationBase construction.
|
* Rotation construction.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
fn new_rotation_2(angle: f64) -> bool {
|
fn new_rotation_2(angle: f64) -> bool {
|
||||||
|
@ -159,7 +159,7 @@ quickcheck!(
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* RotationBase pow.
|
* Rotation pow.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
fn powf_rotation_2(angle: f64, pow: f64) -> bool {
|
fn powf_rotation_2(angle: f64, pow: f64) -> bool {
|
||||||
|
|
|
@ -60,7 +60,7 @@ quickcheck!(
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Quaterion * Vector == RotationBase * Vector
|
* Quaterion * Vector == Rotation * Vector
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
fn unit_complex_mul_vector(c: UnitComplex<f64>, v: Vector2<f64>, p: Point2<f64>) -> bool {
|
fn unit_complex_mul_vector(c: UnitComplex<f64>, v: Vector2<f64>, p: Point2<f64>) -> bool {
|
||||||
|
|
|
@ -5,6 +5,7 @@ extern crate quickcheck;
|
||||||
extern crate approx;
|
extern crate approx;
|
||||||
extern crate num_traits as num;
|
extern crate num_traits as num;
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
|
extern crate abomonation;
|
||||||
extern crate rand;
|
extern crate rand;
|
||||||
extern crate alga;
|
extern crate alga;
|
||||||
extern crate nalgebra as na;
|
extern crate nalgebra as na;
|
||||||
|
|
Loading…
Reference in New Issue