16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 13:39:18 +02:00

Merge branch 'milek-dev' into gfx-work

This commit is contained in:
milek7
2018-10-10 19:33:08 +02:00
49 changed files with 1697 additions and 1026 deletions

View File

@@ -61,6 +61,10 @@ public:
load(glm::mat4 const &Matrix) {
m_stack.top() = Matrix;
upload(); }
void
scale( glm::vec3 const &Scale ) {
m_stack.top() = glm::scale( m_stack.top(), Scale );
upload(); }
void
multiply( glm::mat4 const &Matrix ) {
m_stack.top() *= Matrix;
@@ -137,9 +141,9 @@ public:
m_stacks[ m_mode ].rotate(
static_cast<float>(glm::radians(Angle)),
glm::vec3(
static_cast<float>(X),
static_cast<float>(Y),
static_cast<float>(Z) ) ); }
static_cast<float>( X ),
static_cast<float>( Y ),
static_cast<float>( Z ) ) ); }
template <typename Type_>
void
translate( Type_ const X, Type_ const Y, Type_ const Z ) {
@@ -149,6 +153,14 @@ public:
static_cast<float>( Y ),
static_cast<float>( Z ) ) ); }
template <typename Type_>
void
scale( Type_ const X, Type_ const Y, Type_ const Z ) {
m_stacks[ m_mode ].scale(
glm::vec3(
static_cast<float>( X ),
static_cast<float>( Y ),
static_cast<float>( Z ) ) ); }
template <typename Type_>
void
multiply( Type_ const *Matrix ) {
m_stacks[ m_mode ].multiply(
@@ -213,7 +225,8 @@ extern opengl_matrices OpenGLMatrices;
#define glRotatef OpenGLMatrices.rotate
#define glTranslated OpenGLMatrices.translate
#define glTranslatef OpenGLMatrices.translate
// NOTE: no scale override as we aren't using it anywhere
#define glScaled OpenGLMatrices.scale
#define glScalef OpenGLMatrices.scale
#define glMultMatrixd OpenGLMatrices.multiply
#define glMultMatrixf OpenGLMatrices.multiply
#define glOrtho OpenGLMatrices.ortho