java-graphics / glm Goto Github PK
View Code? Open in Web Editor NEWJava OpenGL Mathematics (GLM)
License: MIT License
Java OpenGL Mathematics (GLM)
License: MIT License
In glm.BasicOperators.java on line 2256 res.y = a.z - bZ; should be res.z = a.z - bZ;
implement
There is a nice project here that allows to have operator overloading support.
It is basic but still a huge step for java devs.
There are some drawbacks though at the moment:
Map<String, String> binary = new HashMap<String, String>() {{
put("+", "add");
put("-", "subtract");
put("*", "multiply");
put("/", "divide");
put("%", "remainder");
put("&", "and");
put("|", "or");
put("^", "xor");
put("<<", "shiftLeft");
put(">>", "shiftRight");
put("<", compareTo);
put(">", compareTo);
put("<=", compareTo);
put(">=", compareTo);
}};
String revSuffix = "Rev";
Map<String, String> unary = new java.util.HashMap<String, String>() {{
put("-", "negate"); // jdk7
put("---", "negate"); // jdk8
put("~", "not");
}};
String compareTo = "compareTo";
String indexGet = "get";
String[] indexSet = new String[]{"set", "put"};
String[] valueOf = new String[]{"valueOf", "of"};
I tried to add this library on gradle.build to use it on an Android app. It didn't work. Gradle sync fails because openvr requires API 22 runtimes (not sure if it was sync or build that fails.)
So, I looked into the code and found that not much of the code was using openvr. After realising that, I removed a few lines of code to compile without openvr dependency. Gradle synced, the app was built, and obviously, glm worked on the app without any problem.
For anyone having the same problem as I did, refer to my forked repo if you want to see what parts of the code I modified/removed. There are still many Android 4.0 phones out there. My phone is the very example.
The Mat4d class is almost a verbatim copy of JOML's Matrix4f, including the JavaDocs, whose references do not match anymore, because glm just renamed the class and method names.
Examples:
JOML 1.7.1: https://github.com/JOML-CI/JOML/blob/5b9b0c0aa7e374dba08cfca4fe47bdd9c8cc6d03/src/org/joml/Matrix4f.java#L7283-L7300
glm:
glm/glm/src/glm/mat/_4/d/Mat4d.java
Lines 361 to 381 in 1431993
If you want to copy code and even JavaDoc verbatim, then you should at least give credit or ask for permission.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.