feat(rendering): update Geometry
package nullengine.client.rendering.scene;
-import nullengine.client.rendering.gl.SingleBufferVAO;
import nullengine.client.rendering.math.BoundingVolume;
import nullengine.client.rendering.queue.RenderQueue;
import nullengine.client.rendering.queue.RenderType;
+import nullengine.client.rendering.queue.StandardRenderTypes;
public class Geometry extends Node {
- private SingleBufferVAO vao;
+ private Renderable renderable;
private RenderType renderType;
private BoundingVolume boundingVolume = new BoundingVolume();
- public Geometry(SingleBufferVAO vao) {
- this.vao = vao;
+ public Geometry() {
+ this(null, StandardRenderTypes.OPAQUE);
+ }
+
+ public Geometry(Renderable renderable, RenderType renderType) {
+ this.renderable = renderable;
+ this.renderType = renderType;
scene().addChangeListener((observable, oldValue, newValue) -> {
if (oldValue != null) {
oldValue.getRenderQueue().remove(this, renderType);
@@ -24,12 +29,12 @@ public class Geometry extends Node {
});
}
- public SingleBufferVAO getVao() {
- return vao;
+ public Renderable getRenderable() {
+ return renderable;
}
- public void setVao(SingleBufferVAO vao) {
- this.vao = vao;
+ public void setRenderable(Renderable renderable) {
+ this.renderable = renderable;
}
public RenderType getRenderType() {
