Setup functions signatures for the glm interface.

This commit is contained in:
sebcrozet 2018-09-20 10:50:34 +02:00 committed by Sébastien Crozet
parent b9d23fe1c2
commit bee63859c0
40 changed files with 2340 additions and 1 deletions

View File

@ -45,4 +45,4 @@ quickcheck = { version = "0.6", optional = true }
serde_json = "1.0"
[workspace]
members = [ "nalgebra-lapack" ]
members = [ "nalgebra-lapack", "nalgebra-glm" ]

9
nalgebra-glm/Cargo.toml Normal file
View File

@ -0,0 +1,9 @@
[package]
name = "nalgebra-glm"
version = "0.1.0"
authors = ["sebcrozet <developer@crozet.re>"]
[dependencies]
num-traits = { version = "0.2", default-features = false }
alga = "0.7"
nalgebra = { path = ".." }

6
nalgebra-glm/README Normal file
View File

@ -0,0 +1,6 @@
* not_ -> not
* equal overload with epsilon -> equal_epsilon
* ortho(l, r, b, t) -> infinite_ortho
* tweaked_infinite_perspective(fovy, aspect, near, ep) -> tweaked_infinite_perspective_ep

View File

@ -0,0 +1,95 @@
use na::{MatrixMN, VectorN, Vector1, Vector2, Vector3, Vector4,
Matrix2, Matrix3, Matrix4,
Matrix2x3, Matrix3x2, Matrix4x2,
Matrix2x4, Matrix3x4, Matrix4x3,
Quaternion};
pub type Mat<N, R, C> = MatrixMN<N, R, C>;
pub type Vec<N, R> = VectorN<N, R>;
pub type Qua<N> = Quaternion<N>;
pub type BVec1 = Vector1<bool>;
pub type BVec2 = Vector2<bool>;
pub type BVec3 = Vector3<bool>;
pub type BVec4 = Vector4<bool>;
pub type DVec1 = Vector1<f64>;
pub type DVec2 = Vector2<f64>;
pub type DVec3 = Vector3<f64>;
pub type DVec4 = Vector4<f64>;
pub type IVec1 = Vector1<i32>;
pub type IVec2 = Vector2<i32>;
pub type IVec3 = Vector3<i32>;
pub type IVec4 = Vector4<i32>;
pub type UVec1 = Vector1<u32>;
pub type UVec2 = Vector2<u32>;
pub type UVec3 = Vector3<u32>;
pub type UVec4 = Vector4<u32>;
pub type Vec1 = Vector1<f32>;
pub type Vec2 = Vector2<f32>;
pub type Vec3 = Vector3<f32>;
pub type Vec4 = Vector4<f32>;
pub type U64Vec1 = Vector1<u64>;
pub type U64Vec2 = Vector2<u64>;
pub type U64Vec3 = Vector3<u64>;
pub type U64Vec4 = Vector4<u64>;
pub type I64Vec1 = Vector1<i64>;
pub type I64Vec2 = Vector2<i64>;
pub type I64Vec3 = Vector3<i64>;
pub type I64Vec4 = Vector4<i64>;
pub type U32Vec1 = Vector1<u32>;
pub type U32Vec2 = Vector2<u32>;
pub type U32Vec3 = Vector3<u32>;
pub type U32Vec4 = Vector4<u32>;
pub type I32Vec1 = Vector1<i32>;
pub type I32Vec2 = Vector2<i32>;
pub type I32Vec3 = Vector3<i32>;
pub type I32Vec4 = Vector4<i32>;
pub type U16Vec1 = Vector1<u16>;
pub type U16Vec2 = Vector2<u16>;
pub type U16Vec3 = Vector3<u16>;
pub type U16Vec4 = Vector4<u16>;
pub type I16Vec1 = Vector1<i16>;
pub type I16Vec2 = Vector2<i16>;
pub type I16Vec3 = Vector3<i16>;
pub type I16Vec4 = Vector4<i16>;
pub type U8Vec1 = Vector1<u8>;
pub type U8Vec2 = Vector2<u8>;
pub type U8Vec3 = Vector3<u8>;
pub type U8Vec4 = Vector4<u8>;
pub type I8Vec1 = Vector1<i8>;
pub type I8Vec2 = Vector2<i8>;
pub type I8Vec3 = Vector3<i8>;
pub type I8Vec4 = Vector4<i8>;
pub type DMat2 = Matrix2<f64>;
pub type DMat2x2 = Matrix2<f64>;
pub type DMat2x3 = Matrix2x3<f64>;
pub type DMat2x4 = Matrix2x4<f64>;
pub type DMat3 = Matrix3<f64>;
pub type DMat3x2 = Matrix3x2<f64>;
pub type DMat3x3 = Matrix3<f64>;
pub type DMat3x4 = Matrix3x4<f64>;
pub type DMat4 = Matrix4<f64>;
pub type DMat4x2 = Matrix4x2<f64>;
pub type DMat4x3 = Matrix4x3<f64>;
pub type DMat4x4 = Matrix4<f64>;
pub type Mat2 = Matrix2<f32>;
pub type Mat2x2 = Matrix2<f32>;
pub type Mat2x3 = Matrix2x3<f32>;
pub type Mat2x4 = Matrix2x4<f32>;
pub type Mat3 = Matrix3<f32>;
pub type Mat3x2 = Matrix3x2<f32>;
pub type Mat3x3 = Matrix3<f32>;
pub type Mat3x4 = Matrix3x4<f32>;
pub type Mat4x2 = Matrix4x2<f32>;
pub type Mat4x3 = Matrix4x3<f32>;
pub type Mat4x4 = Matrix4<f32>;
pub type Mat4 = Matrix4<f32>;
pub type Quat = Quaternion<f32>;
pub type DQuat = Quaternion<f64>;

209
nalgebra-glm/src/common.rs Normal file
View File

@ -0,0 +1,209 @@
use na::{Scalar, DimName, DefaultAllocator};
use aliases::Vec;
use traits::Alloc;
pub fn abs<T>(x: T) -> T {
unimplemented!()
}
pub fn abs2<N: Scalar, D: DimName>(x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn ceil<N: Scalar, D: DimName>(x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn clamp<T>(x: T, minVal: T, maxVal: T) -> T {
unimplemented!()
}
pub fn clamp2<N: Scalar, D: DimName>(x: &Vec<N, D>,minVal: N, maxVal: N) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn clamp3<N: Scalar, D: DimName>(x: &Vec<N, D>, minVal: &Vec<N, D>, maxVal: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn floatBitsToInt(v: f32) -> i32 {
unimplemented!()
}
pub fn floatBitsToInt2<D: DimName>(v: Vec<f32, D>) -> Vec<i32, D>
where DefaultAllocator: Alloc<f32, D> {
unimplemented!()
}
pub fn floatBitsToUint(v: f32) -> u32 {
unimplemented!()
}
pub fn floatBitsToUint2<D: DimName>(v: &Vec<f32, D>) -> Vec<u32, D>
where DefaultAllocator: Alloc<f32, D> {
unimplemented!()
}
pub fn floor<N: Scalar, D: DimName>(x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn fma<T>(a: T, b: T, c: T) -> T {
unimplemented!()
}
pub fn fract<T>(x: T) -> T {
unimplemented!()
}
pub fn fract2<N: Scalar, D: DimName>(x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn frexp<T, I>(x: T, exp: I) -> T {
unimplemented!()
}
pub fn intBitsToFloat<N: Scalar, D: DimName>(v: i32) -> f32 {
unimplemented!()
}
pub fn intBitsToFloat2<D: DimName>(v: &Vec<u32, D>) -> Vec<f32, D>
where DefaultAllocator: Alloc<f32, D> {
unimplemented!()
}
pub fn isinf<N: Scalar, D: DimName>(x: &Vec<N, D>) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn isnan<N: Scalar, D: DimName>(x: &Vec<N, D>) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn ldexp<T, I>(x: T, exp: I) -> T {
unimplemented!()
}
pub fn max<T>(x: T, y: T) -> T {
unimplemented!()
}
pub fn max2<N: Scalar, D: DimName>(x: &Vec<N, D>,y: N) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn max3<N: Scalar, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn min<T>(x: T, y: T) -> T {
unimplemented!()
}
pub fn min2<N: Scalar, D: DimName>(x: &Vec<N, D>,y: N) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn min3<N: Scalar, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn mix<T>(x: T, y: T, a: T) -> T {
unimplemented!()
}
pub fn mod_<N: Scalar, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn modf<T>(x: T, i: &T) -> T {
unimplemented!()
}
pub fn round<N: Scalar, D: DimName>(x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn roundEven<N: Scalar, D: DimName>(x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn sign<N: Scalar, D: DimName>(x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn smoothstep<T>(edge0: T, edge1: T, x: T) -> T {
unimplemented!()
}
pub fn step<T>(edge: T, x: T) -> T {
unimplemented!()
}
pub fn step2<N: Scalar, D: DimName>(edge: N, x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn step3<N: Scalar, D: DimName>(edge: &Vec<N, D>, x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn trunc<N: Scalar, D: DimName>(x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn uintBitsToFloat(v: u32) -> f32 {
unimplemented!()
}
pub fn uintBitsToFloat2<D: DimName>(v: &Vec<u32, D>) -> Vec<f32, D>
where DefaultAllocator: Alloc<f32, D> {
unimplemented!()
}

View File

@ -0,0 +1,119 @@
use na::{Scalar, Real, U1, U2, U3, U4};
use aliases::{Vec, Mat, Qua};
pub fn vec1<N: Scalar>(x: N) -> Vec<N, U1> {
Vec::<N, U1>::new(x)
}
pub fn vec2<N: Scalar>(x: N, y: N) -> Vec<N, U2> {
Vec::<N, U2>::new(x, y)
}
pub fn vec3<N: Scalar>(x: N, y: N, z: N) -> Vec<N, U3> {
Vec::<N, U3>::new(x, y, z)
}
pub fn vec4<N: Scalar>(x: N, y: N, z: N, w: N) -> Vec<N, U4> {
Vec::<N, U4>::new(x, y, z, w)
}
pub fn mat2<N: Scalar>(m11: N, m12: N, m21: N, m22: N) -> Mat<N, U2, U2> {
Mat::<N, U2, U2>::new(
m11, m12,
m21, m22,
)
}
pub fn mat2x2<N: Scalar>(m11: N, m12: N, m21: N, m22: N) -> Mat<N, U2, U2> {
Mat::<N, U2, U2>::new(
m11, m12,
m21, m22,
)
}
pub fn mat2x3<N: Scalar>(m11: N, m12: N, m13: N, m21: N, m22: N, m23: N) -> Mat<N, U2, U3> {
Mat::<N, U2, U3>::new(
m11, m12, m13,
m21, m22, m23,
)
}
pub fn mat2x4<N: Scalar>(m11: N, m12: N, m13: N, m14: N, m21: N, m22: N, m23: N, m24: N) -> Mat<N, U2, U4> {
Mat::<N, U2, U4>::new(
m11, m12, m13, m14,
m21, m22, m23, m24,
)
}
pub fn mat3<N: Scalar>(m11: N, m12: N, m13: N, m21: N, m22: N, m23: N, m31: N, m32: N, m33: N) -> Mat<N, U3, U3> {
Mat::<N, U3, U3>::new(
m11, m12, m13,
m21, m22, m23,
m31, m32, m33,
)
}
pub fn mat3x2<N: Scalar>(m11: N, m12: N, m21: N, m22: N, m31: N, m32: N) -> Mat<N, U3, U2> {
Mat::<N, U3, U2>::new(
m11, m12,
m21, m22,
m31, m32,
)
}
pub fn mat3x3<N: Scalar>(m11: N, m12: N, m13: N, m21: N, m22: N, m23: N, m31: N, m32: N, m33: N) -> Mat<N, U3, U3> {
Mat::<N, U3, U3>::new(
m11, m12, m13,
m31, m32, m33,
m21, m22, m23,
)
}
pub fn mat3x4<N: Scalar>(m11: N, m12: N, m13: N, m14: N, m21: N, m22: N, m23: N, m24: N, m31: N, m32: N, m33: N, m34: N) -> Mat<N, U3, U4> {
Mat::<N, U3, U4>::new(
m11, m12, m13, m14,
m21, m22, m23, m24,
m31, m32, m33, m34,
)
}
pub fn mat4x2<N: Scalar>(m11: N, m12: N, m21: N, m22: N, m31: N, m32: N, m41: N, m42: N) -> Mat<N, U4, U2> {
Mat::<N, U4, U2>::new(
m11, m12,
m21, m22,
m31, m32,
m41, m42,
)
}
pub fn mat4x3<N: Scalar>(m11: N, m12: N, m13: N, m21: N, m22: N, m23: N, m31: N, m32: N, m33: N, m41: N, m42: N, m43: N) -> Mat<N, U4, U3> {
Mat::<N, U4, U3>::new(
m11, m12, m13,
m21, m22, m23,
m31, m32, m33,
m41, m42, m43,
)
}
pub fn mat4x4<N: Scalar>(m11: N, m12: N, m13: N, m14: N, m21: N, m22: N, m23: N, m24: N, m31: N, m32: N, m33: N, m34: N, m41: N, m42: N, m43: N, m44: N) -> Mat<N, U4, U4> {
Mat::<N, U4, U4>::new(
m11, m12, m13, m14,
m21, m22, m23, m24,
m31, m32, m33, m34,
m41, m42, m43, m44,
)
}
pub fn mat4<N: Scalar>(m11: N, m12: N, m13: N, m14: N, m21: N, m22: N, m23: N, m24: N, m31: N, m32: N, m33: N, m34: N, m41: N, m42: N, m43: N, m44: N) -> Mat<N, U4, U4> {
Mat::<N, U4, U4>::new(
m11, m12, m13, m14,
m21, m22, m23, m24,
m31, m32, m33, m34,
m41, m42, m43, m44,
)
}
pub fn quat<N: Real>(x: N, y: N, z: N, w: N) -> Qua<N> {
Qua::new(x, y, z, w)
}

View File

@ -0,0 +1,39 @@
use na::{Real, DefaultAllocator, DimName};
use aliases::Vec;
use traits::Alloc;
pub fn exp<N: Real, D: DimName>(v: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn exp2<N: Real, D: DimName>(v: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn inversesqrt<N: Real, D: DimName>(v: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn log<N: Real, D: DimName>(v: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn log2<N: Real, D: DimName>(v: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn pow<N: Real, D: DimName>(base: &Vec<N, D>, exponent: &Vec<N, D>)
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn sqrt<N: Real, D: DimName>(v: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}

View File

@ -0,0 +1,170 @@
use na::{Real, U4};
use aliases::Mat;
pub fn frustum<N: Real>(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn frustum_lh<N: Real>(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn frustum_lr_no<N: Real>(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn frustum_lh_zo<N: Real>(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn frustum_no<N: Real>(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn frustum_rh<N: Real>(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn frustum_rh_no<N: Real>(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn frustum_rh_zo<N: Real>(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn frustum_zo<N: Real>(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn infinite_perspective<N: Real>(fovy: N, aspect: N, near: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn infinite_perspective_lh<N: Real>(fovy: N, aspect: N, near: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn infinite_perspective_rh<N: Real>(fovy: N, aspect: N, near: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn infinite_ortho<N: Real>(left: N, right: N, bottom: N, top: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn ortho<N: Real>(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn ortho_lh<N: Real>(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn ortho_lh_no<N: Real>(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn ortho_lh_zo<N: Real>(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn ortho_no<N: Real>(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn ortho_rh<N: Real>(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn ortho_rh_no<N: Real>(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn ortho_rh_zo<N: Real>(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn ortho_zo<N: Real>(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective<N: Real>(fovy: N, aspect: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_fov<N: Real>(fov: N, width: N, height: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_fov_lh<N: Real>(fov: N, width: N, height: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_fov_lh_no<N: Real>(fov: N, width: N, height: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_fov_lh_zo<N: Real>(fov: N, width: N, height: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_fov_no<N: Real>(fov: N, width: N, height: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_fov_rh<N: Real>(fov: N, width: N, height: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_fov_rh_no<N: Real>(fov: N, width: N, height: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_fov_rh_zo<N: Real>(fov: N, width: N, height: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_fov_zo<N: Real>(fov: N, width: N, height: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_lh<N: Real>(fovy: N, aspect: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_lh_no<N: Real>(fovy: N, aspect: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_lh_zo<N: Real>(fovy: N, aspect: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_no<N: Real>(fovy: N, aspect: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_rh<N: Real>(fovy: N, aspect: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_rh_no<N: Real>(fovy: N, aspect: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_rh_zo<N: Real>(fovy: N, aspect: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn perspective_zo<N: Real>(fovy: N, aspect: N, near: N, far: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn tweaked_infinite_perspective<N: Real>(fovy: N, aspect: N, near: N) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn tweaked_infinite_perspective_ep<N: Real>(fovy: N, aspect: N, near: N, ep: N) -> Mat<N, U4, U4> {
unimplemented!()
}

View File

@ -0,0 +1,32 @@
use na::{Real, U2, U3, U4};
use aliases::{Mat, Vec};
pub fn pickMatrix<N: Real>(center: &Vec<N, U2>, delta: &Vec<N, U2>, viewport: &Vec<N, U4>) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn project<N: Real>(obj: &Vec<N, U3>, model: &Mat<N, U4, U4>, proj: &Mat<N, U4, U4>, viewport: Vec<N, U4>) -> Vec<N, U3> {
unimplemented!()
}
pub fn projectNO<N: Real>(obj: &Vec<N, U3>, model: &Mat<N, U4, U4>, proj: &Mat<N, U4, U4>, viewport: Vec<N, U4>) -> Vec<N, U3> {
unimplemented!()
}
pub fn projectZO<N: Real>(obj: &Vec<N, U3>, model: &Mat<N, U4, U4>, proj: &Mat<N, U4, U4>, viewport: Vec<N, U4>) -> Vec<N, U3> {
unimplemented!()
}
pub fn unProject<N: Real>(win: &Vec<N, U3>, model: &Mat<N, U4, U4>, proj: &Mat<N, U4, U4>, viewport: Vec<N, U4>) -> Vec<N, U3> {
unimplemented!()
}
pub fn unProjectNO<N: Real>(win: &Vec<N, U3>, model: &Mat<N, U4, U4>, proj: &Mat<N, U4, U4>, viewport: Vec<N, U4>) -> Vec<N, U3> {
unimplemented!()
}
pub fn unProjectZO<N: Real>(win: &Vec<N, U3>, model: &Mat<N, U4, U4>, proj: &Mat<N, U4, U4>, viewport: Vec<N, U4>) -> Vec<N, U3> {
unimplemented!()
}

View File

@ -0,0 +1,35 @@
use na::{Scalar, DimName, DefaultAllocator};
use aliases::{Vec, Mat};
use traits::Alloc;
pub fn equal<N: Scalar, R: DimName, C: DimName>(x: &Mat<N, R, C>, y: &Mat<N, R, C>) -> Vec<bool, C>
where DefaultAllocator: Alloc<N, R, C> {
unimplemented!()
}
pub fn equal_eps<N: Scalar, R: DimName, C: DimName>(x: &Mat<N, R, C>, y: &Mat<N, R, C>,epsilon: N) -> Vec<bool, C>
where DefaultAllocator: Alloc<N, R, C> {
unimplemented!()
}
pub fn equal_eps_vec<N: Scalar, R: DimName, C: DimName>(x: &Mat<N, R, C>, y: &Mat<N, R, C>, epsilon: &Vec<N, C>) -> Vec<bool, C>
where DefaultAllocator: Alloc<N, R, C> {
unimplemented!()
}
pub fn not_equal<N: Scalar, R: DimName, C: DimName>(x: &Mat<N, R, C>, y: &Mat<N, R, C>) -> Vec<bool, C>
where DefaultAllocator: Alloc<N, R, C> {
unimplemented!()
}
pub fn not_equal_eps<N: Scalar, R: DimName, C: DimName>(x: &Mat<N, R, C>, y: &Mat<N, R, C>,epsilon: N) -> Vec<bool, C>
where DefaultAllocator: Alloc<N, R, C> {
unimplemented!()
}
pub fn not_equal_eps_vec<N: Scalar, R: DimName, C: DimName>(x: &Mat<N, R, C>, y: &Mat<N, R, C>, epsilon: &Vec<N, C>) -> Vec<bool, C>
where DefaultAllocator: Alloc<N, R, C> {
unimplemented!()
}

View File

@ -0,0 +1,31 @@
use na::{Scalar, U3, U4};
use aliases::{Mat, Vec};
pub fn identity<T>() -> T {
unimplemented!()
}
pub fn lookAt<N: Scalar>(eye: &Vec<N, U3>, center: &Vec<N, U3>, up: &Vec<N, U3>) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn lookAtLH<N: Scalar>(eye: &Vec<N, U3>, center: &Vec<N, U3>, up: &Vec<N, U3>) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn lookAtRH<N: Scalar>(eye: &Vec<N, U3>, center: &Vec<N, U3>, up: &Vec<N, U3>) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn rotate<N: Scalar>(m: &Mat<N, U4, U4>,angle: N, axis: &Vec<N, U3>) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn scale<N: Scalar>(m: &Mat<N, U4, U4>, v: &Vec<N, U3>) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn translate<N: Scalar>(m: &Mat<N, U4, U4>, v: &Vec<N, U3>) -> Mat<N, U4, U4> {
unimplemented!()
}

View File

@ -0,0 +1,31 @@
use na::{Real, U4};
use aliases::{Vec, Qua};
pub fn conjugate<N: Real>(q: &Qua<N>) -> Qua<N> {
unimplemented!()
}
pub fn inverse<N: Real>(q: &Qua<N>) -> Qua<N> {
unimplemented!()
}
pub fn isinf<N: Real>(x: &Qua<N>) -> Vec<bool, U4> {
unimplemented!()
}
pub fn isnan<N: Real>(x: &Qua<N>) -> Vec<bool, U4> {
unimplemented!()
}
pub fn lerp<N: Real>(x: &Qua<N>, y: &Qua<N>,a: N) -> Qua<N> {
unimplemented!()
}
pub fn mix<N: Real>(x: &Qua<N>, y: &Qua<N>,a: N) -> Qua<N> {
unimplemented!()
}
pub fn slerp<N: Real>(x: &Qua<N>, y: &Qua<N>,a: N) -> Qua<N> {
unimplemented!()
}

View File

@ -0,0 +1,16 @@
use na::Real;
use aliases::Qua;
pub fn cross<N: Real>(q1: &Qua<N>, q2: &Qua<N>) -> Qua<N> {
unimplemented!()
}
pub fn dot<N: Real>(x: &Qua<N>, y: &Qua<N>) -> N {
unimplemented!()
}
pub fn length<N: Real>(q: &Qua<N>) -> N {
unimplemented!()
}
pub fn normalize<N: Real>(q: &Qua<N>) -> Qua<N> {
unimplemented!()
}

View File

@ -0,0 +1,4 @@
pub fn vec< 4, bool, Q > equal<N: Scalar>(x: &Qua<N>, y: &Qua<N>)
pub fn vec< 4, bool, Q > equal<N: Scalar>(x: &Qua<N>, y: &Qua<N>,epsilon: N)
pub fn vec< 4, bool, Q > notEqual<N: Scalar>(x: &Qua<N>, y: &Qua<N>)
pub fn vec< 4, bool, Q > notEqual<N: Scalar>(x: &Qua<N>, y: &Qua<N>,epsilon: N)

View File

@ -0,0 +1,19 @@
use na::{Real, U3};
use aliases::{Vec, Qua};
pub fn exp<N: Real>(q: &Qua<N>) -> Qua<N> {
unimplemented!()
}
pub fn log<N: Real>(q: &Qua<N>) -> Qua<N> {
unimplemented!()
}
pub fn pow<N: Real>(q: &Qua<N>, y: N) -> Qua<N> {
unimplemented!()
}
pub fn rotate<N: Real>(q: &Qua<N>, angle: N, axis: &Vec<N, U3>) -> Qua<N> {
unimplemented!()
}
pub fn sqrt<N: Real>(q: &Qua<N>) -> Qua<N> {
unimplemented!()
}

View File

@ -0,0 +1,13 @@
use na::{Real, U3};
use aliases::{Vec, Qua};
pub fn angle<N: Real>(x: &Qua<N>) -> N {
unimplemented!()
}
pub fn angleAxis<N: Real>(angle: N, axis: &Vec<N, U3>) -> Qua<N> {
unimplemented!()
}
pub fn axis<N: Real>(x: &Qua<N>) -> Vec<N, U3> {
unimplemented!()
}

View File

@ -0,0 +1,41 @@
use na::Scalar;
pub fn fmax<N: Scalar>(a: N, b: N) -> N {
unimplemented!()
}
pub fn fmax3<N: Scalar>(a: N, b: N, C: N) -> N {
unimplemented!()
}
pub fn fmax4<N: Scalar>(a: N, b: N, C: N, D: N) -> N {
unimplemented!()
}
pub fn fmin<N: Scalar>(a: N, b: N) -> N {
unimplemented!()
}
pub fn fmin3<N: Scalar>(a: N, b: N, c: N) -> N {
unimplemented!()
}
pub fn fmin4<N: Scalar>(a: N, b: N, c: N, d: N) -> N {
unimplemented!()
}
pub fn max3<N: Scalar>(a: N, b: N, c: N) -> N {
unimplemented!()
}
pub fn max4<N: Scalar>(a: N, b: N, c: N, d: N) -> N {
unimplemented!()
}
pub fn min3<N: Scalar>(a: N, b: N, c: N) -> N {
unimplemented!()
}
pub fn min4<N: Scalar>(a: N, b: N, c: N, d: N) -> N {
unimplemented!()
}

View File

@ -0,0 +1,7 @@
pub fn epsilon<T>() -> T {
unimplemented!()
}
pub fn pi<T>() -> T {
unimplemented!()
}

View File

@ -0,0 +1,64 @@
use na::{Scalar, DimName, DefaultAllocator};
use traits::Alloc;
use aliases::Vec;
pub fn fmax<N: Scalar, D: DimName>(a: &Vec<N, D>,b: N) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn fmax2<N: Scalar, D: DimName>(a: &Vec<N, D>, b: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn fmax3<N: Scalar, D: DimName>(a: &Vec<N, D>, b: &Vec<N, D>, c: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn fmax4<N: Scalar, D: DimName>(a: &Vec<N, D>, b: &Vec<N, D>, c: &Vec<N, D>, d: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn fmin<N: Scalar, D: DimName>(x: &Vec<N, D>,y: N) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn fmin2<N: Scalar, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn fmin3<N: Scalar, D: DimName>(a: &Vec<N, D>, b: &Vec<N, D>, c: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn fmin4<N: Scalar, D: DimName>(a: &Vec<N, D>, b: &Vec<N, D>, c: &Vec<N, D>, d: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn max3<N: Scalar, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>, z: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn max4<N: Scalar, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>, z: &Vec<N, D>, w: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn min3<N: Scalar, D: DimName>(a: &Vec<N, D>, b: &Vec<N, D>, c: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn min4<N: Scalar, D: DimName>(a: &Vec<N, D>, b: &Vec<N, D>, c: &Vec<N, D>, d: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}

View File

@ -0,0 +1,24 @@
use na::{Scalar, DimName, DefaultAllocator};
use traits::Alloc;
use aliases::Vec;
pub fn equal<N: Scalar, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>, epsilon: N) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn equal2<N: Scalar, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>, epsilon: &Vec<N, D>) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn notEqual<N: Scalar, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>, epsilon: N) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn notEqual2<N: Scalar, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>, epsilon: &Vec<N, D>) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}

View File

@ -0,0 +1,43 @@
use na::{Scalar, Real, DimName, U3, DefaultAllocator};
use traits::{Number, Alloc};
use aliases::Vec;
pub fn cross<N: Number, D: DimName>(x: &Vec<N, U3>, y: &Vec<N, U3>) -> Vec<N, U3> {
x.cross(y)
}
pub fn distance<N: Real, D: DimName>(p0: &Vec<N, D>, p1: &Vec<N, D>) -> N
where DefaultAllocator: Alloc<N, D> {
(p1 - p0).norm()
}
pub fn dot<N: Number, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>) -> N
where DefaultAllocator: Alloc<N, D> {
x.dot(y)
}
pub fn faceforward<N: Scalar, D: DimName>(N: &Vec<N, D>, I: &Vec<N, D>, Nref: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn length<N: Real, D: DimName>(x: &Vec<N, D>) -> N
where DefaultAllocator: Alloc<N, D> {
x.norm()
}
pub fn normalize<N: Real, D: DimName>(x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
x.normalize()
}
pub fn reflect<N: Scalar, D: DimName>(I: &Vec<N, D>, N: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn refract<N: Scalar, D: DimName>(I: &Vec<N, D>, N: &Vec<N, D>, eta: N) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}

View File

@ -0,0 +1,137 @@
use na::{Scalar, DimName, DefaultAllocator};
use traits::Alloc;
use aliases::*;
pub fn bitfieldDeinterleave(x: u16) -> U8Vec2 {
unimplemented!()
}
pub fn bitfieldDeinterleave2(x: u32) -> U16Vec2 {
unimplemented!()
}
pub fn bitfieldDeinterleave3(x: u64) -> U32Vec2 {
unimplemented!()
}
pub fn bitfieldFillOne<IU>(Value: IU, FirstBit: i32, BitCount: i32) -> IU {
unimplemented!()
}
pub fn bitfieldFillOne2<N: Scalar, D: DimName>(Value: &Vec<N, D>, FirstBit: i32, BitCount: i32) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn bitfieldFillZero<IU>(Value: IU, FirstBit: i32, BitCount: i32) -> IU {
unimplemented!()
}
pub fn bitfieldFillZero2<N: Scalar, D: DimName>(Value: &Vec<N, D>, FirstBit: i32, BitCount: i32) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn bitfieldInterleave(x: i8, y: i8) -> i16 {
unimplemented!()
}
pub fn bitfieldInterleave2(x: u8, y: u8) -> u16 {
unimplemented!()
}
pub fn bitfieldInterleave3(v: &U8Vec2) -> u16 {
unimplemented!()
}
pub fn bitfieldInterleave4(x: i16, y: i16) -> i32 {
unimplemented!()
}
pub fn bitfieldInterleave5(x: u16, y: u16) -> u32 {
unimplemented!()
}
pub fn bitfieldInterleave6(v: &U16Vec2) -> u32 {
unimplemented!()
}
pub fn bitfieldInterleave7(x: i32, y: i32) -> i64 {
unimplemented!()
}
pub fn bitfieldInterleave8(x: u32, y: u32) -> u64 {
unimplemented!()
}
pub fn bitfieldInterleave9(v: &U32Vec2) -> u64 {
unimplemented!()
}
pub fn bitfieldInterleave10(x: i8, y: i8, z: i8) -> i32 {
unimplemented!()
}
pub fn bitfieldInterleave11(x: u8, y: u8, z: u8) -> u32 {
unimplemented!()
}
pub fn bitfieldInterleave12(x: i16, y: i16, z: i16) -> i64 {
unimplemented!()
}
pub fn bitfieldInterleave13(x: u16, y: u16, z: u16) -> u64 {
unimplemented!()
}
pub fn bitfieldInterleave14(x: i32, y: i32, z: i32) -> i64 {
unimplemented!()
}
pub fn bitfieldInterleave15(x: u32, y: u32, z: u32) -> u64 {
unimplemented!()
}
pub fn bitfieldInterleave16(x: i8, y: i8, z: i8, w: i8) -> i32 {
unimplemented!()
}
pub fn bitfieldInterleave17(x: u8, y: u8, z: u8, w: u8) -> u32 {
unimplemented!()
}
pub fn bitfieldInterleave18(x: i16, y: i16, z: i16, w: i16) -> i64 {
unimplemented!()
}
pub fn bitfieldInterleave19(x: u16, y: u16, z: u16, w: u16) -> u64 {
unimplemented!()
}
pub fn bitfieldRotateLeft<IU>(In: IU, Shift: i32) -> IU {
unimplemented!()
}
pub fn bitfieldRotateLeft2<N: Scalar, D: DimName>(In: &Vec<N, D>, Shift: i32) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn bitfieldRotateRight<IU>(In: IU, Shift: i32) -> IU {
unimplemented!()
}
pub fn bitfieldRotateRight2<N: Scalar, D: DimName>(In: &Vec<N, D>, Shift: i32) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn mask<IU>(Bits: IU) -> IU {
unimplemented!()
}
pub fn mask2<N: Scalar, D: DimName>(v: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}

View File

@ -0,0 +1,108 @@
pub fn e<T>() -> T {
unimplemented!()
}
pub fn euler<T>() -> T {
unimplemented!()
}
pub fn four_over_pi<T>() -> T {
unimplemented!()
}
pub fn golden_ratio<T>() -> T {
unimplemented!()
}
pub fn half_pi<T>() -> T {
unimplemented!()
}
pub fn ln_ln_two<T>() -> T {
unimplemented!()
}
pub fn ln_ten<T>() -> T {
unimplemented!()
}
pub fn ln_two<T>() -> T {
unimplemented!()
}
pub fn one<T>() -> T {
unimplemented!()
}
pub fn one_over_pi<T>() -> T {
unimplemented!()
}
pub fn one_over_root_two<T>() -> T {
unimplemented!()
}
pub fn one_over_two_pi<T>() -> T {
unimplemented!()
}
pub fn quarter_pi<T>() -> T {
unimplemented!()
}
pub fn root_five<T>() -> T {
unimplemented!()
}
pub fn root_half_pi<T>() -> T {
unimplemented!()
}
pub fn root_ln_four<T>() -> T {
unimplemented!()
}
pub fn root_pi<T>() -> T {
unimplemented!()
}
pub fn root_three<T>() -> T {
unimplemented!()
}
pub fn root_two<T>() -> T {
unimplemented!()
}
pub fn root_two_pi<T>() -> T {
unimplemented!()
}
pub fn third<T>() -> T {
unimplemented!()
}
pub fn three_over_two_pi<T>() -> T {
unimplemented!()
}
pub fn two_over_pi<T>() -> T {
unimplemented!()
}
pub fn two_over_root_pi<T>() -> T {
unimplemented!()
}
pub fn two_pi<T>() -> T {
unimplemented!()
}
pub fn two_thirds<T>() -> T {
unimplemented!()
}
pub fn zero<T>() -> T {
unimplemented!()
}

View File

@ -0,0 +1,22 @@
use na::{DimName, Scalar, DefaultAllocator};
use traits::Alloc;
use aliases::Vec;
pub fn epsilonEqual<N: Scalar, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>, epsilon: N) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn epsilonEqual2<T>(x: T, y: T, epsilon: T) -> bool {
unimplemented!()
}
pub fn epsilonNotEqual<N: Scalar, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>, epsilon: N) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn epsilonNotEqual2<T>(x: T, y: T, epsilon: T) -> bool {
unimplemented!()
}

View File

@ -0,0 +1,18 @@
use na::{DimName, Scalar, DefaultAllocator};
use traits::Alloc;
use aliases::Vec;
pub fn iround<N: Scalar, D: DimName>(x: &Vec<N, D>) -> Vec<i64, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn log2<I>(x: I) -> I {
unimplemented!()
}
pub fn uround<N: Scalar, D: DimName>(x: &Vec<N, D>) -> Vec<u64, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}

View File

@ -0,0 +1,24 @@
use na::{Scalar, DimName, DefaultAllocator};
use traits::Alloc;
use aliases::{Vec, Mat};
pub fn column<N: Scalar, R: DimName, C: DimName>(m: &Mat<N, R, C>, index: usize) -> Vec<N, C>
where DefaultAllocator: Alloc<N, R, C> {
unimplemented!()
}
pub fn column2<N: Scalar, R: DimName, C: DimName>(m: &Mat<N, R, C>, index: usize, x: &Vec<N, C>) -> Mat<N, R, C>
where DefaultAllocator: Alloc<N, R, C> {
unimplemented!()
}
pub fn row<N: Scalar, R: DimName, C: DimName>(m: &Mat<N, R, C>, index: usize) -> Vec<N, R>
where DefaultAllocator: Alloc<N, R, C> {
unimplemented!()
}
pub fn row2<N: Scalar, R: DimName, C: DimName>(m: &Mat<N, R, C>, index: usize, x: &Vec<N, R>) -> Mat<N, R, C>
where DefaultAllocator: Alloc<N, R, C> {
unimplemented!()
}

View File

@ -0,0 +1,14 @@
use na::{Scalar, DimName, DefaultAllocator};
use traits::Alloc;
use aliases::Mat;
pub fn affineInverse<N: Scalar, D: DimName>(m: &Mat<N, D, D>) -> Mat<N, D, D>
where DefaultAllocator: Alloc<N, D, D> {
unimplemented!()
}
pub fn inverseTranspose<N: Scalar, D: DimName>(m: &Mat<N, D, D>) -> Mat<N, D, D>
where DefaultAllocator: Alloc<N, D, D> {
unimplemented!()
}

View File

@ -0,0 +1,291 @@
use na::{Scalar, Real, DimName, DefaultAllocator, U3, U4};
use traits::Alloc;
use aliases::*;
pub fn packF2x11_1x10(v: &Vec3) -> i32 {
unimplemented!()
}
pub fn packF3x9_E1x5(v: &Vec3) -> i32 {
unimplemented!()
}
pub fn packHalf<D: DimName>(v: &Vec<f32, D>) -> Vec<u16, D>
where DefaultAllocator: Alloc<u16, D> {
unimplemented!()
}
pub fn packHalf1x16(v: f32) -> u16 {
unimplemented!()
}
pub fn packHalf4x16(v: &Vec4) -> u64 {
unimplemented!()
}
pub fn packI3x10_1x2(v: &IVec4) -> i32 {
unimplemented!()
}
pub fn packInt2x16(v: &I16Vec2) -> i32 {
unimplemented!()
}
pub fn packInt2x32(v: &I32Vec2) -> i64 {
unimplemented!()
}
pub fn packInt2x8(v: &I8Vec2) -> i16 {
unimplemented!()
}
pub fn packInt4x16(v: &I16Vec4) -> i64 {
unimplemented!()
}
pub fn packInt4x8(v: &I8Vec4) -> i32 {
unimplemented!()
}
pub fn packRGBM<N: Scalar>(rgb: &Vec<N, U3>) -> Vec<N, U4> {
unimplemented!()
}
pub fn packSnorm<I: Scalar, N: Real, D: DimName>(v: Vec<N, D>) -> Vec<I, D>
where DefaultAllocator: Alloc<N, D> + Alloc<I, D> {
unimplemented!()
}
pub fn packSnorm1x16(v: f32) -> u16 {
unimplemented!()
}
pub fn packSnorm1x8(s: f32) -> u8 {
unimplemented!()
}
pub fn packSnorm2x8(v: &Vec2) -> u16 {
unimplemented!()
}
pub fn packSnorm3x10_1x2(v: &Vec4) -> i32 {
unimplemented!()
}
pub fn packSnorm4x16(v: &Vec4) -> u64 {
unimplemented!()
}
pub fn packU3x10_1x2(v: &UVec4) -> i32 {
unimplemented!()
}
pub fn packUint2x16(v: &U16Vec2) -> u32 {
unimplemented!()
}
pub fn packUint2x32(v: &U32Vec2) -> u64 {
unimplemented!()
}
pub fn packUint2x8(v: &U8Vec2) -> u16 {
unimplemented!()
}
pub fn packUint4x16(v: &U16Vec4) -> u64 {
unimplemented!()
}
pub fn packUint4x8(v: &U8Vec4) -> i32 {
unimplemented!()
}
pub fn packUnorm<UI: Scalar, N: Real, D: DimName>(v: &Vec<N, D>) -> Vec<UI, D>
where DefaultAllocator: Alloc<N, D> + Alloc<UI, D> {
unimplemented!()
}
pub fn packUnorm1x16(v: f32) -> u16 {
unimplemented!()
}
pub fn packUnorm1x5_1x6_1x5(v: &Vec3) -> u16 {
unimplemented!()
}
pub fn packUnorm1x8(v: f32) -> u8 {
unimplemented!()
}
pub fn packUnorm2x3_1x2(v: &Vec3) -> u8 {
unimplemented!()
}
pub fn packUnorm2x4(v: &Vec2) -> u8 {
unimplemented!()
}
pub fn packUnorm2x8(v: &Vec2) -> u16 {
unimplemented!()
}
pub fn packUnorm3x10_1x2(v: &Vec4) -> i32 {
unimplemented!()
}
pub fn packUnorm3x5_1x1(v: &Vec4) -> u16 {
unimplemented!()
}
pub fn packUnorm4x16(v: &Vec4) -> u64 {
unimplemented!()
}
pub fn packUnorm4x4(v: &Vec4) -> u16 {
unimplemented!()
}
pub fn unpackF2x11_1x10(p: i32) -> Vec3 {
unimplemented!()
}
pub fn unpackF3x9_E1x5(p: i32) -> Vec3 {
unimplemented!()
}
pub fn unpackHalf<N: Scalar, D: DimName>(p: Vec<i16, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn unpackHalf1x16(v: u16) -> f32 {
unimplemented!()
}
pub fn unpackHalf4x16(p: u64) -> Vec4 {
unimplemented!()
}
pub fn unpackI3x10_1x2(p: i32) -> IVec4 {
unimplemented!()
}
pub fn unpackInt2x16(p: i32) -> I16Vec2 {
unimplemented!()
}
pub fn unpackInt2x32(p: i64) -> I32Vec2 {
unimplemented!()
}
pub fn unpackInt2x8(p: i16) -> I8Vec2 {
unimplemented!()
}
pub fn unpackInt4x16(p: i64) -> I16Vec4 {
unimplemented!()
}
pub fn unpackInt4x8(p: i32) -> I8Vec4 {
unimplemented!()
}
pub fn unpackRGBM<N: Scalar>(rgbm: &Vec<N, U4>) -> Vec<N, U3> {
unimplemented!()
}
pub fn unpackSnorm<I: Scalar, N: Real, D: DimName>(v: &Vec<I, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> + Alloc<I, D> {
unimplemented!()
}
pub fn unpackSnorm1x16(p: u16) -> f32 {
unimplemented!()
}
pub fn unpackSnorm1x8(p: u8) -> f32 {
unimplemented!()
}
pub fn unpackSnorm2x8(p: u16) -> Vec2 {
unimplemented!()
}
pub fn unpackSnorm3x10_1x2(p: i32) -> Vec4 {
unimplemented!()
}
pub fn unpackSnorm4x16(p: u64) -> Vec4 {
unimplemented!()
}
pub fn unpackU3x10_1x2(p: i32) -> UVec4 {
unimplemented!()
}
pub fn unpackUint2x16(p: u32) -> U16Vec2 {
unimplemented!()
}
pub fn unpackUint2x32(p: u64) -> U32Vec2 {
unimplemented!()
}
pub fn unpackUint2x8(p: u16) -> U8Vec2 {
unimplemented!()
}
pub fn unpackUint4x16(p: u64) -> U16Vec4 {
unimplemented!()
}
pub fn unpackUint4x8(p: i32) -> U8Vec4 {
unimplemented!()
}
pub fn unpackUnorm<UI: Scalar, N: Real, D: DimName>(v: &Vec<UI, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> + Alloc<UI, D> {
unimplemented!()
}
pub fn unpackUnorm1x16(p: u16) -> f32 {
unimplemented!()
}
pub fn unpackUnorm1x5_1x6_1x5(p: u16) -> Vec3 {
unimplemented!()
}
pub fn unpackUnorm1x8(p: u8) -> f32 {
unimplemented!()
}
pub fn unpackUnorm2x3_1x2(p: u8) -> Vec3 {
unimplemented!()
}
pub fn unpackUnorm2x4(p: u8) -> Vec2 {
unimplemented!()
}
pub fn unpackUnorm2x8(p: u16) -> Vec2 {
unimplemented!()
}
pub fn unpackUnorm3x10_1x2(p: i32) -> Vec4 {
unimplemented!()
}
pub fn unpackUnorm3x5_1x1(p: u16) -> Vec4 {
unimplemented!()
}
pub fn unpackUnorm4x16(p: u64) -> Vec4 {
unimplemented!()
}
pub fn unpackUnorm4x4(p: u16) -> Vec4 {
unimplemented!()
}

View File

@ -0,0 +1,64 @@
use na::{Real, U3, U4};
use aliases::{Qua, Vec, Mat};
pub fn eulerAngles<N: Real>(x: &Qua<N>) -> Vec<N, U3> {
unimplemented!()
}
pub fn greaterThan<N: Real>(x: &Qua<N>, y: &Qua<N>) -> Vec<bool, U4> {
unimplemented!()
}
pub fn greaterThanEqual<N: Real>(x: &Qua<N>, y: &Qua<N>) -> Vec<bool, U4> {
unimplemented!()
}
pub fn lessThan<N: Real>(x: &Qua<N>, y: &Qua<N>) -> Vec<bool, U4> {
unimplemented!()
}
pub fn lessThanEqual<N: Real>(x: &Qua<N>, y: &Qua<N>) -> Vec<bool, U4> {
unimplemented!()
}
pub fn mat3_cast<N: Real>(x: &Qua<N>) -> Mat<N, U3, U3> {
unimplemented!()
}
pub fn mat4_cast<N: Real>(x: &Qua<N>) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn pitch<N: Real>(x: &Qua<N>) -> N {
unimplemented!()
}
pub fn quat_cast<N: Real>(x: &Mat<N, U3, U3>) -> Qua<N> {
unimplemented!()
}
pub fn quat_cast2<N: Real>(x: &Mat<N, U4, U4>) -> Qua<N> {
unimplemented!()
}
pub fn quatLookAt<N: Real>(direction: &Vec<N, U3>, up: &Vec<N, U3>) -> Qua<N> {
unimplemented!()
}
pub fn quatLookAtLH<N: Real>(direction: &Vec<N, U3>, up: &Vec<N, U3>) -> Qua<N> {
unimplemented!()
}
pub fn quatLookAtRH<N: Real>(direction: &Vec<N, U3>, up: &Vec<N, U3>) -> Qua<N> {
unimplemented!()
}
pub fn roll<N: Real>(x: &Qua<N>) -> N {
unimplemented!()
}
pub fn yaw<N: Real>(x: &Qua<N>) -> N {
unimplemented!()
}

View File

@ -0,0 +1,47 @@
pub fn acot<T>(x: T) -> T {
unimplemented!()
}
pub fn acoth<T>(x: T) -> T {
unimplemented!()
}
pub fn acsc<T>(x: T) -> T {
unimplemented!()
}
pub fn acsch<T>(x: T) -> T {
unimplemented!()
}
pub fn asec<T>(x: T) -> T {
unimplemented!()
}
pub fn asech<T>(x: T) -> T {
unimplemented!()
}
pub fn cot<T>(angle: T) -> T {
unimplemented!()
}
pub fn coth<T>(angle: T) -> T {
unimplemented!()
}
pub fn csc<T>(angle: T) -> T {
unimplemented!()
}
pub fn csch<T>(angle: T) -> T {
unimplemented!()
}
pub fn sec<T>(angle: T) -> T {
unimplemented!()
}
pub fn sech<T>(angle: T) -> T {
unimplemented!()
}

View File

@ -0,0 +1,82 @@
use na::{Scalar, Real, DimName, U3, DefaultAllocator};
use traits::{Number, Alloc};
use aliases::Vec;
pub fn ceilMultiple<T>(v: T, Multiple: T) -> T {
unimplemented!()
}
pub fn ceilMultiple2<N: Scalar, D: DimName>(v: &Vec<N, D>, Multiple: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn ceilPowerOfTwo<IU>(v: IU) -> IU {
unimplemented!()
}
pub fn ceilPowerOfTwo2<N: Scalar, D: DimName>(v: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn floorMultiple<T>(v: T, Multiple: T) -> T {
unimplemented!()
}
pub fn floorMultiple2<N: Scalar, D: DimName>(v: &Vec<N, D>, Multiple: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn floorPowerOfTwo<IU>(v: IU) -> IU {
unimplemented!()
}
pub fn floorPowerOfTwo2<N: Scalar, D: DimName>(v: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn isMultiple<IU>(v: IU, Multiple: IU) -> bool {
unimplemented!()
}
pub fn isMultiple2<N: Scalar, D: DimName>(v: &Vec<N, D>,Multiple: N) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn isMultiple3<N: Scalar, D: DimName>(v: &Vec<N, D>, Multiple: &Vec<N, D>) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn isPowerOfTwo2<IU>(v: IU) -> bool {
unimplemented!()
}
pub fn isPowerOfTwo<N: Scalar, D: DimName>(v: &Vec<N, D>) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn roundMultiple<T>(v: T, Multiple: T) -> T {
unimplemented!()
}
pub fn roundMultiple2<N: Scalar, D: DimName>(v: &Vec<N, D>, Multiple: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn roundPowerOfTwo<IU>(v: IU) -> IU {
unimplemented!()
}
pub fn roundPowerOfTwo2<N: Scalar, D: DimName>(v: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}

View File

@ -0,0 +1,137 @@
use na::{Scalar, Real, U1, U2, U3, U4};
use aliases::{Qua, Vec, Mat};
pub fn make_mat2<N: Scalar>(ptr: &[N]) -> Mat<N, U2, U2> {
unimplemented!()
}
pub fn make_mat2x2<N: Scalar>(ptr: &[N]) -> Mat<N, U2, U2> {
unimplemented!()
}
pub fn make_mat2x3<N: Scalar>(ptr: &[N]) -> Mat<N, U2, U3> {
unimplemented!()
}
pub fn make_mat2x4<N: Scalar>(ptr: &[N]) -> Mat<N, U2, U4> {
unimplemented!()
}
pub fn make_mat3<N: Scalar>(ptr: &[N]) -> Mat<N, U3, U3> {
unimplemented!()
}
pub fn make_mat3x2<N: Scalar>(ptr: &[N]) -> Mat<N, U3, U2> {
unimplemented!()
}
pub fn make_mat3x3<N: Scalar>(ptr: &[N]) -> Mat<N, U3, U3> {
unimplemented!()
}
pub fn make_mat3x4<N: Scalar>(ptr: &[N]) -> Mat<N, U3, U4> {
unimplemented!()
}
pub fn make_mat4<N: Scalar>(ptr: &[N]) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn make_mat4x2<N: Scalar>(ptr: &[N]) -> Mat<N, U4, U2> {
unimplemented!()
}
pub fn make_mat4x3<N: Scalar>(ptr: &[N]) -> Mat<N, U4, U3> {
unimplemented!()
}
pub fn make_mat4x4<N: Scalar>(ptr: &[N]) -> Mat<N, U4, U4> {
unimplemented!()
}
pub fn make_quat<N: Real>(ptr: &[N]) -> Qua<N> {
unimplemented!()
}
pub fn make_vec1<N: Scalar>(v: &Vec<N, U1>) -> Vec<N, U1> {
unimplemented!()
}
pub fn make_vec1_2<N: Scalar>(v: &Vec<N, U2>) -> Vec<N, U1> {
unimplemented!()
}
pub fn make_vec1_3<N: Scalar>(v: &Vec<N, U3>) -> Vec<N, U1> {
unimplemented!()
}
pub fn make_vec1_4<N: Scalar>(v: &Vec<N, U4>) -> Vec<N, U1> {
unimplemented!()
}
pub fn make_vec2_1<N: Scalar>(v: &Vec<N, U1>) -> Vec<N, U2> {
unimplemented!()
}
pub fn make_vec2_2<N: Scalar>(v: &Vec<N, U2>) -> Vec<N, U2> {
unimplemented!()
}
pub fn make_vec2_3<N: Scalar>(v: &Vec<N, U3>) -> Vec<N, U2> {
unimplemented!()
}
pub fn make_vec2_4<N: Scalar>(v: &Vec<N, U4>) -> Vec<N, U2> {
unimplemented!()
}
pub fn make_vec2<N: Scalar>(ptr: &[N]) -> Vec<N, U2> {
unimplemented!()
}
pub fn make_vec3_1<N: Scalar>(v: &Vec<N, U1>) -> Vec<N, U3> {
unimplemented!()
}
pub fn make_vec3_2<N: Scalar>(v: &Vec<N, U2>) -> Vec<N, U3> {
unimplemented!()
}
pub fn make_vec3_3<N: Scalar>(v: &Vec<N, U3>) -> Vec<N, U3> {
unimplemented!()
}
pub fn make_vec3_4<N: Scalar>(v: &Vec<N, U4>) -> Vec<N, U3> {
unimplemented!()
}
pub fn make_vec3<N: Scalar>(ptr: &[N]) -> Vec<N, U3> {
unimplemented!()
}
pub fn make_vec4_1<N: Scalar>(v: &Vec<N, U1>) -> Vec<N, U4> {
unimplemented!()
}
pub fn make_vec4_2<N: Scalar>(v: &Vec<N, U2>) -> Vec<N, U4> {
unimplemented!()
}
pub fn make_vec4_3<N: Scalar>(v: &Vec<N, U3>) -> Vec<N, U4> {
unimplemented!()
}
pub fn make_vec4_4<N: Scalar>(v: &Vec<N, U4>) -> Vec<N, U4> {
unimplemented!()
}
pub fn make_vec4<N: Scalar>(ptr: &[N]) -> Vec<N, U4> {
unimplemented!()
}
pub fn value_ptr<T, V>(x: &T) -> &V {
unimplemented!()
}

View File

@ -0,0 +1,28 @@
use na::{Scalar, U2};
use aliases::Vec;
pub fn float_distance<T>(x: T, y: T) -> u64 {
unimplemented!()
}
pub fn float_distance2<N: Scalar>(x: &Vec<N, U2>, y: &Vec<N, U2>) -> Vec<u64, U2> {
unimplemented!()
}
pub fn next_float<T>(x: T) -> T {
unimplemented!()
}
pub fn next_float2<T>(x: T, Distance: u64) -> T {
unimplemented!()
}
pub fn prev_float<T>(x: T) -> T {
unimplemented!()
}
pub fn prev_float2<T>(x: T, Distance: u64) -> T {
unimplemented!()
}

View File

@ -0,0 +1,66 @@
use na::{Scalar, Real, DimName, U3, DefaultAllocator};
use traits::{Number, Alloc};
use aliases::Vec;
pub fn bitCount<T>(v: T) -> i32 {
unimplemented!()
}
pub fn bitCount2<N: Scalar, D: DimName>(v: &Vec<N, D>) -> Vec<i32, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn bitfieldExtract<N: Scalar, D: DimName>(Value: &Vec<N, D>, Offset: i32, Bits: i32) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn bitfieldInsert<N: Scalar, D: DimName>(Base: &Vec<N, D>, Insert: &Vec<N, D>, Offset: i32, Bits: i32) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn bitfieldReverse<N: Scalar, D: DimName>(v: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn findLSB<IU>(x: IU) -> u32 {
unimplemented!()
}
pub fn findLSB2<N: Scalar, D: DimName>(v: &Vec<N, D>) -> Vec<i32, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn findMSB<IU>(x: IU) -> i32 {
unimplemented!()
}
pub fn findMSB2<N: Scalar, D: DimName>(v: &Vec<N, D>) -> Vec<i32, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn imulExtended<N: Scalar, D: DimName>(x: &Vec<i32, D>, y: &Vec<i32, D>, msb: &Vec<i32, D>, lsb: &Vec<i32, D>)
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn uaddCarry<N: Scalar, D: DimName>(x: &Vec<u32, D>, y: &Vec<u32, D>, carry: &Vec<u32, D>) -> Vec<u32, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn umulExtended<N: Scalar, D: DimName>(x: &Vec<u32, D>, y: &Vec<u32, D>, msb: &Vec<u32, D>, lsb: &Vec<u32, D>)
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}
pub fn usubBorrow<N: Scalar, D: DimName>(x: &Vec<u32, D>, y: &Vec<u32, D>, borrow: &Vec<u32, D>) -> Vec<u32, D>
where DefaultAllocator: Alloc<N, D> {
unimplemented!()
}

48
nalgebra-glm/src/lib.rs Normal file
View File

@ -0,0 +1,48 @@
extern crate num_traits as num;
extern crate alga;
extern crate nalgebra as na;
pub use aliases::*;
pub use constructors::*;
pub use geometric::*;
pub use matrix::*;
pub use traits::*;
pub use trigonometric::*;
pub use vector_relational::*;
pub use exponential::*;
mod aliases;
pub mod constructors;
mod common;
pub mod matrix;
pub mod geometric;
mod traits;
pub mod trigonometric;
pub mod vector_relational;
pub mod exponential;
pub mod integer;
pub mod packing;
pub mod ext_matrix_clip_space;
pub mod ext_matrix_projection;
pub mod ext_matrix_relationnal;
pub mod ext_matrix_transform;
pub mod ext_quaternion_common;
pub mod ext_quaternion_geometric;
pub mod ext_quaternion_transform;
pub mod ext_quaternion_trigonometric;
pub mod ext_scalar_common;
pub mod ext_scalar_constants;
pub mod ext_vector_common;
pub mod ext_vector_relational;
pub mod gtc_bitfield;
pub mod gtc_constants;
pub mod gtc_epsilon;
pub mod gtc_integer;
pub mod gtc_matrix_access;
pub mod gtc_matrix_inverse;
pub mod gtc_packing;
pub mod gtc_quaternion;
pub mod gtc_reciprocal;
pub mod gtc_round;
pub mod gtc_type_ptr;
pub mod gtc_ulp;

View File

@ -0,0 +1,32 @@
use num::Num;
use traits::{Alloc, Number};
use na::{Scalar, Real, DimName, DefaultAllocator, U1};
use na::allocator::Allocator;
use aliases::{Mat, Vec};
//pub fn determinant<N: Real, D: DimName>(m: &Mat<N, D, D>) -> N
// where DefaultAllocator: Allocator<N, D, D> {
// m.determinant()
//}
pub fn inverse<N: Real, D: DimName>(m: &Mat<N, D, D>) -> Mat<N, D, D>
where DefaultAllocator: Alloc<N, D, D> {
m.clone().try_inverse().unwrap_or(Mat::<N, D, D>::zeros())
}
pub fn matrix_comp_mult<N: Number, R: DimName, C: DimName>(x: &Mat<N, R, C>, y: &Mat<N, R, C>) -> Mat<N, R, C>
where DefaultAllocator: Alloc<N, R, C> {
x.component_mul(y)
}
pub fn outer_product<N: Number, R: DimName, C: DimName>(c: &Vec<N, R>, r: &Vec<N, C>) -> Mat<N, R, C>
where DefaultAllocator: Alloc<N, R, C> {
c * r.transpose()
}
pub fn transpose<N: Scalar, R: DimName, C: DimName>(x: &Mat<N, R, C>) -> Mat<N, C, R>
where DefaultAllocator: Alloc<N, R, C> {
x.transpose()
}

View File

@ -0,0 +1,52 @@
use na::Scalar;
use aliases::{Vec2, Vec4, UVec2};
pub fn packDouble2x32<N: Scalar>(v: &UVec2) -> f64 {
unimplemented!()
}
pub fn packHalf2x16<N: Scalar>(v: &Vec2) -> u32 {
unimplemented!()
}
pub fn packSnorm2x16<N: Scalar>(v: &Vec2) -> u32 {
unimplemented!()
}
pub fn packSnorm4x8<N: Scalar>(v: &Vec4) -> u32 {
unimplemented!()
}
pub fn packUnorm2x16<N: Scalar>(v: &Vec2) -> u32 {
unimplemented!()
}
pub fn packUnorm4x8<N: Scalar>(v: &Vec4) -> u32 {
unimplemented!()
}
pub fn unpackDouble2x32<N: Scalar>(v: f64) -> UVec2 {
unimplemented!()
}
pub fn unpackHalf2x16<N: Scalar>(v: u32) -> Vec2 {
unimplemented!()
}
pub fn unpackSnorm2x16<N: Scalar>(p: u32) -> Vec2 {
unimplemented!()
}
pub fn unpackSnorm4x8<N: Scalar>(p: u32) -> Vec4 {
unimplemented!()
}
pub fn unpackUnorm2x16<N: Scalar>(p: u32) -> Vec2 {
unimplemented!()
}
pub fn unpackUnorm4x8<N: Scalar>(p: u32) -> Vec4 {
unimplemented!()
}

View File

@ -0,0 +1,39 @@
use std::cmp::{PartialOrd, PartialEq};
use alga::general::Ring;
use na::{Scalar, DimName, U1};
use na::allocator::Allocator;
pub trait Number: Scalar + Ring + PartialOrd + PartialEq {
}
impl<T: Scalar + Ring + PartialOrd + PartialEq> Number for T {
}
#[doc(hidden)]
pub trait Alloc<N: Scalar, R: DimName, C: DimName = U1>:
Allocator<N, R> + Allocator<N, C> + Allocator<N, U1, R> + Allocator<N, U1, C> + Allocator<N, R, C> + Allocator<N, C, R> + Allocator<N, R, R> + Allocator<N, C, C> +
Allocator<bool, R> + Allocator<bool, C> +
Allocator<f32, R> + Allocator<f32, C> +
Allocator<u32, R> + Allocator<u32, C> +
Allocator<i32, R> + Allocator<i32, C> +
Allocator<f64, R> + Allocator<f64, C> +
Allocator<u64, R> + Allocator<u64, C> +
Allocator<i64, R> + Allocator<i64, C> +
Allocator<i16, R> + Allocator<i16, C>
{
}
impl<N: Scalar, R: DimName, C: DimName, T>
Alloc<N, R, C> for T
where T: Allocator<N, R> + Allocator<N, C> + Allocator<N, U1, R> + Allocator<N, U1, C> + Allocator<N, R, C> + Allocator<N, C, R> + Allocator<N, R, R> + Allocator<N, C, C> +
Allocator<bool, R> + Allocator<bool, C> +
Allocator<f32, R> + Allocator<f32, C> +
Allocator<u32, R> + Allocator<u32, C> +
Allocator<i32, R> + Allocator<i32, C> +
Allocator<f64, R> + Allocator<f64, C> +
Allocator<u64, R> + Allocator<u64, C> +
Allocator<i64, R> + Allocator<i64, C> +
Allocator<i16, R> + Allocator<i16, C> {
}

View File

@ -0,0 +1,73 @@
use na::{self, Real, DimName, DefaultAllocator};
use aliases::Vec;
use traits::Alloc;
pub fn acos<N: Real, D: DimName>(x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
x.map(|e| e.acos())
}
pub fn acosh<N: Real, D: DimName>(x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
x.map(|e| e.acosh())
}
pub fn asin<N: Real, D: DimName>(x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
x.map(|e| e.asin())
}
pub fn asinh<N: Real, D: DimName>(x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
x.map(|e| e.asinh())
}
pub fn atan2<N: Real, D: DimName>(y: &Vec<N, D>, x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
y.zip_map(x, |y, x| y.atan2(x))
}
pub fn atan<N: Real, D: DimName>(y_over_x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
y_over_x.map(|e| e.atan())
}
pub fn atanh<N: Real, D: DimName>(x: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
x.map(|e| e.atanh())
}
pub fn cos<N: Real, D: DimName>(angle: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
angle.map(|e| e.cos())
}
pub fn cosh<N: Real, D: DimName>(angle: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
angle.map(|e| e.cosh())
}
pub fn degrees<N: Real, D: DimName>(radians: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
radians.map(|e| e * na::convert(180.0) / N::pi())
}
pub fn radians<N: Real, D: DimName>(degrees: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
degrees.map(|e| e * N::pi() / na::convert(180.0))
}
pub fn sin<N: Real, D: DimName>(angle: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
angle.map(|e| e.sin())
}
pub fn sinh<N: Real, D: DimName>(angle: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
angle.map(|e| e.sinh())
}
pub fn tan<N: Real, D: DimName>(angle: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
angle.map(|e| e.tan())
}
pub fn tanh<N: Real, D: DimName>(angle: &Vec<N, D>) -> Vec<N, D>
where DefaultAllocator: Alloc<N, D> {
angle.map(|e| e.tanh())
}

View File

@ -0,0 +1,50 @@
use na::{self, Real, DimName, DefaultAllocator};
use aliases::Vec;
use traits::{Number, Alloc};
pub fn all<D: DimName>(v: &Vec<bool, D>) -> bool
where DefaultAllocator: Alloc<bool, D> {
v.iter().all(|x| *x)
}
pub fn any<D: DimName>(v: &Vec<bool, D>) -> bool
where DefaultAllocator: Alloc<bool, D> {
v.iter().any(|x| *x)
}
pub fn equal<N: Number, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
x.zip_map(y, |x, y| x == y)
}
pub fn greaterThan<N: Number, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
x.zip_map(y, |x, y| x > y)
}
pub fn greaterThanEqual<N: Number, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
x.zip_map(y, |x, y| x >= y)
}
pub fn lessThan<N: Number, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
x.zip_map(y, |x, y| x < y)
}
pub fn lessThanEqual<N: Number, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
x.zip_map(y, |x, y| x <= y)
}
pub fn not<D: DimName>(v: &Vec<bool, D>) -> Vec<bool, D>
where DefaultAllocator: Alloc<bool, D> {
v.map(|x| !x)
}
pub fn notEqual<N: Number, D: DimName>(x: &Vec<N, D>, y: &Vec<N, D>) -> Vec<bool, D>
where DefaultAllocator: Alloc<N, D> {
x.zip_map(y, |x, y| x != y)
}