From bee63859c086995c44d60ab07171dad97eef4be3 Mon Sep 17 00:00:00 2001 From: sebcrozet Date: Thu, 20 Sep 2018 10:50:34 +0200 Subject: [PATCH] Setup functions signatures for the glm interface. --- Cargo.toml | 2 +- nalgebra-glm/Cargo.toml | 9 + nalgebra-glm/README | 6 + nalgebra-glm/src/aliases.rs | 95 ++++++ nalgebra-glm/src/common.rs | 209 +++++++++++++ nalgebra-glm/src/constructors.rs | 119 +++++++ nalgebra-glm/src/exponential.rs | 39 +++ nalgebra-glm/src/ext_matrix_clip_space.rs | 170 ++++++++++ nalgebra-glm/src/ext_matrix_projection.rs | 32 ++ nalgebra-glm/src/ext_matrix_relationnal.rs | 35 +++ nalgebra-glm/src/ext_matrix_transform.rs | 31 ++ nalgebra-glm/src/ext_quaternion_common.rs | 31 ++ nalgebra-glm/src/ext_quaternion_geometric.rs | 16 + nalgebra-glm/src/ext_quaternion_relational.rs | 4 + nalgebra-glm/src/ext_quaternion_transform.rs | 19 ++ .../src/ext_quaternion_trigonometric.rs | 13 + nalgebra-glm/src/ext_scalar_common.rs | 41 +++ nalgebra-glm/src/ext_scalar_constants.rs | 7 + nalgebra-glm/src/ext_vector_common.rs | 64 ++++ nalgebra-glm/src/ext_vector_relational.rs | 24 ++ nalgebra-glm/src/geometric.rs | 43 +++ nalgebra-glm/src/gtc_bitfield.rs | 137 +++++++++ nalgebra-glm/src/gtc_constants.rs | 108 +++++++ nalgebra-glm/src/gtc_epsilon.rs | 22 ++ nalgebra-glm/src/gtc_integer.rs | 18 ++ nalgebra-glm/src/gtc_matrix_access.rs | 24 ++ nalgebra-glm/src/gtc_matrix_inverse.rs | 14 + nalgebra-glm/src/gtc_packing.rs | 291 ++++++++++++++++++ nalgebra-glm/src/gtc_quaternion.rs | 64 ++++ nalgebra-glm/src/gtc_reciprocal.rs | 47 +++ nalgebra-glm/src/gtc_round.rs | 82 +++++ nalgebra-glm/src/gtc_type_ptr.rs | 137 +++++++++ nalgebra-glm/src/gtc_ulp.rs | 28 ++ nalgebra-glm/src/integer.rs | 66 ++++ nalgebra-glm/src/lib.rs | 48 +++ nalgebra-glm/src/matrix.rs | 32 ++ nalgebra-glm/src/packing.rs | 52 ++++ nalgebra-glm/src/traits.rs | 39 +++ nalgebra-glm/src/trigonometric.rs | 73 +++++ nalgebra-glm/src/vector_relational.rs | 50 +++ 40 files changed, 2340 insertions(+), 1 deletion(-) create mode 100644 nalgebra-glm/Cargo.toml create mode 100644 nalgebra-glm/README create mode 100644 nalgebra-glm/src/aliases.rs create mode 100644 nalgebra-glm/src/common.rs create mode 100644 nalgebra-glm/src/constructors.rs create mode 100644 nalgebra-glm/src/exponential.rs create mode 100644 nalgebra-glm/src/ext_matrix_clip_space.rs create mode 100644 nalgebra-glm/src/ext_matrix_projection.rs create mode 100644 nalgebra-glm/src/ext_matrix_relationnal.rs create mode 100644 nalgebra-glm/src/ext_matrix_transform.rs create mode 100644 nalgebra-glm/src/ext_quaternion_common.rs create mode 100644 nalgebra-glm/src/ext_quaternion_geometric.rs create mode 100644 nalgebra-glm/src/ext_quaternion_relational.rs create mode 100644 nalgebra-glm/src/ext_quaternion_transform.rs create mode 100644 nalgebra-glm/src/ext_quaternion_trigonometric.rs create mode 100644 nalgebra-glm/src/ext_scalar_common.rs create mode 100644 nalgebra-glm/src/ext_scalar_constants.rs create mode 100644 nalgebra-glm/src/ext_vector_common.rs create mode 100644 nalgebra-glm/src/ext_vector_relational.rs create mode 100644 nalgebra-glm/src/geometric.rs create mode 100644 nalgebra-glm/src/gtc_bitfield.rs create mode 100644 nalgebra-glm/src/gtc_constants.rs create mode 100644 nalgebra-glm/src/gtc_epsilon.rs create mode 100644 nalgebra-glm/src/gtc_integer.rs create mode 100644 nalgebra-glm/src/gtc_matrix_access.rs create mode 100644 nalgebra-glm/src/gtc_matrix_inverse.rs create mode 100644 nalgebra-glm/src/gtc_packing.rs create mode 100644 nalgebra-glm/src/gtc_quaternion.rs create mode 100644 nalgebra-glm/src/gtc_reciprocal.rs create mode 100644 nalgebra-glm/src/gtc_round.rs create mode 100644 nalgebra-glm/src/gtc_type_ptr.rs create mode 100644 nalgebra-glm/src/gtc_ulp.rs create mode 100644 nalgebra-glm/src/integer.rs create mode 100644 nalgebra-glm/src/lib.rs create mode 100644 nalgebra-glm/src/matrix.rs create mode 100644 nalgebra-glm/src/packing.rs create mode 100644 nalgebra-glm/src/traits.rs create mode 100644 nalgebra-glm/src/trigonometric.rs create mode 100644 nalgebra-glm/src/vector_relational.rs diff --git a/Cargo.toml b/Cargo.toml index d9aa3aa2..69133e47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,4 +45,4 @@ quickcheck = { version = "0.6", optional = true } serde_json = "1.0" [workspace] -members = [ "nalgebra-lapack" ] +members = [ "nalgebra-lapack", "nalgebra-glm" ] diff --git a/nalgebra-glm/Cargo.toml b/nalgebra-glm/Cargo.toml new file mode 100644 index 00000000..1c8d0a4c --- /dev/null +++ b/nalgebra-glm/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "nalgebra-glm" +version = "0.1.0" +authors = ["sebcrozet "] + +[dependencies] +num-traits = { version = "0.2", default-features = false } +alga = "0.7" +nalgebra = { path = ".." } \ No newline at end of file diff --git a/nalgebra-glm/README b/nalgebra-glm/README new file mode 100644 index 00000000..d76c97df --- /dev/null +++ b/nalgebra-glm/README @@ -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 \ No newline at end of file diff --git a/nalgebra-glm/src/aliases.rs b/nalgebra-glm/src/aliases.rs new file mode 100644 index 00000000..1c7a8ff7 --- /dev/null +++ b/nalgebra-glm/src/aliases.rs @@ -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 = MatrixMN; +pub type Vec = VectorN; +pub type Qua = Quaternion; + +pub type BVec1 = Vector1; +pub type BVec2 = Vector2; +pub type BVec3 = Vector3; +pub type BVec4 = Vector4; +pub type DVec1 = Vector1; +pub type DVec2 = Vector2; +pub type DVec3 = Vector3; +pub type DVec4 = Vector4; +pub type IVec1 = Vector1; +pub type IVec2 = Vector2; +pub type IVec3 = Vector3; +pub type IVec4 = Vector4; +pub type UVec1 = Vector1; +pub type UVec2 = Vector2; +pub type UVec3 = Vector3; +pub type UVec4 = Vector4; +pub type Vec1 = Vector1; +pub type Vec2 = Vector2; +pub type Vec3 = Vector3; +pub type Vec4 = Vector4; + +pub type U64Vec1 = Vector1; +pub type U64Vec2 = Vector2; +pub type U64Vec3 = Vector3; +pub type U64Vec4 = Vector4; +pub type I64Vec1 = Vector1; +pub type I64Vec2 = Vector2; +pub type I64Vec3 = Vector3; +pub type I64Vec4 = Vector4; + +pub type U32Vec1 = Vector1; +pub type U32Vec2 = Vector2; +pub type U32Vec3 = Vector3; +pub type U32Vec4 = Vector4; +pub type I32Vec1 = Vector1; +pub type I32Vec2 = Vector2; +pub type I32Vec3 = Vector3; +pub type I32Vec4 = Vector4; + +pub type U16Vec1 = Vector1; +pub type U16Vec2 = Vector2; +pub type U16Vec3 = Vector3; +pub type U16Vec4 = Vector4; +pub type I16Vec1 = Vector1; +pub type I16Vec2 = Vector2; +pub type I16Vec3 = Vector3; +pub type I16Vec4 = Vector4; + +pub type U8Vec1 = Vector1; +pub type U8Vec2 = Vector2; +pub type U8Vec3 = Vector3; +pub type U8Vec4 = Vector4; +pub type I8Vec1 = Vector1; +pub type I8Vec2 = Vector2; +pub type I8Vec3 = Vector3; +pub type I8Vec4 = Vector4; + + +pub type DMat2 = Matrix2; +pub type DMat2x2 = Matrix2; +pub type DMat2x3 = Matrix2x3; +pub type DMat2x4 = Matrix2x4; +pub type DMat3 = Matrix3; +pub type DMat3x2 = Matrix3x2; +pub type DMat3x3 = Matrix3; +pub type DMat3x4 = Matrix3x4; +pub type DMat4 = Matrix4; +pub type DMat4x2 = Matrix4x2; +pub type DMat4x3 = Matrix4x3; +pub type DMat4x4 = Matrix4; +pub type Mat2 = Matrix2; +pub type Mat2x2 = Matrix2; +pub type Mat2x3 = Matrix2x3; +pub type Mat2x4 = Matrix2x4; +pub type Mat3 = Matrix3; +pub type Mat3x2 = Matrix3x2; +pub type Mat3x3 = Matrix3; +pub type Mat3x4 = Matrix3x4; +pub type Mat4x2 = Matrix4x2; +pub type Mat4x3 = Matrix4x3; +pub type Mat4x4 = Matrix4; +pub type Mat4 = Matrix4; + +pub type Quat = Quaternion; +pub type DQuat = Quaternion; diff --git a/nalgebra-glm/src/common.rs b/nalgebra-glm/src/common.rs new file mode 100644 index 00000000..79fcd9ab --- /dev/null +++ b/nalgebra-glm/src/common.rs @@ -0,0 +1,209 @@ +use na::{Scalar, DimName, DefaultAllocator}; + +use aliases::Vec; +use traits::Alloc; + + +pub fn abs(x: T) -> T { + unimplemented!() + +} + +pub fn abs2(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} + +pub fn ceil(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} + +pub fn clamp(x: T, minVal: T, maxVal: T) -> T { + unimplemented!() + +} + +pub fn clamp2(x: &Vec,minVal: N, maxVal: N) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} + +pub fn clamp3(x: &Vec, minVal: &Vec, maxVal: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} + +pub fn floatBitsToInt(v: f32) -> i32 { + unimplemented!() + +} + +pub fn floatBitsToInt2(v: Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} + +pub fn floatBitsToUint(v: f32) -> u32 { + unimplemented!() + +} + +pub fn floatBitsToUint2(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} +pub fn floor(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} +pub fn fma(a: T, b: T, c: T) -> T { + unimplemented!() + +} + +pub fn fract(x: T) -> T { + unimplemented!() + +} + +pub fn fract2(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} + +pub fn frexp(x: T, exp: I) -> T { + unimplemented!() + +} + +pub fn intBitsToFloat(v: i32) -> f32 { + unimplemented!() + +} + +pub fn intBitsToFloat2(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} + +pub fn isinf(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} + +pub fn isnan(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} + +pub fn ldexp(x: T, exp: I) -> T { + unimplemented!() + +} + +pub fn max(x: T, y: T) -> T { + unimplemented!() + +} + +pub fn max2(x: &Vec,y: N) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} +pub fn max3(x: &Vec, y: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} +pub fn min(x: T, y: T) -> T { + unimplemented!() + +} + +pub fn min2(x: &Vec,y: N) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} +pub fn min3(x: &Vec, y: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} +pub fn mix(x: T, y: T, a: T) -> T { + unimplemented!() + +} + +pub fn mod_(x: &Vec, y: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} +pub fn modf(x: T, i: &T) -> T { + unimplemented!() + +} + +pub fn round(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} +pub fn roundEven(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} +pub fn sign(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} + +pub fn smoothstep(edge0: T, edge1: T, x: T) -> T { + unimplemented!() + +} + +pub fn step(edge: T, x: T) -> T { + unimplemented!() + +} + +pub fn step2(edge: N, x: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} +pub fn step3(edge: &Vec, x: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} +pub fn trunc(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() + +} +pub fn uintBitsToFloat(v: u32) -> f32 { + unimplemented!() + +} +pub fn uintBitsToFloat2(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} \ No newline at end of file diff --git a/nalgebra-glm/src/constructors.rs b/nalgebra-glm/src/constructors.rs new file mode 100644 index 00000000..7dfb9e33 --- /dev/null +++ b/nalgebra-glm/src/constructors.rs @@ -0,0 +1,119 @@ +use na::{Scalar, Real, U1, U2, U3, U4}; +use aliases::{Vec, Mat, Qua}; + +pub fn vec1(x: N) -> Vec { + Vec::::new(x) +} + +pub fn vec2(x: N, y: N) -> Vec { + Vec::::new(x, y) +} + +pub fn vec3(x: N, y: N, z: N) -> Vec { + Vec::::new(x, y, z) +} + +pub fn vec4(x: N, y: N, z: N, w: N) -> Vec { + Vec::::new(x, y, z, w) +} + + +pub fn mat2(m11: N, m12: N, m21: N, m22: N) -> Mat { + Mat::::new( + m11, m12, + m21, m22, + ) +} + +pub fn mat2x2(m11: N, m12: N, m21: N, m22: N) -> Mat { + Mat::::new( + m11, m12, + m21, m22, + ) +} + +pub fn mat2x3(m11: N, m12: N, m13: N, m21: N, m22: N, m23: N) -> Mat { + Mat::::new( + m11, m12, m13, + m21, m22, m23, + ) +} + +pub fn mat2x4(m11: N, m12: N, m13: N, m14: N, m21: N, m22: N, m23: N, m24: N) -> Mat { + Mat::::new( + m11, m12, m13, m14, + m21, m22, m23, m24, + ) +} + +pub fn mat3(m11: N, m12: N, m13: N, m21: N, m22: N, m23: N, m31: N, m32: N, m33: N) -> Mat { + Mat::::new( + m11, m12, m13, + m21, m22, m23, + m31, m32, m33, + ) +} + +pub fn mat3x2(m11: N, m12: N, m21: N, m22: N, m31: N, m32: N) -> Mat { + Mat::::new( + m11, m12, + m21, m22, + m31, m32, + ) +} + +pub fn mat3x3(m11: N, m12: N, m13: N, m21: N, m22: N, m23: N, m31: N, m32: N, m33: N) -> Mat { + Mat::::new( + m11, m12, m13, + m31, m32, m33, + m21, m22, m23, + ) +} + +pub fn mat3x4(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 { + Mat::::new( + m11, m12, m13, m14, + m21, m22, m23, m24, + m31, m32, m33, m34, + ) +} + +pub fn mat4x2(m11: N, m12: N, m21: N, m22: N, m31: N, m32: N, m41: N, m42: N) -> Mat { + Mat::::new( + m11, m12, + m21, m22, + m31, m32, + m41, m42, + ) +} + +pub fn mat4x3(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 { + Mat::::new( + m11, m12, m13, + m21, m22, m23, + m31, m32, m33, + m41, m42, m43, + ) +} + +pub fn mat4x4(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 { + Mat::::new( + m11, m12, m13, m14, + m21, m22, m23, m24, + m31, m32, m33, m34, + m41, m42, m43, m44, + ) +} + +pub fn mat4(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 { + Mat::::new( + m11, m12, m13, m14, + m21, m22, m23, m24, + m31, m32, m33, m34, + m41, m42, m43, m44, + ) +} + +pub fn quat(x: N, y: N, z: N, w: N) -> Qua { + Qua::new(x, y, z, w) +} diff --git a/nalgebra-glm/src/exponential.rs b/nalgebra-glm/src/exponential.rs new file mode 100644 index 00000000..296ee533 --- /dev/null +++ b/nalgebra-glm/src/exponential.rs @@ -0,0 +1,39 @@ +use na::{Real, DefaultAllocator, DimName}; +use aliases::Vec; +use traits::Alloc; + + +pub fn exp(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn exp2(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn inversesqrt(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn log(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn log2(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn pow(base: &Vec, exponent: &Vec) + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn sqrt(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} diff --git a/nalgebra-glm/src/ext_matrix_clip_space.rs b/nalgebra-glm/src/ext_matrix_clip_space.rs new file mode 100644 index 00000000..7efec074 --- /dev/null +++ b/nalgebra-glm/src/ext_matrix_clip_space.rs @@ -0,0 +1,170 @@ +use na::{Real, U4}; +use aliases::Mat; + +pub fn frustum(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn frustum_lh(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn frustum_lr_no(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn frustum_lh_zo(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn frustum_no(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn frustum_rh(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn frustum_rh_no(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn frustum_rh_zo(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn frustum_zo(left: N, right: N, bottom: N, top: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn infinite_perspective(fovy: N, aspect: N, near: N) -> Mat { + unimplemented!() +} + +pub fn infinite_perspective_lh(fovy: N, aspect: N, near: N) -> Mat { + unimplemented!() +} + +pub fn infinite_perspective_rh(fovy: N, aspect: N, near: N) -> Mat { + unimplemented!() +} + +pub fn infinite_ortho(left: N, right: N, bottom: N, top: N) -> Mat { + unimplemented!() +} + +pub fn ortho(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat { + unimplemented!() +} + +pub fn ortho_lh(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat { + unimplemented!() +} + +pub fn ortho_lh_no(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat { + unimplemented!() +} + +pub fn ortho_lh_zo(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat { + unimplemented!() +} + +pub fn ortho_no(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat { + unimplemented!() +} + +pub fn ortho_rh(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat { + unimplemented!() +} + +pub fn ortho_rh_no(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat { + unimplemented!() +} + +pub fn ortho_rh_zo(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat { + unimplemented!() +} + +pub fn ortho_zo(left: N, right: N, bottom: N, top: N, zNear: N, zFar: N) -> Mat { + unimplemented!() +} + +pub fn perspective(fovy: N, aspect: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_fov(fov: N, width: N, height: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_fov_lh(fov: N, width: N, height: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_fov_lh_no(fov: N, width: N, height: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_fov_lh_zo(fov: N, width: N, height: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_fov_no(fov: N, width: N, height: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_fov_rh(fov: N, width: N, height: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_fov_rh_no(fov: N, width: N, height: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_fov_rh_zo(fov: N, width: N, height: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_fov_zo(fov: N, width: N, height: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_lh(fovy: N, aspect: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_lh_no(fovy: N, aspect: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_lh_zo(fovy: N, aspect: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_no(fovy: N, aspect: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_rh(fovy: N, aspect: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_rh_no(fovy: N, aspect: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_rh_zo(fovy: N, aspect: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn perspective_zo(fovy: N, aspect: N, near: N, far: N) -> Mat { + unimplemented!() +} + +pub fn tweaked_infinite_perspective(fovy: N, aspect: N, near: N) -> Mat { + unimplemented!() +} + +pub fn tweaked_infinite_perspective_ep(fovy: N, aspect: N, near: N, ep: N) -> Mat { + unimplemented!() +} diff --git a/nalgebra-glm/src/ext_matrix_projection.rs b/nalgebra-glm/src/ext_matrix_projection.rs new file mode 100644 index 00000000..6aa40f57 --- /dev/null +++ b/nalgebra-glm/src/ext_matrix_projection.rs @@ -0,0 +1,32 @@ +use na::{Real, U2, U3, U4}; + +use aliases::{Mat, Vec}; + + +pub fn pickMatrix(center: &Vec, delta: &Vec, viewport: &Vec) -> Mat { + unimplemented!() +} + +pub fn project(obj: &Vec, model: &Mat, proj: &Mat, viewport: Vec) -> Vec { + unimplemented!() +} + +pub fn projectNO(obj: &Vec, model: &Mat, proj: &Mat, viewport: Vec) -> Vec { + unimplemented!() +} + +pub fn projectZO(obj: &Vec, model: &Mat, proj: &Mat, viewport: Vec) -> Vec { + unimplemented!() +} + +pub fn unProject(win: &Vec, model: &Mat, proj: &Mat, viewport: Vec) -> Vec { + unimplemented!() +} + +pub fn unProjectNO(win: &Vec, model: &Mat, proj: &Mat, viewport: Vec) -> Vec { + unimplemented!() +} + +pub fn unProjectZO(win: &Vec, model: &Mat, proj: &Mat, viewport: Vec) -> Vec { + unimplemented!() +} \ No newline at end of file diff --git a/nalgebra-glm/src/ext_matrix_relationnal.rs b/nalgebra-glm/src/ext_matrix_relationnal.rs new file mode 100644 index 00000000..06256e85 --- /dev/null +++ b/nalgebra-glm/src/ext_matrix_relationnal.rs @@ -0,0 +1,35 @@ +use na::{Scalar, DimName, DefaultAllocator}; + +use aliases::{Vec, Mat}; +use traits::Alloc; + + +pub fn equal(x: &Mat, y: &Mat) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn equal_eps(x: &Mat, y: &Mat,epsilon: N) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn equal_eps_vec(x: &Mat, y: &Mat, epsilon: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn not_equal(x: &Mat, y: &Mat) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn not_equal_eps(x: &Mat, y: &Mat,epsilon: N) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn not_equal_eps_vec(x: &Mat, y: &Mat, epsilon: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} diff --git a/nalgebra-glm/src/ext_matrix_transform.rs b/nalgebra-glm/src/ext_matrix_transform.rs new file mode 100644 index 00000000..1e55e0c6 --- /dev/null +++ b/nalgebra-glm/src/ext_matrix_transform.rs @@ -0,0 +1,31 @@ +use na::{Scalar, U3, U4}; + +use aliases::{Mat, Vec}; + +pub fn identity() -> T { + unimplemented!() +} + +pub fn lookAt(eye: &Vec, center: &Vec, up: &Vec) -> Mat { + unimplemented!() +} + +pub fn lookAtLH(eye: &Vec, center: &Vec, up: &Vec) -> Mat { + unimplemented!() +} + +pub fn lookAtRH(eye: &Vec, center: &Vec, up: &Vec) -> Mat { + unimplemented!() +} + +pub fn rotate(m: &Mat,angle: N, axis: &Vec) -> Mat { + unimplemented!() +} + +pub fn scale(m: &Mat, v: &Vec) -> Mat { + unimplemented!() +} + +pub fn translate(m: &Mat, v: &Vec) -> Mat { + unimplemented!() +} diff --git a/nalgebra-glm/src/ext_quaternion_common.rs b/nalgebra-glm/src/ext_quaternion_common.rs new file mode 100644 index 00000000..42e045bf --- /dev/null +++ b/nalgebra-glm/src/ext_quaternion_common.rs @@ -0,0 +1,31 @@ +use na::{Real, U4}; + +use aliases::{Vec, Qua}; + +pub fn conjugate(q: &Qua) -> Qua { + unimplemented!() +} + +pub fn inverse(q: &Qua) -> Qua { + unimplemented!() +} + +pub fn isinf(x: &Qua) -> Vec { + unimplemented!() +} + +pub fn isnan(x: &Qua) -> Vec { + unimplemented!() +} + +pub fn lerp(x: &Qua, y: &Qua,a: N) -> Qua { + unimplemented!() +} + +pub fn mix(x: &Qua, y: &Qua,a: N) -> Qua { + unimplemented!() +} + +pub fn slerp(x: &Qua, y: &Qua,a: N) -> Qua { + unimplemented!() +} diff --git a/nalgebra-glm/src/ext_quaternion_geometric.rs b/nalgebra-glm/src/ext_quaternion_geometric.rs new file mode 100644 index 00000000..e9fd7d09 --- /dev/null +++ b/nalgebra-glm/src/ext_quaternion_geometric.rs @@ -0,0 +1,16 @@ +use na::Real; + +use aliases::Qua; + +pub fn cross(q1: &Qua, q2: &Qua) -> Qua { + unimplemented!() +} +pub fn dot(x: &Qua, y: &Qua) -> N { + unimplemented!() +} +pub fn length(q: &Qua) -> N { + unimplemented!() +} +pub fn normalize(q: &Qua) -> Qua { + unimplemented!() +} \ No newline at end of file diff --git a/nalgebra-glm/src/ext_quaternion_relational.rs b/nalgebra-glm/src/ext_quaternion_relational.rs new file mode 100644 index 00000000..fe5a32b0 --- /dev/null +++ b/nalgebra-glm/src/ext_quaternion_relational.rs @@ -0,0 +1,4 @@ +pub fn vec< 4, bool, Q > equal(x: &Qua, y: &Qua) +pub fn vec< 4, bool, Q > equal(x: &Qua, y: &Qua,epsilon: N) +pub fn vec< 4, bool, Q > notEqual(x: &Qua, y: &Qua) +pub fn vec< 4, bool, Q > notEqual(x: &Qua, y: &Qua,epsilon: N) \ No newline at end of file diff --git a/nalgebra-glm/src/ext_quaternion_transform.rs b/nalgebra-glm/src/ext_quaternion_transform.rs new file mode 100644 index 00000000..c82dc841 --- /dev/null +++ b/nalgebra-glm/src/ext_quaternion_transform.rs @@ -0,0 +1,19 @@ +use na::{Real, U3}; + +use aliases::{Vec, Qua}; + +pub fn exp(q: &Qua) -> Qua { + unimplemented!() +} +pub fn log(q: &Qua) -> Qua { + unimplemented!() +} +pub fn pow(q: &Qua, y: N) -> Qua { + unimplemented!() +} +pub fn rotate(q: &Qua, angle: N, axis: &Vec) -> Qua { + unimplemented!() +} +pub fn sqrt(q: &Qua) -> Qua { + unimplemented!() +} \ No newline at end of file diff --git a/nalgebra-glm/src/ext_quaternion_trigonometric.rs b/nalgebra-glm/src/ext_quaternion_trigonometric.rs new file mode 100644 index 00000000..77f20b74 --- /dev/null +++ b/nalgebra-glm/src/ext_quaternion_trigonometric.rs @@ -0,0 +1,13 @@ +use na::{Real, U3}; + +use aliases::{Vec, Qua}; + +pub fn angle(x: &Qua) -> N { + unimplemented!() +} +pub fn angleAxis(angle: N, axis: &Vec) -> Qua { + unimplemented!() +} +pub fn axis(x: &Qua) -> Vec { + unimplemented!() +} \ No newline at end of file diff --git a/nalgebra-glm/src/ext_scalar_common.rs b/nalgebra-glm/src/ext_scalar_common.rs new file mode 100644 index 00000000..b73637e6 --- /dev/null +++ b/nalgebra-glm/src/ext_scalar_common.rs @@ -0,0 +1,41 @@ +use na::Scalar; + +pub fn fmax(a: N, b: N) -> N { + unimplemented!() +} + +pub fn fmax3(a: N, b: N, C: N) -> N { + unimplemented!() +} + +pub fn fmax4(a: N, b: N, C: N, D: N) -> N { + unimplemented!() +} + +pub fn fmin(a: N, b: N) -> N { + unimplemented!() +} + +pub fn fmin3(a: N, b: N, c: N) -> N { + unimplemented!() +} + +pub fn fmin4(a: N, b: N, c: N, d: N) -> N { + unimplemented!() +} + +pub fn max3(a: N, b: N, c: N) -> N { + unimplemented!() +} + +pub fn max4(a: N, b: N, c: N, d: N) -> N { + unimplemented!() +} + +pub fn min3(a: N, b: N, c: N) -> N { + unimplemented!() +} + +pub fn min4(a: N, b: N, c: N, d: N) -> N { + unimplemented!() +} diff --git a/nalgebra-glm/src/ext_scalar_constants.rs b/nalgebra-glm/src/ext_scalar_constants.rs new file mode 100644 index 00000000..525946f7 --- /dev/null +++ b/nalgebra-glm/src/ext_scalar_constants.rs @@ -0,0 +1,7 @@ +pub fn epsilon() -> T { + unimplemented!() +} + +pub fn pi() -> T { + unimplemented!() +} diff --git a/nalgebra-glm/src/ext_vector_common.rs b/nalgebra-glm/src/ext_vector_common.rs new file mode 100644 index 00000000..02aa420e --- /dev/null +++ b/nalgebra-glm/src/ext_vector_common.rs @@ -0,0 +1,64 @@ +use na::{Scalar, DimName, DefaultAllocator}; + +use traits::Alloc; +use aliases::Vec; + +pub fn fmax(a: &Vec,b: N) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn fmax2(a: &Vec, b: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn fmax3(a: &Vec, b: &Vec, c: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn fmax4(a: &Vec, b: &Vec, c: &Vec, d: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn fmin(x: &Vec,y: N) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn fmin2(x: &Vec, y: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn fmin3(a: &Vec, b: &Vec, c: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn fmin4(a: &Vec, b: &Vec, c: &Vec, d: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn max3(x: &Vec, y: &Vec, z: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn max4(x: &Vec, y: &Vec, z: &Vec, w: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn min3(a: &Vec, b: &Vec, c: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn min4(a: &Vec, b: &Vec, c: &Vec, d: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} diff --git a/nalgebra-glm/src/ext_vector_relational.rs b/nalgebra-glm/src/ext_vector_relational.rs new file mode 100644 index 00000000..a8e02196 --- /dev/null +++ b/nalgebra-glm/src/ext_vector_relational.rs @@ -0,0 +1,24 @@ +use na::{Scalar, DimName, DefaultAllocator}; + +use traits::Alloc; +use aliases::Vec; + +pub fn equal(x: &Vec, y: &Vec, epsilon: N) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn equal2(x: &Vec, y: &Vec, epsilon: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn notEqual(x: &Vec, y: &Vec, epsilon: N) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn notEqual2(x: &Vec, y: &Vec, epsilon: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} diff --git a/nalgebra-glm/src/geometric.rs b/nalgebra-glm/src/geometric.rs new file mode 100644 index 00000000..dfea9c03 --- /dev/null +++ b/nalgebra-glm/src/geometric.rs @@ -0,0 +1,43 @@ +use na::{Scalar, Real, DimName, U3, DefaultAllocator}; + +use traits::{Number, Alloc}; +use aliases::Vec; + +pub fn cross(x: &Vec, y: &Vec) -> Vec { + x.cross(y) +} + +pub fn distance(p0: &Vec, p1: &Vec) -> N + where DefaultAllocator: Alloc { + (p1 - p0).norm() +} + +pub fn dot(x: &Vec, y: &Vec) -> N + where DefaultAllocator: Alloc { + x.dot(y) +} + +pub fn faceforward(N: &Vec, I: &Vec, Nref: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn length(x: &Vec) -> N + where DefaultAllocator: Alloc { + x.norm() +} + +pub fn normalize(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + x.normalize() +} + +pub fn reflect(I: &Vec, N: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn refract(I: &Vec, N: &Vec, eta: N) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} \ No newline at end of file diff --git a/nalgebra-glm/src/gtc_bitfield.rs b/nalgebra-glm/src/gtc_bitfield.rs new file mode 100644 index 00000000..5789934c --- /dev/null +++ b/nalgebra-glm/src/gtc_bitfield.rs @@ -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(Value: IU, FirstBit: i32, BitCount: i32) -> IU { + unimplemented!() +} + +pub fn bitfieldFillOne2(Value: &Vec, FirstBit: i32, BitCount: i32) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn bitfieldFillZero(Value: IU, FirstBit: i32, BitCount: i32) -> IU { + unimplemented!() +} + +pub fn bitfieldFillZero2(Value: &Vec, FirstBit: i32, BitCount: i32) -> Vec + where DefaultAllocator: Alloc { + 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(In: IU, Shift: i32) -> IU { + unimplemented!() +} + +pub fn bitfieldRotateLeft2(In: &Vec, Shift: i32) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn bitfieldRotateRight(In: IU, Shift: i32) -> IU { + unimplemented!() +} + +pub fn bitfieldRotateRight2(In: &Vec, Shift: i32) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn mask(Bits: IU) -> IU { + unimplemented!() +} + +pub fn mask2(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} diff --git a/nalgebra-glm/src/gtc_constants.rs b/nalgebra-glm/src/gtc_constants.rs new file mode 100644 index 00000000..3bb93258 --- /dev/null +++ b/nalgebra-glm/src/gtc_constants.rs @@ -0,0 +1,108 @@ +pub fn e() -> T { + unimplemented!() +} + +pub fn euler() -> T { + unimplemented!() +} + +pub fn four_over_pi() -> T { + unimplemented!() +} + +pub fn golden_ratio() -> T { + unimplemented!() +} + +pub fn half_pi() -> T { + unimplemented!() +} + +pub fn ln_ln_two() -> T { + unimplemented!() +} + +pub fn ln_ten() -> T { + unimplemented!() +} + +pub fn ln_two() -> T { + unimplemented!() +} + +pub fn one() -> T { + unimplemented!() +} + +pub fn one_over_pi() -> T { + unimplemented!() +} + +pub fn one_over_root_two() -> T { + unimplemented!() +} + +pub fn one_over_two_pi() -> T { + unimplemented!() +} + +pub fn quarter_pi() -> T { + unimplemented!() +} + +pub fn root_five() -> T { + unimplemented!() +} + +pub fn root_half_pi() -> T { + unimplemented!() +} + +pub fn root_ln_four() -> T { + unimplemented!() +} + +pub fn root_pi() -> T { + unimplemented!() +} + +pub fn root_three() -> T { + unimplemented!() +} + +pub fn root_two() -> T { + unimplemented!() +} + +pub fn root_two_pi() -> T { + unimplemented!() +} + +pub fn third() -> T { + unimplemented!() +} + +pub fn three_over_two_pi() -> T { + unimplemented!() +} + +pub fn two_over_pi() -> T { + unimplemented!() +} + +pub fn two_over_root_pi() -> T { + unimplemented!() +} + +pub fn two_pi() -> T { + unimplemented!() +} + +pub fn two_thirds() -> T { + unimplemented!() +} + +pub fn zero() -> T { + unimplemented!() + +} \ No newline at end of file diff --git a/nalgebra-glm/src/gtc_epsilon.rs b/nalgebra-glm/src/gtc_epsilon.rs new file mode 100644 index 00000000..13c21a9f --- /dev/null +++ b/nalgebra-glm/src/gtc_epsilon.rs @@ -0,0 +1,22 @@ +use na::{DimName, Scalar, DefaultAllocator}; + +use traits::Alloc; +use aliases::Vec; + +pub fn epsilonEqual(x: &Vec, y: &Vec, epsilon: N) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn epsilonEqual2(x: T, y: T, epsilon: T) -> bool { + unimplemented!() +} + +pub fn epsilonNotEqual(x: &Vec, y: &Vec, epsilon: N) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn epsilonNotEqual2(x: T, y: T, epsilon: T) -> bool { + unimplemented!() +} diff --git a/nalgebra-glm/src/gtc_integer.rs b/nalgebra-glm/src/gtc_integer.rs new file mode 100644 index 00000000..6ebb4c33 --- /dev/null +++ b/nalgebra-glm/src/gtc_integer.rs @@ -0,0 +1,18 @@ +use na::{DimName, Scalar, DefaultAllocator}; + +use traits::Alloc; +use aliases::Vec; + +pub fn iround(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn log2(x: I) -> I { + unimplemented!() +} + +pub fn uround(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} \ No newline at end of file diff --git a/nalgebra-glm/src/gtc_matrix_access.rs b/nalgebra-glm/src/gtc_matrix_access.rs new file mode 100644 index 00000000..640a7979 --- /dev/null +++ b/nalgebra-glm/src/gtc_matrix_access.rs @@ -0,0 +1,24 @@ +use na::{Scalar, DimName, DefaultAllocator}; + +use traits::Alloc; +use aliases::{Vec, Mat}; + +pub fn column(m: &Mat, index: usize) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn column2(m: &Mat, index: usize, x: &Vec) -> Mat + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn row(m: &Mat, index: usize) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn row2(m: &Mat, index: usize, x: &Vec) -> Mat + where DefaultAllocator: Alloc { + unimplemented!() +} diff --git a/nalgebra-glm/src/gtc_matrix_inverse.rs b/nalgebra-glm/src/gtc_matrix_inverse.rs new file mode 100644 index 00000000..2d06dfbf --- /dev/null +++ b/nalgebra-glm/src/gtc_matrix_inverse.rs @@ -0,0 +1,14 @@ +use na::{Scalar, DimName, DefaultAllocator}; + +use traits::Alloc; +use aliases::Mat; + +pub fn affineInverse(m: &Mat) -> Mat + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn inverseTranspose(m: &Mat) -> Mat + where DefaultAllocator: Alloc { + unimplemented!() +} \ No newline at end of file diff --git a/nalgebra-glm/src/gtc_packing.rs b/nalgebra-glm/src/gtc_packing.rs new file mode 100644 index 00000000..394324a7 --- /dev/null +++ b/nalgebra-glm/src/gtc_packing.rs @@ -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(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + 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(rgb: &Vec) -> Vec { + unimplemented!() +} + +pub fn packSnorm(v: Vec) -> Vec + where DefaultAllocator: Alloc + Alloc { + 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(v: &Vec) -> Vec + where DefaultAllocator: Alloc + Alloc { + 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(p: Vec) -> Vec + where DefaultAllocator: Alloc { + 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(rgbm: &Vec) -> Vec { + unimplemented!() +} + +pub fn unpackSnorm(v: &Vec) -> Vec + where DefaultAllocator: Alloc + Alloc { + 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(v: &Vec) -> Vec + where DefaultAllocator: Alloc + Alloc { + 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!() +} \ No newline at end of file diff --git a/nalgebra-glm/src/gtc_quaternion.rs b/nalgebra-glm/src/gtc_quaternion.rs new file mode 100644 index 00000000..286cdf4f --- /dev/null +++ b/nalgebra-glm/src/gtc_quaternion.rs @@ -0,0 +1,64 @@ +use na::{Real, U3, U4}; + +use aliases::{Qua, Vec, Mat}; + + +pub fn eulerAngles(x: &Qua) -> Vec { + unimplemented!() +} + +pub fn greaterThan(x: &Qua, y: &Qua) -> Vec { + unimplemented!() +} + +pub fn greaterThanEqual(x: &Qua, y: &Qua) -> Vec { + unimplemented!() +} + +pub fn lessThan(x: &Qua, y: &Qua) -> Vec { + unimplemented!() +} + +pub fn lessThanEqual(x: &Qua, y: &Qua) -> Vec { + unimplemented!() +} + +pub fn mat3_cast(x: &Qua) -> Mat { + unimplemented!() +} + +pub fn mat4_cast(x: &Qua) -> Mat { + unimplemented!() +} + +pub fn pitch(x: &Qua) -> N { + unimplemented!() +} + +pub fn quat_cast(x: &Mat) -> Qua { + unimplemented!() +} + +pub fn quat_cast2(x: &Mat) -> Qua { + unimplemented!() +} + +pub fn quatLookAt(direction: &Vec, up: &Vec) -> Qua { + unimplemented!() +} + +pub fn quatLookAtLH(direction: &Vec, up: &Vec) -> Qua { + unimplemented!() +} + +pub fn quatLookAtRH(direction: &Vec, up: &Vec) -> Qua { + unimplemented!() +} + +pub fn roll(x: &Qua) -> N { + unimplemented!() +} + +pub fn yaw(x: &Qua) -> N { + unimplemented!() +} diff --git a/nalgebra-glm/src/gtc_reciprocal.rs b/nalgebra-glm/src/gtc_reciprocal.rs new file mode 100644 index 00000000..668776ec --- /dev/null +++ b/nalgebra-glm/src/gtc_reciprocal.rs @@ -0,0 +1,47 @@ +pub fn acot(x: T) -> T { + unimplemented!() +} + +pub fn acoth(x: T) -> T { + unimplemented!() +} + +pub fn acsc(x: T) -> T { + unimplemented!() +} + +pub fn acsch(x: T) -> T { + unimplemented!() +} + +pub fn asec(x: T) -> T { + unimplemented!() +} + +pub fn asech(x: T) -> T { + unimplemented!() +} + +pub fn cot(angle: T) -> T { + unimplemented!() +} + +pub fn coth(angle: T) -> T { + unimplemented!() +} + +pub fn csc(angle: T) -> T { + unimplemented!() +} + +pub fn csch(angle: T) -> T { + unimplemented!() +} + +pub fn sec(angle: T) -> T { + unimplemented!() +} + +pub fn sech(angle: T) -> T { + unimplemented!() +} diff --git a/nalgebra-glm/src/gtc_round.rs b/nalgebra-glm/src/gtc_round.rs new file mode 100644 index 00000000..94443b7a --- /dev/null +++ b/nalgebra-glm/src/gtc_round.rs @@ -0,0 +1,82 @@ +use na::{Scalar, Real, DimName, U3, DefaultAllocator}; + +use traits::{Number, Alloc}; +use aliases::Vec; + + +pub fn ceilMultiple(v: T, Multiple: T) -> T { + unimplemented!() +} + +pub fn ceilMultiple2(v: &Vec, Multiple: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn ceilPowerOfTwo(v: IU) -> IU { + unimplemented!() +} + +pub fn ceilPowerOfTwo2(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn floorMultiple(v: T, Multiple: T) -> T { + unimplemented!() +} + +pub fn floorMultiple2(v: &Vec, Multiple: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn floorPowerOfTwo(v: IU) -> IU { + unimplemented!() +} + +pub fn floorPowerOfTwo2(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn isMultiple(v: IU, Multiple: IU) -> bool { + unimplemented!() +} + +pub fn isMultiple2(v: &Vec,Multiple: N) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn isMultiple3(v: &Vec, Multiple: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn isPowerOfTwo2(v: IU) -> bool { + unimplemented!() +} + +pub fn isPowerOfTwo(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn roundMultiple(v: T, Multiple: T) -> T { + unimplemented!() +} + +pub fn roundMultiple2(v: &Vec, Multiple: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn roundPowerOfTwo(v: IU) -> IU { + unimplemented!() +} + +pub fn roundPowerOfTwo2(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} diff --git a/nalgebra-glm/src/gtc_type_ptr.rs b/nalgebra-glm/src/gtc_type_ptr.rs new file mode 100644 index 00000000..fb54b878 --- /dev/null +++ b/nalgebra-glm/src/gtc_type_ptr.rs @@ -0,0 +1,137 @@ +use na::{Scalar, Real, U1, U2, U3, U4}; + +use aliases::{Qua, Vec, Mat}; + + +pub fn make_mat2(ptr: &[N]) -> Mat { + unimplemented!() +} + +pub fn make_mat2x2(ptr: &[N]) -> Mat { + unimplemented!() +} + +pub fn make_mat2x3(ptr: &[N]) -> Mat { + unimplemented!() +} + +pub fn make_mat2x4(ptr: &[N]) -> Mat { + unimplemented!() +} + +pub fn make_mat3(ptr: &[N]) -> Mat { + unimplemented!() +} + +pub fn make_mat3x2(ptr: &[N]) -> Mat { + unimplemented!() +} + +pub fn make_mat3x3(ptr: &[N]) -> Mat { + unimplemented!() +} + +pub fn make_mat3x4(ptr: &[N]) -> Mat { + unimplemented!() +} + +pub fn make_mat4(ptr: &[N]) -> Mat { + unimplemented!() +} + +pub fn make_mat4x2(ptr: &[N]) -> Mat { + unimplemented!() +} + +pub fn make_mat4x3(ptr: &[N]) -> Mat { + unimplemented!() +} + +pub fn make_mat4x4(ptr: &[N]) -> Mat { + unimplemented!() +} + +pub fn make_quat(ptr: &[N]) -> Qua { + unimplemented!() +} + +pub fn make_vec1(v: &Vec) -> Vec { + unimplemented!() +} + +pub fn make_vec1_2(v: &Vec) -> Vec { + unimplemented!() +} + +pub fn make_vec1_3(v: &Vec) -> Vec { + unimplemented!() +} + +pub fn make_vec1_4(v: &Vec) -> Vec { + unimplemented!() +} + +pub fn make_vec2_1(v: &Vec) -> Vec { + unimplemented!() +} + +pub fn make_vec2_2(v: &Vec) -> Vec { + unimplemented!() +} + +pub fn make_vec2_3(v: &Vec) -> Vec { + unimplemented!() +} + +pub fn make_vec2_4(v: &Vec) -> Vec { + unimplemented!() +} + +pub fn make_vec2(ptr: &[N]) -> Vec { + unimplemented!() +} + +pub fn make_vec3_1(v: &Vec) -> Vec { + unimplemented!() +} + +pub fn make_vec3_2(v: &Vec) -> Vec { + unimplemented!() +} + +pub fn make_vec3_3(v: &Vec) -> Vec { + unimplemented!() +} + +pub fn make_vec3_4(v: &Vec) -> Vec { + unimplemented!() +} + +pub fn make_vec3(ptr: &[N]) -> Vec { + unimplemented!() +} + +pub fn make_vec4_1(v: &Vec) -> Vec { + unimplemented!() +} + +pub fn make_vec4_2(v: &Vec) -> Vec { + unimplemented!() +} + +pub fn make_vec4_3(v: &Vec) -> Vec { + unimplemented!() +} + +pub fn make_vec4_4(v: &Vec) -> Vec { + unimplemented!() +} + +pub fn make_vec4(ptr: &[N]) -> Vec { + unimplemented!() +} + +pub fn value_ptr(x: &T) -> &V { + unimplemented!() +} + diff --git a/nalgebra-glm/src/gtc_ulp.rs b/nalgebra-glm/src/gtc_ulp.rs new file mode 100644 index 00000000..1b611951 --- /dev/null +++ b/nalgebra-glm/src/gtc_ulp.rs @@ -0,0 +1,28 @@ +use na::{Scalar, U2}; + +use aliases::Vec; + + +pub fn float_distance(x: T, y: T) -> u64 { + unimplemented!() +} + +pub fn float_distance2(x: &Vec, y: &Vec) -> Vec { + unimplemented!() +} + +pub fn next_float(x: T) -> T { + unimplemented!() +} + +pub fn next_float2(x: T, Distance: u64) -> T { + unimplemented!() +} + +pub fn prev_float(x: T) -> T { + unimplemented!() +} + +pub fn prev_float2(x: T, Distance: u64) -> T { + unimplemented!() +} diff --git a/nalgebra-glm/src/integer.rs b/nalgebra-glm/src/integer.rs new file mode 100644 index 00000000..0e96e0d7 --- /dev/null +++ b/nalgebra-glm/src/integer.rs @@ -0,0 +1,66 @@ +use na::{Scalar, Real, DimName, U3, DefaultAllocator}; + +use traits::{Number, Alloc}; +use aliases::Vec; + +pub fn bitCount(v: T) -> i32 { + unimplemented!() +} + +pub fn bitCount2(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn bitfieldExtract(Value: &Vec, Offset: i32, Bits: i32) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn bitfieldInsert(Base: &Vec, Insert: &Vec, Offset: i32, Bits: i32) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn bitfieldReverse(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn findLSB(x: IU) -> u32 { + unimplemented!() +} + +pub fn findLSB2(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn findMSB(x: IU) -> i32 { + unimplemented!() +} + +pub fn findMSB2(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn imulExtended(x: &Vec, y: &Vec, msb: &Vec, lsb: &Vec) + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn uaddCarry(x: &Vec, y: &Vec, carry: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} + +pub fn umulExtended(x: &Vec, y: &Vec, msb: &Vec, lsb: &Vec) + where DefaultAllocator: Alloc { +unimplemented!() +} + +pub fn usubBorrow(x: &Vec, y: &Vec, borrow: &Vec) -> Vec + where DefaultAllocator: Alloc { + unimplemented!() +} diff --git a/nalgebra-glm/src/lib.rs b/nalgebra-glm/src/lib.rs new file mode 100644 index 00000000..869ae333 --- /dev/null +++ b/nalgebra-glm/src/lib.rs @@ -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; \ No newline at end of file diff --git a/nalgebra-glm/src/matrix.rs b/nalgebra-glm/src/matrix.rs new file mode 100644 index 00000000..2fb9176f --- /dev/null +++ b/nalgebra-glm/src/matrix.rs @@ -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(m: &Mat) -> N +// where DefaultAllocator: Allocator { +// m.determinant() +//} + +pub fn inverse(m: &Mat) -> Mat + where DefaultAllocator: Alloc { + m.clone().try_inverse().unwrap_or(Mat::::zeros()) +} + +pub fn matrix_comp_mult(x: &Mat, y: &Mat) -> Mat + where DefaultAllocator: Alloc { + x.component_mul(y) +} + +pub fn outer_product(c: &Vec, r: &Vec) -> Mat + where DefaultAllocator: Alloc { + c * r.transpose() +} + +pub fn transpose(x: &Mat) -> Mat + where DefaultAllocator: Alloc { + x.transpose() +} \ No newline at end of file diff --git a/nalgebra-glm/src/packing.rs b/nalgebra-glm/src/packing.rs new file mode 100644 index 00000000..71df195c --- /dev/null +++ b/nalgebra-glm/src/packing.rs @@ -0,0 +1,52 @@ +use na::Scalar; + +use aliases::{Vec2, Vec4, UVec2}; + + +pub fn packDouble2x32(v: &UVec2) -> f64 { + unimplemented!() +} + +pub fn packHalf2x16(v: &Vec2) -> u32 { + unimplemented!() +} + +pub fn packSnorm2x16(v: &Vec2) -> u32 { + unimplemented!() +} + +pub fn packSnorm4x8(v: &Vec4) -> u32 { + unimplemented!() +} + +pub fn packUnorm2x16(v: &Vec2) -> u32 { + unimplemented!() +} + +pub fn packUnorm4x8(v: &Vec4) -> u32 { + unimplemented!() +} + +pub fn unpackDouble2x32(v: f64) -> UVec2 { + unimplemented!() +} + +pub fn unpackHalf2x16(v: u32) -> Vec2 { + unimplemented!() +} + +pub fn unpackSnorm2x16(p: u32) -> Vec2 { + unimplemented!() +} + +pub fn unpackSnorm4x8(p: u32) -> Vec4 { + unimplemented!() +} + +pub fn unpackUnorm2x16(p: u32) -> Vec2 { + unimplemented!() +} + +pub fn unpackUnorm4x8(p: u32) -> Vec4 { + unimplemented!() +} diff --git a/nalgebra-glm/src/traits.rs b/nalgebra-glm/src/traits.rs new file mode 100644 index 00000000..0106ec64 --- /dev/null +++ b/nalgebra-glm/src/traits.rs @@ -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 Number for T { +} + +#[doc(hidden)] +pub trait Alloc: +Allocator + Allocator + Allocator + Allocator + Allocator + Allocator + Allocator + Allocator + +Allocator + Allocator + +Allocator + Allocator + +Allocator + Allocator + +Allocator + Allocator + +Allocator + Allocator + +Allocator + Allocator + +Allocator + Allocator + +Allocator + Allocator +{ +} + +impl + Alloc for T +where T: Allocator + Allocator + Allocator + Allocator + Allocator + Allocator + Allocator + Allocator + + Allocator + Allocator + + Allocator + Allocator + + Allocator + Allocator + + Allocator + Allocator + + Allocator + Allocator + + Allocator + Allocator + + Allocator + Allocator + + Allocator + Allocator { +} \ No newline at end of file diff --git a/nalgebra-glm/src/trigonometric.rs b/nalgebra-glm/src/trigonometric.rs new file mode 100644 index 00000000..56c08d63 --- /dev/null +++ b/nalgebra-glm/src/trigonometric.rs @@ -0,0 +1,73 @@ +use na::{self, Real, DimName, DefaultAllocator}; + +use aliases::Vec; +use traits::Alloc; + +pub fn acos(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + x.map(|e| e.acos()) +} +pub fn acosh(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + x.map(|e| e.acosh()) +} +pub fn asin(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + x.map(|e| e.asin()) +} +pub fn asinh(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + x.map(|e| e.asinh()) +} +pub fn atan2(y: &Vec, x: &Vec) -> Vec + where DefaultAllocator: Alloc { + y.zip_map(x, |y, x| y.atan2(x)) +} +pub fn atan(y_over_x: &Vec) -> Vec + where DefaultAllocator: Alloc { + y_over_x.map(|e| e.atan()) +} +pub fn atanh(x: &Vec) -> Vec + where DefaultAllocator: Alloc { + x.map(|e| e.atanh()) +} + +pub fn cos(angle: &Vec) -> Vec + where DefaultAllocator: Alloc { + angle.map(|e| e.cos()) +} + +pub fn cosh(angle: &Vec) -> Vec + where DefaultAllocator: Alloc { + angle.map(|e| e.cosh()) +} + +pub fn degrees(radians: &Vec) -> Vec + where DefaultAllocator: Alloc { + radians.map(|e| e * na::convert(180.0) / N::pi()) +} + +pub fn radians(degrees: &Vec) -> Vec + where DefaultAllocator: Alloc { + degrees.map(|e| e * N::pi() / na::convert(180.0)) +} + +pub fn sin(angle: &Vec) -> Vec + where DefaultAllocator: Alloc { + angle.map(|e| e.sin()) +} + +pub fn sinh(angle: &Vec) -> Vec + where DefaultAllocator: Alloc { + angle.map(|e| e.sinh()) +} + +pub fn tan(angle: &Vec) -> Vec + where DefaultAllocator: Alloc { + angle.map(|e| e.tan()) +} + +pub fn tanh(angle: &Vec) -> Vec + where DefaultAllocator: Alloc { + angle.map(|e| e.tanh()) +} \ No newline at end of file diff --git a/nalgebra-glm/src/vector_relational.rs b/nalgebra-glm/src/vector_relational.rs new file mode 100644 index 00000000..28c979ae --- /dev/null +++ b/nalgebra-glm/src/vector_relational.rs @@ -0,0 +1,50 @@ +use na::{self, Real, DimName, DefaultAllocator}; + +use aliases::Vec; +use traits::{Number, Alloc}; + + +pub fn all(v: &Vec) -> bool + where DefaultAllocator: Alloc { + v.iter().all(|x| *x) +} + +pub fn any(v: &Vec) -> bool + where DefaultAllocator: Alloc { + v.iter().any(|x| *x) +} + +pub fn equal(x: &Vec, y: &Vec) -> Vec + where DefaultAllocator: Alloc { + x.zip_map(y, |x, y| x == y) +} + +pub fn greaterThan(x: &Vec, y: &Vec) -> Vec + where DefaultAllocator: Alloc { + x.zip_map(y, |x, y| x > y) +} + +pub fn greaterThanEqual(x: &Vec, y: &Vec) -> Vec + where DefaultAllocator: Alloc { + x.zip_map(y, |x, y| x >= y) +} + +pub fn lessThan(x: &Vec, y: &Vec) -> Vec + where DefaultAllocator: Alloc { + x.zip_map(y, |x, y| x < y) +} + +pub fn lessThanEqual(x: &Vec, y: &Vec) -> Vec + where DefaultAllocator: Alloc { + x.zip_map(y, |x, y| x <= y) +} + +pub fn not(v: &Vec) -> Vec + where DefaultAllocator: Alloc { + v.map(|x| !x) +} + +pub fn notEqual(x: &Vec, y: &Vec) -> Vec + where DefaultAllocator: Alloc { + x.zip_map(y, |x, y| x != y) +}