more work done
This commit is contained in:
parent
072cf05aff
commit
d309f63814
@ -364,6 +364,19 @@ public class Matrix4f {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Matrix4f translateZ(float z) {
|
||||
if(z == 0F) return this;
|
||||
if((properties & (PROPERTY_ROTATION | PROPERTY_SCALE)) == 0) {
|
||||
data[M32] += z;
|
||||
return evaluateProps();
|
||||
}
|
||||
data[M30] += data[M20] * z;
|
||||
data[M31] += data[M21] * z;
|
||||
data[M32] += data[M22] * z;
|
||||
data[M33] += data[M23] * z;
|
||||
return evaluateProps();
|
||||
}
|
||||
|
||||
public Matrix4f translate(float x, float y) {
|
||||
if(x == 0F && y == 0F) return this;
|
||||
if((properties & (PROPERTY_ROTATION | PROPERTY_SCALE)) == 0) {
|
||||
|
@ -6,13 +6,14 @@ import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||
import speiger.src.collections.utils.Stack;
|
||||
import speiger.src.coreengine.math.misc.Facing;
|
||||
import speiger.src.coreengine.math.vector.matrix.Matrix4f;
|
||||
import speiger.src.coreengine.math.vector.matrix.Matrix4fStack;
|
||||
import speiger.src.coreengine.math.vector.quaternion.Quaternion;
|
||||
import speiger.src.coreengine.rendering.guiOld.helper.box.IGuiBox;
|
||||
import speiger.src.coreengine.rendering.models.DrawCall;
|
||||
|
||||
public class SimpleUIRenderer implements IUIRenderer {
|
||||
TexturedRect cachedRect = new TexturedRect();
|
||||
Stack<Matrix4f> transformCache = ObjectArrayList.wrap(new Matrix4f());
|
||||
Matrix4fStack transformCache = new Matrix4fStack();
|
||||
|
||||
@Override
|
||||
public boolean isInScissors(IGuiBox box) {
|
||||
@ -38,48 +39,25 @@ public class SimpleUIRenderer implements IUIRenderer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pushTransform() {
|
||||
transformCache.push(new Matrix4f(transformCache.top()));
|
||||
}
|
||||
|
||||
public void pushTransform() { transformCache.push(); }
|
||||
@Override
|
||||
public void popTransform() {
|
||||
|
||||
}
|
||||
|
||||
public void popTransform() { transformCache.pop(); }
|
||||
@Override
|
||||
public void translate(float z) {
|
||||
|
||||
}
|
||||
|
||||
public void translate(float z) { transformCache.translateZ(z); }
|
||||
@Override
|
||||
public void translate(float x, float y) {
|
||||
|
||||
}
|
||||
|
||||
public void translate(float x, float y) { transformCache.translate(x, y); }
|
||||
@Override
|
||||
public void translate(float x, float y, float z) {
|
||||
|
||||
}
|
||||
|
||||
public void translate(float x, float y, float z) { transformCache.translate(x, y, z); }
|
||||
@Override
|
||||
public void scale(float scale) {
|
||||
|
||||
}
|
||||
|
||||
public void scale(float scale) { transformCache.scale(scale); }
|
||||
@Override
|
||||
public void scale(float x, float y) {
|
||||
|
||||
}
|
||||
|
||||
public void scale(float x, float y) { transformCache.scale(x, y, 1F); }
|
||||
@Override
|
||||
public void rotate(Quaternion rotation) {
|
||||
|
||||
}
|
||||
public void rotate(Quaternion rotation) { transformCache.rotate(rotation); }
|
||||
|
||||
@Override
|
||||
public void drawCustom(Consumer<Matrix4f> matrix) {
|
||||
|
||||
flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user