mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 20:36:38 +02:00
re-did tablet position
This commit is contained in:
parent
20a84e7288
commit
19c6a672d9
1 changed files with 6 additions and 18 deletions
|
@ -22,25 +22,13 @@ var TABLET_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/Tablet-Model-v1-
|
|||
// * position - position in front of the user
|
||||
// * rotation - rotation of entity so it faces the user.
|
||||
function calcSpawnInfo(hand) {
|
||||
var pitchBackRotation = Quat.angleAxis(20.0, X_AXIS);
|
||||
if (HMD.active) {
|
||||
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: Vec3.sum(Vec3.sum(MyAvatar.position, Vec3.multiply(0.6, front)), {x: 0, y: 0.6, z: 0}),
|
||||
rotation: Quat.multiply(MyAvatar.orientation, pitchBackRotation)
|
||||
position: finalPosition,
|
||||
rotation: Quat.lookAt(finalPosition, MyAvatar.getHeadPosition(), Y_AXIS)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// ctor
|
||||
WebTablet = function (url, width, dpi, hand, clientOnly) {
|
||||
|
|
Loading…
Reference in a new issue