Fix sit YAW to be relative to table

This commit is contained in:
nak 2026-03-19 03:39:16 +00:00
parent 4a2f8387c0
commit 86a866ee5d
2 changed files with 4 additions and 1 deletions

View file

@ -78,6 +78,7 @@
position: tablePos,
rotation: tableRot,
naturalDimensions: true,
registrationPoint: { x: 0.5, y: 0, z: 0.5 },
userData: JSON.stringify({
pokerID: pokerID,
seatCount: seatCount,

View file

@ -47,7 +47,9 @@
}
function getSeatRotation() {
return Quat.fromPitchYawRollDegrees(0, _seatData.yaw, 0);
var tableProps = Entities.getEntityProperties(_tableID, ["rotation"]);
var tableYaw = Quat.safeEulerAngles(tableProps.rotation).y;
return Quat.fromPitchYawRollDegrees(0, tableYaw + _seatData.yaw, 0);
}
function notify(msg) {