diff --git a/init.lua b/init.lua index 87e38d7..b104881 100644 --- a/init.lua +++ b/init.lua @@ -40,9 +40,11 @@ local ci_assets_traced = false local WALK_ANIMS = {"walk_fwd_lower", "walk_back_lower", "walk_left_lower", "walk_right_lower"} -- Signed angle between two 2D vectors (in degrees, range [-180, 180]). --- Returns the signed angle from v1 to v2, positive = counter-clockwise (left). +-- Sporel uses Y-down screen-coords. Substrate's math assumes Y-up; the cross +-- component is flipped so "positive num = move-direction is CCW from body-fwd +-- in screen-coords" matches substrate's "positive num = walk_left sector". local function signed_angle_2d(v1x, v1y, v2x, v2y) - local cross = v1x * v2y - v1y * v2x + local cross = v1y * v2x - v1x * v2y -- Y-down flip local dot = v1x * v2x + v1y * v2y return math.deg(math.atan(cross, dot)) end diff --git a/rigs/humanoid.rig.json b/rigs/humanoid.rig.json index ce1c8e1..e3ecbd0 100644 --- a/rigs/humanoid.rig.json +++ b/rigs/humanoid.rig.json @@ -5,7 +5,7 @@ { "id": "root", "parent": null, "rest": {"x": 0, "y": 0, "rot": 0}, "z_order": -1 }, { "id": "lower_control", "parent": "root", "rest": {"x": 0, "y": 0, "rot": 0}, "virtual": true }, { "id": "body", "parent": "root", "rest": {"x": 0, "y": 0, "rot": 0}, "z_order": 2, "texture": "body_001", "look_at": "soft", "look_at_slerp": 6 }, - { "id": "head", "parent": "body", "rest": {"x": 0, "y": -3, "rot": 0, "rot_min": -60, "rot_max": 60}, "z_order": 6, "texture": "head_001", "look_at": "aim", "sprite_rot": -90 }, + { "id": "head", "parent": "body", "rest": {"x": 0, "y": -3, "rot": 0, "rot_min": -60, "rot_max": 60}, "z_order": 6, "texture": "head_001", "look_at": "aim" }, { "id": "shoulders", "parent": "body", "rest": {"x": 0, "y": 0, "rot": 0}, "z_order": 5, "texture": "shoulder_001" }, { "id": "upper_arm_l", "parent": "shoulders", "rest": {"x": -19, "y": -3, "rot": 0, "scl": [-1, 1]}, "z_order": 3, "texture": "upper_arm_001" }, { "id": "upper_arm_r", "parent": "shoulders", "rest": {"x": 20, "y": -4, "rot": 0}, "z_order": 3, "texture": "upper_arm_001" },