Fix seat pad height

This commit is contained in:
nak 2026-03-19 05:28:12 +00:00
parent d052c897e6
commit c259168f6f
2 changed files with 9 additions and 4 deletions

View file

@ -60,7 +60,7 @@
// Place table in front of avatar at floor level // Place table in front of avatar at floor level
// Use only the yaw component of avatar rotation so table sits flat // Use only the yaw component of avatar rotation so table sits flat
var yaw = Quat.safeEulerAngles(avatarRotation).y; var yaw = Quat.safeEulerAngles(avatarRotation).y;
var tableRot = Quat.fromPitchYawRollDegrees(0, yaw, 0); var tableRot = Quat.fromPitchYawRollDegrees(0, yaw - 90, 0);
// 2.5m in front of avatar, snapped to floor // 2.5m in front of avatar, snapped to floor
var forward = Vec3.multiplyQbyV(tableRot, { x: 0, y: 0, z: -2.5 }); var forward = Vec3.multiplyQbyV(tableRot, { x: 0, y: 0, z: -2.5 });
@ -97,7 +97,12 @@
// Offsets are in table-local space so no world transform needed // Offsets are in table-local space so no world transform needed
for (var i = 0; i < seatCount; i++) { for (var i = 0; i < seatCount; i++) {
var seat = layout[i]; var seat = layout[i];
var seatRot = Quat.fromPitchYawRollDegrees(0, seat.yaw, 0); var seatRot = Quat.fromPitchYawRollDegrees(-90, seat.yaw, 0);
var seatOffset = {
x: seat.offset.x,
y: seat.offset.y - 0.13,
z: seat.offset.z
};
Entities.addEntity({ Entities.addEntity({
type: "Image", type: "Image",
@ -106,7 +111,7 @@
dimensions: constants.POKER_SEAT_PAD.dimensions, dimensions: constants.POKER_SEAT_PAD.dimensions,
alpha: constants.POKER_SEAT_PAD.alpha, alpha: constants.POKER_SEAT_PAD.alpha,
parentID: tableID, parentID: tableID,
localPosition: seat.offset, localPosition: seatOffset,
localRotation: seatRot, localRotation: seatRot,
script: "https://wizards.cyou/scripts/poker_sit.js", script: "https://wizards.cyou/scripts/poker_sit.js",
userData: JSON.stringify({ userData: JSON.stringify({

View file

@ -23,7 +23,7 @@ module.exports = {
// Seat pad entity appearance // Seat pad entity appearance
POKER_SEAT_PAD: { POKER_SEAT_PAD: {
dimensions: { x: 0.6, y: 0.6, z: 0.01 }, dimensions: { x: 0.4, y: 0.4, z: 0.01 },
imageURL: "https://wizards.cyou/images/sit.png", imageURL: "https://wizards.cyou/images/sit.png",
alpha: 0.7, alpha: 0.7,
}, },