Home | Features | Roadmap | Learn | Documentation | ||
Latest version: Tramway SDK 0.0.9 Github Quick links Home Get Started |
Math
This part of the framework contains math stuff. Since we use the glm library,
we don't really need to create any of our own math types, but I alisased
the vector and matrix types into the
There's also a couple of constants, which have to do with the coordinate
system that we're using, i.e. Other than that, this part of the framework contains a couple of random math functions which the glm library doesn't have. At least in C++ part of the framework. Since glm is a C++ only library, I re-implemented some of the vector types in Lua, so that they can be used for scripting. Scripting in LuaCreating a vector and operations on a vector
vector = tram.math.vec3(420.0, -42.0, 4.20)
Creating a quaternion from euler angles and operations on it
rotation = tram.math.quat(vector)
Rotating a vector by a quaternion
vector = rotation * vector
|
|
|