Simplify applied transformations in scripts.

This commit is contained in:
Zander Otavka 2015-08-07 11:51:22 -07:00
parent 743e73874f
commit 987fb56124
2 changed files with 3 additions and 7 deletions

View file

@ -24,8 +24,7 @@ var ADDRESS_BAR_IMAGE_URL = HIFI_PUBLIC_BUCKET + "images/tools/address-bar-toggl
var panel = new OverlayPanel({ var panel = new OverlayPanel({
anchorPositionBinding: { avatar: "MyAvatar" }, anchorPositionBinding: { avatar: "MyAvatar" },
offsetPosition: { x: 0, y: 0.4, z: 1 }, offsetPosition: { x: 0, y: 0.4, z: -1 },
offsetRotation: { w: 0, x: 0, y: 1, z: 0 },
visible: false visible: false
}); });
@ -210,7 +209,7 @@ function onMouseUp(event) {
if (event.isRightButton && mouseDown.maxDistance < 10) { if (event.isRightButton && mouseDown.maxDistance < 10) {
panel.setProperties({ panel.setProperties({
visible: !panel.visible, visible: !panel.visible,
anchorRotation: Quat.multiply(MyAvatar.orientation, { x: 0, y: 1, z: 0, w: 0 }) anchorRotation: MyAvatar.orientation
}); });
} }

View file

@ -20,10 +20,7 @@ var BLUE_SQUARE_IMAGE_URL = HIFI_PUBLIC_BUCKET + "images/blue-square.svg";
var mainPanel = new OverlayPanel({ var mainPanel = new OverlayPanel({
anchorPositionBinding: { avatar: "MyAvatar" }, anchorPositionBinding: { avatar: "MyAvatar" },
anchorPosition: { x: 0, y: 0, z: 0 }, offsetPosition: { x: 0, y: 0.4, z: -1 },
anchorRotation: { w: 1, x: 0, y: 0, z: 0 },
offsetPosition: { x: 0, y: 0.4, z: 1 },
offsetRotation: { w: 0, x: 0, y: 1, z: 0 },
isFacingAvatar: false isFacingAvatar: false
}); });