Class CameraShake
java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.camera.CameraShake
Shakes the camera: an explosion nearby, a giant's footstep. Shakes add up, fade over their
own time, and follow the game's "Distortion Effects" accessibility slider, so a player who turned that down gets
less of them, and none at zero.
CameraShake.shake(1.5F, 12); // a short jolt, wherever the player is
CameraShake.shake(blastPos, 24.0F, 4.0F, 20); // strong at the blast, nothing 24 blocks away
CameraShake.add(new CameraShake.Shake(Curve.of(0.0F, 2.0F, 0.0F), 60, 0.8F, null, 0.0F)); // a slow swell
From the server, ShakeControl does the same for players in range.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic voidadd(CameraShake.Shake shake) static voidclear()Stops every shake at once, e.g.static floatscale()static voidsetScale(float scale) Scales every shake, on top of the player's own accessibility setting: for a mod's own "screen shake" option.static voidshake(float degrees, int ticks) A jolt that starts at full strength and dies away, felt wherever the player is.static voidshake(net.minecraft.world.phys.Vec3 origin, float radius, float degrees, int ticks) A jolt from a place: full strength there, fading to nothingradiusblocks away.
-
Method Details
-
shake
public static void shake(float degrees, int ticks) A jolt that starts at full strength and dies away, felt wherever the player is. -
shake
public static void shake(net.minecraft.world.phys.Vec3 origin, float radius, float degrees, int ticks) A jolt from a place: full strength there, fading to nothingradiusblocks away. -
add
-
clear
public static void clear()Stops every shake at once, e.g. for a cutscene. -
setScale
public static void setScale(float scale) Scales every shake, on top of the player's own accessibility setting: for a mod's own "screen shake" option. 1 by default. -
scale
public static float scale()
-