mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 20:16:16 +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,24 +22,12 @@ var TABLET_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/Tablet-Model-v1-
|
||||||
// * position - position in front of the user
|
// * position - position in front of the user
|
||||||
// * rotation - rotation of entity so it faces the user.
|
// * rotation - rotation of entity so it faces the user.
|
||||||
function calcSpawnInfo(hand) {
|
function calcSpawnInfo(hand) {
|
||||||
var pitchBackRotation = Quat.angleAxis(20.0, X_AXIS);
|
var front = Quat.getFront(MyAvatar.orientation);
|
||||||
if (HMD.active) {
|
var finalPosition = Vec3.sum(Vec3.sum(MyAvatar.position, Vec3.multiply(0.6, front)), {x: 0, y: 0.6, z: 0})
|
||||||
var handController = getControllerWorldLocation(hand, false);
|
return {
|
||||||
var front = Quat.getFront(handController.orientation);
|
position: finalPosition,
|
||||||
var up = Quat.getUp(handController.orientation);
|
rotation: Quat.lookAt(finalPosition, MyAvatar.getHeadPosition(), Y_AXIS)
|
||||||
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);
|
|
||||||
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)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ctor
|
// ctor
|
||||||
|
|
Loading…
Reference in a new issue