Refactoring.

This commit is contained in:
Daniela 2017-09-08 17:56:11 +01:00
parent 758f049f30
commit 08688dc9ed

View file

@ -28,7 +28,7 @@
dimensions: { x: 1.0, y: 0.75, z: 1.0 }, dimensions: { x: 1.0, y: 0.75, z: 1.0 },
position: { x: MyAvatar.position.x, y: -MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE, z: MyAvatar.position.z }, position: { x: MyAvatar.position.x, y: -MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE, z: MyAvatar.position.z },
//rotation: Quat.fromPitchYawRollDegrees(MyAvatar.bodyPitch, 0, MyAvatar.bodyRoll), //rotation: Quat.fromPitchYawRollDegrees(MyAvatar.bodyPitch, 0, MyAvatar.bodyRoll),
rotation: Quat.multiply(MyAvatar.orientation, Quat.fromVec3Degrees({x: 0.0, y: 180.0, z: 0.0})), rotation: Quat.multiply(MyAvatar.orientation, Quat.fromVec3Degrees({x: 0.0, y: 180.0, z: 0.0})),
scale: { x: 2 * MyAvatar.sensorToWorldScale, y: MyAvatar.scale * 0.5 + 0.2 * MyAvatar.sensorToWorldScale, z: 2 * MyAvatar.sensorToWorldScale }, scale: { x: 2 * MyAvatar.sensorToWorldScale, y: MyAvatar.scale * 0.5 + 0.2 * MyAvatar.sensorToWorldScale, z: 2 * MyAvatar.sensorToWorldScale },
visible: false, visible: false,
ignoreRayIntersection: true ignoreRayIntersection: true
@ -64,16 +64,16 @@
Overlays.editOverlay(bubbleOverlay, { Overlays.editOverlay(bubbleOverlay, {
position: { position: {
x: MyAvatar.position.x, x: MyAvatar.position.x,
y: -MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE, y: -MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE,
z: MyAvatar.position.z z: MyAvatar.position.z
}, },
rotation: Quat.multiply(MyAvatar.orientation, Quat.fromVec3Degrees({x: 0.0, y: 180.0, z: 0.0})), rotation: Quat.multiply(MyAvatar.orientation, Quat.fromVec3Degrees({x: 0.0, y: 180.0, z: 0.0})),
scale: { scale: {
x: 2 * MyAvatar.sensorToWorldScale, x: 2 * MyAvatar.sensorToWorldScale,
y: MyAvatar.scale * 0.5 + 0.2 * MyAvatar.sensorToWorldScale, y: MyAvatar.scale * 0.5 + 0.2 * MyAvatar.sensorToWorldScale,
z: 2 * MyAvatar.sensorToWorldScale z: 2 * MyAvatar.sensorToWorldScale
}, },
visible: true visible: true
}); });
bubbleOverlayTimestamp = Date.now(); bubbleOverlayTimestamp = Date.now();
@ -115,7 +115,7 @@
z: MyAvatar.position.z z: MyAvatar.position.z
}, },
rotation: Quat.multiply(MyAvatar.orientation, Quat.fromVec3Degrees({x: 0.0, y: 180.0, z: 0.0})), rotation: Quat.multiply(MyAvatar.orientation, Quat.fromVec3Degrees({x: 0.0, y: 180.0, z: 0.0})),
scale: { scale: {
x: 2 * MyAvatar.sensorToWorldScale, x: 2 * MyAvatar.sensorToWorldScale,
y: ((1 - ((BUBBLE_RAISE_ANIMATION_DURATION_MS - delay) / BUBBLE_RAISE_ANIMATION_DURATION_MS)) * MyAvatar.scale * 0.5 + 0.2 * MyAvatar.sensorToWorldScale), y: ((1 - ((BUBBLE_RAISE_ANIMATION_DURATION_MS - delay) / BUBBLE_RAISE_ANIMATION_DURATION_MS)) * MyAvatar.scale * 0.5 + 0.2 * MyAvatar.sensorToWorldScale),
z: 2 * MyAvatar.sensorToWorldScale z: 2 * MyAvatar.sensorToWorldScale
@ -130,7 +130,7 @@
z: MyAvatar.position.z z: MyAvatar.position.z
}, },
rotation: Quat.multiply(MyAvatar.orientation, Quat.fromVec3Degrees({x: 0.0, y: 180.0, z: 0.0})), rotation: Quat.multiply(MyAvatar.orientation, Quat.fromVec3Degrees({x: 0.0, y: 180.0, z: 0.0})),
scale: { scale: {
x: 2 * MyAvatar.sensorToWorldScale, x: 2 * MyAvatar.sensorToWorldScale,
y: MyAvatar.scale * 0.5 + 0.2 * MyAvatar.sensorToWorldScale, y: MyAvatar.scale * 0.5 + 0.2 * MyAvatar.sensorToWorldScale,
z: 2 * MyAvatar.sensorToWorldScale z: 2 * MyAvatar.sensorToWorldScale