Support ApplyMatrix
This commit is contained in:
@@ -34,7 +34,7 @@ namespace GTETest {
|
||||
GTE::set_trans_matrix(matrix);
|
||||
GTE::set_rot_matrix(matrix);
|
||||
|
||||
doener_fish.apply();
|
||||
doener_fish.apply(matrix);
|
||||
rotation += 5_DEG;
|
||||
return false;
|
||||
}
|
||||
|
@@ -17,20 +17,19 @@ namespace GTETest {
|
||||
};
|
||||
}
|
||||
|
||||
void apply() {
|
||||
static const auto apply_to = [](GTE::SVECTOR vector) -> GPU::Vertex {
|
||||
GTE::VECTOR output;
|
||||
void apply(const GTE::MATRIX& matrix) {
|
||||
static const auto apply_to = [](const GTE::MATRIX& matrix, GTE::SVECTOR vector) -> GPU::Vertex {
|
||||
GTE::SVECTOR output;
|
||||
int32_t flag;
|
||||
|
||||
GTE::rot_trans(vector, output, flag);
|
||||
return output.to<GPU::Vertex>();
|
||||
return GTE::apply_matrix(matrix, vector, output).to<GPU::Vertex>();
|
||||
};
|
||||
|
||||
const auto& area = this->area;
|
||||
this->display.vertex0 = apply_to(GTE::SVECTOR::from(area.get_top_left()));
|
||||
this->display.vertex1 = apply_to(GTE::SVECTOR::from(area.get_top_right()));
|
||||
this->display.vertex2 = apply_to(GTE::SVECTOR::from(area.get_bottom_left()));
|
||||
this->display.vertex3 = apply_to(GTE::SVECTOR::from(area.get_bottom_right()));
|
||||
this->display.vertex0 = apply_to(matrix, GTE::SVECTOR::from(area.get_top_left()));
|
||||
this->display.vertex1 = apply_to(matrix, GTE::SVECTOR::from(area.get_top_right()));
|
||||
this->display.vertex2 = apply_to(matrix, GTE::SVECTOR::from(area.get_bottom_left()));
|
||||
this->display.vertex3 = apply_to(matrix, GTE::SVECTOR::from(area.get_bottom_right()));
|
||||
}
|
||||
|
||||
void render() {
|
||||
|
Reference in New Issue
Block a user