TheCherno / Sparky

Cross-Platform High Performance 2D/3D game engine for people like me who like to write code.
Apache License 2.0
1.1k stars 222 forks source link

There is no inverse function currently in your mat4.cpp and mat4.h #9

Closed JacobMango closed 9 years ago

JacobMango commented 9 years ago

This needs to be addressed immediately for stuff like movement and rotating. You can implement it in anyway you wish. Where it could be something like http://stackoverflow.com/questions/1148309/inverting-a-4x4-matrix or a way you feel is safe and is fast.

PistonMiner commented 9 years ago

I totally agree. While this may not seem of immediate importance, it is definitely be important for moving the camera around as well as doing animation in general and will be especially important for 3D.

holgk commented 9 years ago

Wouldn't it be easier if he includes glm http://glm.g-truc.net/0.9.6/index.html into sparky? As far as i know these functions and classes are pretty optimized. And it's a header only lib so there shouldn't be any problems with emscripten. I know he wants to show us how to but this math stuff costs a lot of time and is essential for the engine.

CaioIcy commented 9 years ago

I agree with @holgk that glm should be chosen. The only reasons to implement all the math himself would be to either study it, or to teach other people.

PistonMiner commented 9 years ago

Well, he already implemented part of the maths himself, so why switch over to GLM now?

TheCherno commented 9 years ago

We're not going to use GLM because we don't need to. An inverse function was added in Ep. 20.