mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 06:23:35 +02:00
indentation fix
This commit is contained in:
parent
31e57a0dcd
commit
32938861cd
1 changed files with 17 additions and 23 deletions
|
@ -23,23 +23,23 @@ var TABLET_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/Tablet-Model-v1-
|
|||
// * rotation - rotation of entity so it faces the user.
|
||||
function calcSpawnInfo(hand) {
|
||||
if (HMD.active && hand) {
|
||||
var handController = getControllerWorldLocation(hand, false);
|
||||
var front = Quat.getFront(handController.orientation);
|
||||
var up = Quat.getUp(handController.orientation);
|
||||
var frontOffset = Vec3.sum(handController.position, Vec3.multiply(0.4, up));
|
||||
var finalOffset = Vec3.sum(frontOffset, Vec3.multiply(-0.3, front));
|
||||
return {
|
||||
position: finalOffset,
|
||||
rotation: Quat.lookAt(finalOffset, HMD.position, Y_AXIS)
|
||||
};
|
||||
} else {
|
||||
var front = Quat.getFront(MyAvatar.orientation);
|
||||
var finalPosition = Vec3.sum(Vec3.sum(MyAvatar.position, Vec3.multiply(0.6, front)), {x: 0, y: 0.6, z: 0})
|
||||
return {
|
||||
position: finalPosition,
|
||||
rotation: Quat.lookAt(finalPosition, MyAvatar.getHeadPosition(), Y_AXIS)
|
||||
};
|
||||
}
|
||||
var handController = getControllerWorldLocation(hand, false);
|
||||
var front = Quat.getFront(handController.orientation);
|
||||
var up = Quat.getUp(handController.orientation);
|
||||
var frontOffset = Vec3.sum(handController.position, Vec3.multiply(0.4, up));
|
||||
var finalOffset = Vec3.sum(frontOffset, Vec3.multiply(-0.3, front));
|
||||
return {
|
||||
position: finalOffset,
|
||||
rotation: Quat.lookAt(finalOffset, HMD.position, Y_AXIS)
|
||||
};
|
||||
} else {
|
||||
var front = Quat.getFront(MyAvatar.orientation);
|
||||
var finalPosition = Vec3.sum(Vec3.sum(MyAvatar.position, Vec3.multiply(0.6, front)), {x: 0, y: 0.6, z: 0})
|
||||
return {
|
||||
position: finalPosition,
|
||||
rotation: Quat.lookAt(finalPosition, MyAvatar.getHeadPosition(), Y_AXIS)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// ctor
|
||||
|
@ -97,7 +97,6 @@ WebTablet = function (url, width, dpi, hand, clientOnly) {
|
|||
this.homeButtonEntity = Entities.addEntity({
|
||||
name: "homeButton",
|
||||
type: "Sphere",
|
||||
collisionless: true,
|
||||
localPosition: {x: 0, y: HOME_BUTTON_Y_OFFSET, z: 0},
|
||||
dimensions: {x: 0.05, y: 0.05, z: 0.05},
|
||||
parentID: this.tabletEntityID,
|
||||
|
@ -172,8 +171,3 @@ WebTablet.unpickle = function (string) {
|
|||
tablet.__proto__ = WebTablet.prototype;
|
||||
return tablet;
|
||||
};
|
||||
|
||||
WebTablet.prototype.getPosition = function () {
|
||||
return Overlays.getProperty(this.webOverlayID, "position");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue