Created
July 26, 2017 04:01
-
-
Save shibbo/e8e0cc75f4ea61a4a0d45e5bbf06af3d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "helper.h" | |
Helper::Helper(Vector3 scale, Vector3 rot, Vector3 trans) | |
{ | |
this->scale = scale; | |
this->rot = rot; | |
this->trans = trans; | |
} | |
QMatrix4x4 Helper::SRTToMatrix() | |
{ | |
QMatrix4x4 ret = QMatrix4x4.Identity; | |
QMatrix4x4 mscale = QMatrix4x4.scale(scale.x, scale.y, scale.z); | |
QMatrix4x4 mrot = QMatrix4x4.rotate(rot.x, rot.y, rot.z); | |
QMatrix4x4 mtrans = QMatrix4x4.translate(trans.x, trans.y, trans.z); | |
ret *= mscale; | |
ret *= mrot; | |
ret *= mtrans; | |
return ret; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment