Fix table spawn Y to floor level
This commit is contained in:
parent
86a866ee5d
commit
c5823c7133
1 changed files with 2 additions and 2 deletions
|
|
@ -62,11 +62,11 @@
|
||||||
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, 0);
|
||||||
|
|
||||||
// 2.5m in front of avatar, snapped to floor (y: -0.45 relative to avatar)
|
// 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 });
|
||||||
var tablePos = {
|
var tablePos = {
|
||||||
x: avatarPosition.x + forward.x,
|
x: avatarPosition.x + forward.x,
|
||||||
y: avatarPosition.y - 0.45,
|
y: -0.45,
|
||||||
z: avatarPosition.z + forward.z,
|
z: avatarPosition.z + forward.z,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue