Skip to content

Commit

Permalink
Improve laser arm firing graphics
Browse files Browse the repository at this point in the history
  • Loading branch information
Rearth committed Mar 10, 2024
1 parent 1cec653 commit 55c659b
Show file tree
Hide file tree
Showing 6 changed files with 357 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ private boolean trySetNewTarget(BlockPos targetPos, boolean alsoSetDirection) {
var controllerPos = Objects.requireNonNull(coreEntity).getControllerPos();
if (controllerPos != null) targetPos = controllerPos;
}
System.out.println("setting target: " + targetPos.toShortString());

var distance = targetPos.getManhattanDistance(pos);
if (distance > 64) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class ParticleContent {

public static final ParticleSystem<LineData> LASER_BEAM_EFFECT = PARTICLE_CONTROLLER.register(LineData.class, ((world, pos, data) -> {
ClientParticles.setParticleCount(1);
ClientParticles.spawnPrecise(ParticleTypes.SMALL_FLAME, world, pos, 0.4, 0.3, 0.4);
ClientParticles.spawnPrecise(ParticleTypes.SMALL_FLAME, world, data.end, 0.4, 0.3, 0.4);
}));

private static void spawnCubeOutline(ParticleEffect particle, Vec3d origin, float size, int duration, int segments) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public void postRender(MatrixStack matrices, T laserEntity, BakedGeoModel model,
var targetPosOffset = targetPos.subtract(Vec3d.of(laserEntity.getPos()));

var forward = targetPos.subtract(startPos).normalize();
ParticleContent.LASER_BEAM_EFFECT.spawn(laserEntity.getWorld(), startPos.add(forward), new ParticleContent.LineData(startPos.add(forward), targetPos.add(0.5, 0, 0.5)));
if (!laserEntity.isTargetingAtomicForge())
ParticleContent.LASER_BEAM_EFFECT.spawn(laserEntity.getWorld(), startPos.add(forward), new ParticleContent.LineData(startPos.add(forward), targetPos.add(0.5, 0, 0.5).subtract(forward.multiply(0.6))));

var cross = forward.crossProduct(new Vec3d(0, 1,0));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,11 @@
"easing": "easeInOutBack"
}
}
},
"waves": {
"scale": {
"vector": [0, 0, 0]
}
}
}
},
Expand Down Expand Up @@ -1226,6 +1231,11 @@
"vector": [0, -0.5, 0],
"easing": "easeInOutBack"
}
},
"waves": {
"scale": {
"vector": [0, 0, 0]
}
}
}
},
Expand Down Expand Up @@ -1933,6 +1943,276 @@
"rotation": {
"vector": [0, 0, 0]
}
},
"waves": {
"position": {
"0.0": {
"vector": [0, 0, 0]
},
"0.64": {
"vector": [0, 4, 0],
"easing": "easeOutBack",
"easingArgs": [2]
},
"0.76": {
"vector": [0, 0, 0]
},
"1.4": {
"vector": [0, 4, 0],
"easing": "easeOutBack",
"easingArgs": [2]
},
"1.52": {
"vector": [0, 0, 0]
},
"2.16": {
"vector": [0, 4, 0],
"easing": "easeOutBack",
"easingArgs": [2]
},
"2.28": {
"vector": [0, 0, 0]
},
"2.92": {
"vector": [0, 4, 0],
"easing": "easeOutBack",
"easingArgs": [2]
}
}
},
"wave1": {
"position": {
"0.0": {
"vector": [0, 0, 0]
},
"0.72": {
"vector": [0, 0, 7],
"easing": "easeOutBack"
},
"0.76": {
"vector": [0, 0, 0]
},
"1.48": {
"vector": [0, 0, 7],
"easing": "easeOutBack"
},
"1.52": {
"vector": [0, 0, 0]
},
"2.24": {
"vector": [0, 0, 7],
"easing": "easeOutBack"
},
"2.28": {
"vector": [0, 0, 0]
},
"3.0": {
"vector": [0, 0, 7],
"easing": "easeOutBack"
}
},
"scale": {
"0.0": {
"vector": [0, 0, 0]
},
"0.28": {
"vector": [1, 1, 1],
"easing": "easeOutBack"
},
"0.72": {
"vector": [0, 0, 0],
"easing": "easeOutBack"
},
"0.76": {
"vector": [0, 0, 0]
},
"1.04": {
"vector": [1, 1, 1],
"easing": "easeOutBack"
},
"1.48": {
"vector": [0, 0, 0],
"easing": "easeOutBack"
},
"1.52": {
"vector": [0, 0, 0]
},
"1.8": {
"vector": [1, 1, 1],
"easing": "easeOutBack"
},
"2.24": {
"vector": [0, 0, 0],
"easing": "easeOutBack"
},
"2.28": {
"vector": [0, 0, 0]
},
"2.56": {
"vector": [1, 1, 1],
"easing": "easeOutBack"
},
"3.0": {
"vector": [0, 0, 0],
"easing": "easeOutBack"
}
}
},
"wave2": {
"position": {
"0.0": {
"vector": [0, 0, 0]
},
"0.72": {
"vector": [0, 0, 14],
"easing": "easeOutBack"
},
"0.76": {
"vector": [0, 0, 0]
},
"1.48": {
"vector": [0, 0, 14],
"easing": "easeOutBack"
},
"1.52": {
"vector": [0, 0, 0]
},
"2.24": {
"vector": [0, 0, 14],
"easing": "easeOutBack"
},
"2.28": {
"vector": [0, 0, 0]
},
"3.0": {
"vector": [0, 0, 14],
"easing": "easeOutBack"
}
},
"scale": {
"0.0": {
"vector": [0, 0, 0]
},
"0.4": {
"vector": [1, 1, 1],
"easing": "easeOutBack"
},
"0.72": {
"vector": [0, 0, 0],
"easing": "easeOutBack"
},
"0.76": {
"vector": [0, 0, 0]
},
"1.16": {
"vector": [1, 1, 1],
"easing": "easeOutBack"
},
"1.48": {
"vector": [0, 0, 0],
"easing": "easeOutBack"
},
"1.52": {
"vector": [0, 0, 0]
},
"1.92": {
"vector": [1, 1, 1],
"easing": "easeOutBack"
},
"2.24": {
"vector": [0, 0, 0],
"easing": "easeOutBack"
},
"2.28": {
"vector": [0, 0, 0]
},
"2.68": {
"vector": [1, 1, 1],
"easing": "easeOutBack"
},
"3.0": {
"vector": [0, 0, 0],
"easing": "easeOutBack"
}
}
},
"wave3": {
"position": {
"0.0": {
"vector": [0, 0, 0]
},
"0.72": {
"vector": [0, 0, 20],
"easing": "easeOutBack"
},
"0.76": {
"vector": [0, 0, 0]
},
"1.48": {
"vector": [0, 0, 20],
"easing": "easeOutBack"
},
"1.52": {
"vector": [0, 0, 0]
},
"2.24": {
"vector": [0, 0, 20],
"easing": "easeOutBack"
},
"2.28": {
"vector": [0, 0, 0]
},
"3.0": {
"vector": [0, 0, 20],
"easing": "easeOutBack"
}
},
"scale": {
"0.0": {
"vector": [0, 0, 0]
},
"0.52": {
"vector": [1, 1, 1],
"easing": "easeOutBack"
},
"0.72": {
"vector": [0, 0, 0],
"easing": "easeOutBack"
},
"0.76": {
"vector": [0, 0, 0]
},
"1.28": {
"vector": [1, 1, 1],
"easing": "easeOutBack"
},
"1.48": {
"vector": [0, 0, 0],
"easing": "easeOutBack"
},
"1.52": {
"vector": [0, 0, 0]
},
"2.0": {
"vector": [1, 1, 1],
"easing": "easeOutBack"
},
"2.24": {
"vector": [0, 0, 0],
"easing": "easeOutBack"
},
"2.28": {
"vector": [0, 0, 0]
},
"2.8": {
"vector": [1, 1, 1],
"easing": "easeOutBack"
},
"3.0": {
"vector": [0, 0, 0],
"easing": "easeOutBack"
}
}
}
}
},
Expand Down Expand Up @@ -2024,6 +2304,11 @@
"position": {
"vector": [0, -5, 0]
}
},
"waves": {
"scale": {
"vector": [0, 0, 0]
}
}
}
}
Expand Down
Loading

0 comments on commit 55c659b

Please sign in to comment.