1#include "Game/Util/MtxUtil.hpp"
4 void setMtxTrans(MtxPtr mtx, f32 x, f32 y, f32 z) {
10 void addTransMtx(MtxPtr mtx,
const TVec3f &rVec) {
16 void addTransMtxLocal(MtxPtr mtx,
const TVec3f &rVec) {
17 addTransMtxLocalX(mtx, rVec.x);
18 addTransMtxLocalY(mtx, rVec.y);
19 addTransMtxLocalZ(mtx, rVec.z);
22 void addTransMtxLocalX(MtxPtr mtx, f32 x_coord) {
23 mtx[0][3] = mtx[0][3] + (mtx[0][0] * x_coord);
24 mtx[1][3] = mtx[1][3] + (mtx[1][0] * x_coord);
25 mtx[2][3] = mtx[2][3] + (mtx[2][0] * x_coord);
28 void addTransMtxLocalY(MtxPtr mtx, f32 y_coord) {
29 mtx[0][3] = mtx[0][3] + (mtx[0][1] * y_coord);
30 mtx[1][3] = mtx[1][3] + (mtx[1][1] * y_coord);
31 mtx[2][3] = mtx[2][3] + (mtx[2][1] * y_coord);
34 void addTransMtxLocalZ(MtxPtr mtx, f32 z_coord) {
35 mtx[0][3] = mtx[0][3] + (mtx[0][2] * z_coord);
36 mtx[1][3] = mtx[1][3] + (mtx[1][2] * z_coord);
37 mtx[2][3] = mtx[2][3] + (mtx[2][2] * z_coord);
40 void extractMtxXDir(MtxPtr mtx, TVec3f *pOut) {
46 void extractMtxYDir(MtxPtr mtx, TVec3f *pOut) {
52 void extractMtxZDir(MtxPtr mtx, TVec3f *pOut) {
58 void extractMtxXYZDir(MtxPtr mtx, TVec3f *pOutX, TVec3f *pOutY, TVec3f *pOutZ) {
59 MR::extractMtxXDir(mtx, pOutX);
60 MR::extractMtxYDir(mtx, pOutY);
61 MR::extractMtxZDir(mtx, pOutZ);
64 void extractMtxTrans(MtxPtr mtx, TVec3f *pOut) {