zhelezkov / atomic-haxe-math Goto Github PK
View Code? Open in Web Editor NEWHigh performance vec-math library for atomic-haxe!
License: MIT License
High performance vec-math library for atomic-haxe!
License: MIT License
I tried porting my stuff from hxmath to atomic-haxe-math again today. Everything worked great except for one thing, which I debugged down to the following expression:
return new Mat4().fromQuat(Quat.fromEuler(X, Y, Z));
I replaced the Quat.fromEuler function with this (as described here: http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/):
var q = new Quat();
var c1:Float = Math.cos(x/2);
var s1:Float = Math.sin(x/2);
var c2:Float = Math.cos(y/2);
var s2:Float = Math.sin(y/2);
var c3:Float = Math.cos(z/2);
var s3:Float = Math.sin(z/2);
var c1c2 = c1*c2;
var s1s2 = s1*s2;
q[3] =c1c2*c3 - s1s2*s3;
q[0] =c1c2*s3 + s1s2*c3;
q[1] =s1*c2*c3 + c1*s2*s3;
q[2] = c1 * s2 * c3 - s1 * c2 * s3;
return q;
It fixed my problem. I don't know if this issue is a quirk in atomic engine or if it's a bug.
Using properties, it's possible to add these fields for convenience while still conserving array read/write operations under the hood.
I don't know where else to ask :(
I tried replacing my current math lib with this one, but eventually gave up when i couldn't produce the same results. Admittedly, there are lots of calculations i had to adapt from the old lib to this one, and i probably made a mistake somewhere. Still, i may as well weed out this possible cause.
When using the glm helper functions (perspective, lookAt), what is the expected coordinate system?
just a suggestion that a example which shows what atomic-haxe can do would be great.
if it is good for things like moving platforms etc, like the physics platformer demo, then would be good to show off the power of the haxe definitions ;)
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.