Git Product home page Git Product logo

glm-rs's People

Contributors

bitshifter avatar dche avatar fredriknoren avatar human9 avatar kodraus avatar maxeonyx avatar nercury avatar petrochenkov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

glm-rs's Issues

Fails to build for wasm

Due to the quickcheck dependency tree having a dependency on an old version of memchr, this crate won't compile for the wasm32-unknown-unknown target.

Using Associated Constants to simplify code

With the soon to be stabilitized associated constants, I wonder if this project would greatly benefit for rewriting some of the Vec code to use them.

This would allow for Vec's to be not limited to 2,3,4, and allow the code to be more readable by having less macros around it. I am sure there are many other quick wins we could get from them on this project but these are the first couple that came to mind.

(unsure if this project is still maintained)

Quaternions?

Just a feature request - have you thought about including quaternions? The library looks good, this is something that stands out as potentially missing for someone used to glm.

Conflict with new num::Float::epsilon

Just a heads up -- we recently added Float::epsilon in rust-num/num#231, and then a Crater run showed that glm broke due to call ambiguity. See the logs here:
https://tools.taskcluster.net/task-inspector/#ytvixlBAQzCMhtWXQCM3fA/0

The ambiguous call is in your ApproxEq::is_approx_eq, where Self::BaseType::epsilon could now either mean Float::epsilon or your BaseFloat::epsilon. You could change it to a more explicit call to one of these choices. Or since you seem to just be extending Float, you might remove your epsilon. (Float also now has to_degrees and to_radians, if you like.)

Rust 1.4 E0277 warnings

A new warning was introduced with Rust 1.4 which occurs in a few places in GLM. This warning will be upgraded to an error in the next version of Rust.

src/basenum.rs:72:1: 88:2 warning: the trait core::marker::Sized is not implemented for the type Self [E0277]
src/basenum.rs:72 pub trait SignedNum
src/basenum.rs:73 : Neg<Output = Self>
src/basenum.rs:74 + Sub<Self, Output = Self>
src/basenum.rs:75 {
src/basenum.rs:76 /// Returns the absolute value of the receiver.
src/basenum.rs:77 fn abs(&self) -> Self;
...
src/basenum.rs:72:1: 88:2 help: run rustc --explain E0277 to see a detailed explanation
src/basenum.rs:72:1: 88:2 note: Self does not have a constant size known at compile-time
src/basenum.rs:72:1: 88:2 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/basenum.rs:72 pub trait SignedNum
src/basenum.rs:73 : Neg<Output = Self>
src/basenum.rs:74 + Sub<Self, Output = Self>
src/basenum.rs:75 {
src/basenum.rs:76 /// Returns the absolute value of the receiver.
src/basenum.rs:77 fn abs(&self) -> Self;
...
src/basenum.rs:72:1: 88:2 note: required by core::ops::Sub
src/basenum.rs:77:5: 77:27 warning: the trait core::marker::Sized is not implemented for the type Self [E0277]
src/basenum.rs:77 fn abs(&self) -> Self;
^~~~~~~~~~~~~~~~~~~~~~
src/basenum.rs:77:5: 77:27 help: run rustc --explain E0277 to see a detailed explanation
src/basenum.rs:77:5: 77:27 note: Self does not have a constant size known at compile-time
src/basenum.rs:77:5: 77:27 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/basenum.rs:77 fn abs(&self) -> Self;
^~~~~~~~~~~~~~~~~~~~~~
src/basenum.rs:77:5: 77:27 note: required by core::ops::Sub
src/basenum.rs:87:5: 87:28 warning: the trait core::marker::Sized is not implemented for the type Self [E0277]
src/basenum.rs:87 fn sign(&self) -> Self;
^~~~~~~~~~~~~~~~~~~~~~~
src/basenum.rs:87:5: 87:28 help: run rustc --explain E0277 to see a detailed explanation
src/basenum.rs:87:5: 87:28 note: Self does not have a constant size known at compile-time
src/basenum.rs:87:5: 87:28 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/basenum.rs:87 fn sign(&self) -> Self;
^~~~~~~~~~~~~~~~~~~~~~~
src/basenum.rs:87:5: 87:28 note: required by core::ops::Sub
src/mat/traits.rs:30:1: 78:2 warning: the trait mat::traits::GenMat<T, C> is not implemented for the type <<Self as mat::traits::GenMat<T, C>>::Transpose as mat::traits::GenMat<T, <Self as mat::traits::GenMat<T, C>>::R>>::Transpose [E0277]
src/mat/traits.rs:30 pub trait GenMat
src/mat/traits.rs:31 <
src/mat/traits.rs:32 T: BaseFloat,
src/mat/traits.rs:33 C: GenFloatVec
src/mat/traits.rs:34 >
src/mat/traits.rs:35 : Sized
...
src/mat/traits.rs:30:1: 78:2 help: run rustc --explain E0277 to see a detailed explanation
src/mat/traits.rs:30:1: 78:2 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/mat/traits.rs:30 pub trait GenMat
src/mat/traits.rs:31 <
src/mat/traits.rs:32 T: BaseFloat,
src/mat/traits.rs:33 C: GenFloatVec
src/mat/traits.rs:34 >
src/mat/traits.rs:35 : Sized
...
src/mat/traits.rs:30:1: 78:2 note: required by mat::traits::GenMat
src/mat/traits.rs:64:5: 64:44 warning: the trait mat::traits::GenMat<T, C> is not implemented for the type <<Self as mat::traits::GenMat<T, C>>::Transpose as mat::traits::GenMat<T, <Self as mat::traits::GenMat<T, C>>::R>>::Transpose [E0277]
src/mat/traits.rs:64 fn transpose(&self) -> Self::Transpose;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/mat/traits.rs:64:5: 64:44 help: run rustc --explain E0277 to see a detailed explanation
src/mat/traits.rs:64:5: 64:44 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/mat/traits.rs:64 fn transpose(&self) -> Self::Transpose;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/mat/traits.rs:64:5: 64:44 note: required by mat::traits::GenMat
src/mat/traits.rs:77:5: 77:41 warning: the trait mat::traits::GenMat<T, C> is not implemented for the type <<Self as mat::traits::GenMat<T, C>>::Transpose as mat::traits::GenMat<T, <Self as mat::traits::GenMat<T, C>>::R>>::Transpose [E0277]
src/mat/traits.rs:77 fn mul_c(&self, rhs: &Self) -> Self;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/mat/traits.rs:77:5: 77:41 help: run rustc --explain E0277 to see a detailed explanation
src/mat/traits.rs:77:5: 77:41 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/mat/traits.rs:77 fn mul_c(&self, rhs: &Self) -> Self;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/mat/traits.rs:77:5: 77:41 note: required by mat::traits::GenMat
src/builtin/matrix.rs:77:1: 89:2 warning: the trait mat::traits::GenMat<T, R> is not implemented for the type <M as mat::traits::GenMat<T, C>>::Transpose [E0277]
src/builtin/matrix.rs:77 pub fn outerProduct<
src/builtin/matrix.rs:78 T: BaseFloat,
src/builtin/matrix.rs:79 C: GenFloatVec,
src/builtin/matrix.rs:80 R: GenFloatVec,
src/builtin/matrix.rs:81 M: GenMat<T, C, R = R>
src/builtin/matrix.rs:82 >(c: C, r: R) -> M {
...
src/builtin/matrix.rs:77:1: 89:2 help: run rustc --explain E0277 to see a detailed explanation
src/builtin/matrix.rs:77:1: 89:2 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/builtin/matrix.rs:77 pub fn outerProduct<
src/builtin/matrix.rs:78 T: BaseFloat,
src/builtin/matrix.rs:79 C: GenFloatVec,
src/builtin/matrix.rs:80 R: GenFloatVec,
src/builtin/matrix.rs:81 M: GenMat<T, C, R = R>
src/builtin/matrix.rs:82 >(c: C, r: R) -> M {
...
src/builtin/matrix.rs:77:1: 89:2 note: required by mat::traits::GenMat

The basenum.rs warnings are easy, just add + Sized, I have no idea how to fix the warnings on the nested types though.

Transforms mix borrows and moves

Hey is there a reason why for the various transformation functions like translate, rotate, etc, you borrow the matrix and move the vector? I'm not sure I understand why the transform needs to take ownership of the vector.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.