Add seperation between ROTMATRIX and TRANSFERVECTOR

This commit is contained in:
2024-04-02 23:40:22 -05:00
parent 4da6772827
commit 1bf91b2d75
7 changed files with 73 additions and 132 deletions

View File

@@ -30,10 +30,10 @@ namespace GTETest {
return true;
}
auto matrix = GTE::MATRIX::rotation(0, 0, rotation);
matrix.trans[0] = (Assets::Main::DoenerFishInfo.size.width/2);
matrix.trans[1] = (Assets::Main::DoenerFishInfo.size.height/2);
const auto matrix = GTE::MATRIX{
GTE::ROTMATRIX::rotated(-rotation, rotation, -rotation),
GTE::TRANSFERVECTOR::translated((Assets::Main::DoenerFishInfo.size.width/2), (Assets::Main::DoenerFishInfo.size.height/2))
};
doener_fish.apply(matrix);
rotation += 5_DEG;
return false;

View File

@@ -19,14 +19,12 @@ namespace GTETest {
void apply(const GTE::MATRIX& matrix) {
static const auto apply_to = [](const GTE::MATRIX& matrix, GTE::SVECTOR vector) -> GPU::Vertex {
GTE::MATRIX move_back = GTE::MATRIX::identity();
GTE::MATRIX move_back = GTE::MATRIX{
GTE::ROTMATRIX::identity(), GTE::TRANSFERVECTOR::translated(-matrix.transfer.x, -matrix.transfer.y, -matrix.transfer.z)
};
GTE::SVECTOR output;
int32_t flag;
move_back.trans[0] = -matrix.trans[0];
move_back.trans[1] = -matrix.trans[1];
move_back.trans[2] = -matrix.trans[2];
GTE::comp_matrix(matrix, move_back, move_back);
return GTE::apply_matrix(move_back, vector, output).to<GPU::Vertex>();
};