mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-24 20:07:54 +01:00
Reticulated splines
- Fix line models rendering garbage - Fix shulker boxes appear at the origin before snapping into place - Make the box and line models public
This commit is contained in:
parent
868a263c28
commit
6f0a2b0e56
3 changed files with 5 additions and 3 deletions
|
@ -80,6 +80,7 @@ public final class LineModelBuilder {
|
||||||
|
|
||||||
public Model build() {
|
public Model build() {
|
||||||
vertexView.vertexCount(vertexCount);
|
vertexView.vertexCount(vertexCount);
|
||||||
|
vertexView.nativeMemoryOwner(data);
|
||||||
|
|
||||||
var boundingSphere = ModelUtil.computeBoundingSphere(vertexView);
|
var boundingSphere = ModelUtil.computeBoundingSphere(vertexView);
|
||||||
boundingSphere.w += 0.1f; // make the bounding sphere a little bigger to account for line width
|
boundingSphere.w += 0.1f; // make the bounding sphere a little bigger to account for line width
|
||||||
|
@ -137,7 +138,7 @@ public final class LineModelBuilder {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(MutableVertexList vertexList) {
|
public void write(MutableVertexList vertexList) {
|
||||||
vertexList.writeAll(vertexList);
|
this.vertexList.writeAll(vertexList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -25,7 +25,7 @@ public final class HitboxComponent implements EntityComponent {
|
||||||
// | / | /
|
// | / | /
|
||||||
// |/ |/
|
// |/ |/
|
||||||
// 001------101
|
// 001------101
|
||||||
private static final Model BOX_MODEL = new LineModelBuilder(12)
|
public static final Model BOX_MODEL = new LineModelBuilder(12)
|
||||||
// Starting from 0, 0, 0
|
// Starting from 0, 0, 0
|
||||||
.line(0, 0, 0, 0, 0, 1)
|
.line(0, 0, 0, 0, 0, 1)
|
||||||
.line(0, 0, 0, 0, 1, 0)
|
.line(0, 0, 0, 0, 1, 0)
|
||||||
|
@ -44,7 +44,7 @@ public final class HitboxComponent implements EntityComponent {
|
||||||
.line(1, 1, 0, 0, 1, 0)
|
.line(1, 1, 0, 0, 1, 0)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
private static final Model LINE_MODEL = new LineModelBuilder(1)
|
public static final Model LINE_MODEL = new LineModelBuilder(1)
|
||||||
.line(0, 0, 0, 0, 2, 0)
|
.line(0, 0, 0, 0, 2, 0)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@ public class ShulkerBoxVisual extends AbstractBlockEntityVisual<ShulkerBoxBlockE
|
||||||
lid = instances.childOrThrow("lid");
|
lid = instances.childOrThrow("lid");
|
||||||
|
|
||||||
initialPose = createInitialPose();
|
initialPose = createInitialPose();
|
||||||
|
instances.updateInstancesStatic(initialPose);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Matrix4f createInitialPose() {
|
private Matrix4f createInitialPose() {
|
||||||
|
|
Loading…
Reference in a new issue