Skip to content

Commit 3ba3367

Browse files
leMaikPeregrine05
andcommitted
Fix entity face camera and face target buttons.
Fixes #1162 Co-Authored-By: Peregrine05 <[email protected]>
1 parent 4a36288 commit 3ba3367

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

chunky/src/java/se/llbit/chunky/entity/Poseable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ default void lookAt(Vector3 target) {
5050
dir.sub(face);
5151
dir.normalize();
5252
double headYaw = getPose("head").y;
53-
getPose().set("rotation", Json.of(FastMath.atan2(dir.x, dir.z) + Math.PI - headYaw));
5453
double pitch = Math.asin(dir.y);
55-
getPose().add("head", JsonUtil.vec3ToJson(new Vector3(pitch, headYaw, 0)));
54+
getPose().set("head", JsonUtil.vec3ToJson(new Vector3(pitch, 0, 0)));
55+
getPose().set("all", JsonUtil.vec3ToJson(new Vector3(0, FastMath.atan2(dir.x, dir.z) + Math.PI - headYaw, 0)));
5656
}
5757

5858

0 commit comments

Comments
 (0)