Asteroid progress

This commit is contained in:
Anuken
2021-06-11 19:59:18 -04:00
parent 1eebb48baa
commit c4b1bf3e55
12 changed files with 102 additions and 46 deletions

View File

@@ -0,0 +1,22 @@
package mindustry.graphics.g3d;
import arc.math.geom.*;
//TODO maybe this is a bad idea
/** A GenericMesh that wraps and applies an additional transform to a generic mesh. */
public class MatMesh implements GenericMesh{
private static final Mat3D tmp = new Mat3D();
GenericMesh mesh;
Mat3D mat;
public MatMesh(GenericMesh mesh, Mat3D mat){
this.mesh = mesh;
this.mat = mat;
}
@Override
public void render(Mat3D projection, Mat3D transform){
mesh.render(projection, tmp.set(transform).mul(mat));
}
}