mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Decrease offset for teleport pad. Add Bubble orientation and scale correction.
This commit is contained in:
parent
fde5e14c04
commit
10e29d1cf0
2 changed files with 25 additions and 17 deletions
|
@ -148,9 +148,8 @@ void LaserPointer::updateRenderState(const RenderState& renderState, const Inter
|
||||||
endProps.insert("position", end);
|
endProps.insert("position", end);
|
||||||
} else {
|
} else {
|
||||||
glm::vec3 dim = vec3FromVariant(qApp->getOverlays().getProperty(renderState.getEndID(), "dimensions").value);
|
glm::vec3 dim = vec3FromVariant(qApp->getOverlays().getProperty(renderState.getEndID(), "dimensions").value);
|
||||||
//endProps.insert("position", vec3toVariant(endVec + glm::vec3(0, 0.5f * dim.y, 0)));
|
|
||||||
glm::vec3 currentUpVector = faceAvatarRotation * Vectors::UP;
|
glm::vec3 currentUpVector = faceAvatarRotation * Vectors::UP;
|
||||||
endProps.insert("position", vec3toVariant(endVec + glm::vec3(currentUpVector.x * 0.5f * dim.x, currentUpVector.y * 0.5f * dim.y, currentUpVector.z * 0.5f * dim.z)));
|
endProps.insert("position", vec3toVariant(endVec + glm::vec3(currentUpVector.x * 0.25f * dim.x, currentUpVector.y * 0.25f * dim.y, currentUpVector.z * 0.25f * dim.z)));
|
||||||
}
|
}
|
||||||
if (_faceAvatar) {
|
if (_faceAvatar) {
|
||||||
endProps.insert("rotation", quatToVariant(faceAvatarRotation));
|
endProps.insert("rotation", quatToVariant(faceAvatarRotation));
|
||||||
|
|
|
@ -27,8 +27,9 @@
|
||||||
url: Script.resolvePath("assets/models/Bubble-v14.fbx"), // If you'd like to change the model, modify this line (and the dimensions below)
|
url: Script.resolvePath("assets/models/Bubble-v14.fbx"), // If you'd like to change the model, modify this line (and the dimensions below)
|
||||||
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),
|
||||||
scale: { x: 2, y: MyAvatar.scale * 0.5 + 0.5, z: 2 },
|
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.5*MyAvatar.sensorToWorldScale, z: 2*MyAvatar.sensorToWorldScale },
|
||||||
visible: false,
|
visible: false,
|
||||||
ignoreRayIntersection: true
|
ignoreRayIntersection: true
|
||||||
});
|
});
|
||||||
|
@ -62,9 +63,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
Overlays.editOverlay(bubbleOverlay, {
|
Overlays.editOverlay(bubbleOverlay, {
|
||||||
position: { x: MyAvatar.position.x, y: -MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE, z: MyAvatar.position.z },
|
position: {
|
||||||
rotation: Quat.fromPitchYawRollDegrees(MyAvatar.bodyPitch, 0, MyAvatar.bodyRoll),
|
x: MyAvatar.position.x,
|
||||||
scale: { x: 2, y: MyAvatar.scale * 0.5 + 0.5, z: 2 },
|
y: -MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE,
|
||||||
|
z: MyAvatar.position.z
|
||||||
|
},
|
||||||
|
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.5 * MyAvatar.sensorToWorldScale,
|
||||||
|
z: 2 * MyAvatar.sensorToWorldScale
|
||||||
|
},
|
||||||
visible: true
|
visible: true
|
||||||
});
|
});
|
||||||
bubbleOverlayTimestamp = Date.now();
|
bubbleOverlayTimestamp = Date.now();
|
||||||
|
@ -105,11 +114,11 @@
|
||||||
y: (-((BUBBLE_RAISE_ANIMATION_DURATION_MS - delay) / BUBBLE_RAISE_ANIMATION_DURATION_MS)) * MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE,
|
y: (-((BUBBLE_RAISE_ANIMATION_DURATION_MS - delay) / BUBBLE_RAISE_ANIMATION_DURATION_MS)) * MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE,
|
||||||
z: MyAvatar.position.z
|
z: MyAvatar.position.z
|
||||||
},
|
},
|
||||||
rotation: Quat.fromPitchYawRollDegrees(MyAvatar.bodyPitch, 0, MyAvatar.bodyRoll),
|
rotation: Quat.multiply(MyAvatar.orientation, Quat.fromVec3Degrees({x: 0.0, y: 180.0, z: 0.0})),
|
||||||
scale: {
|
scale: {
|
||||||
x: 2,
|
x: 2 * MyAvatar.sensorToWorldScale,
|
||||||
y: ((1 - ((BUBBLE_RAISE_ANIMATION_DURATION_MS - delay) / BUBBLE_RAISE_ANIMATION_DURATION_MS)) * MyAvatar.scale * 0.5 + 0.5),
|
y: ((1 - ((BUBBLE_RAISE_ANIMATION_DURATION_MS - delay) / BUBBLE_RAISE_ANIMATION_DURATION_MS)) * MyAvatar.scale * 0.5 + 0.5 * MyAvatar.sensorToWorldScale),
|
||||||
z: 2
|
z: 2 * MyAvatar.sensorToWorldScale
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -120,11 +129,11 @@
|
||||||
y: MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE,
|
y: MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE,
|
||||||
z: MyAvatar.position.z
|
z: MyAvatar.position.z
|
||||||
},
|
},
|
||||||
rotation: Quat.fromPitchYawRollDegrees(MyAvatar.bodyPitch, 0, MyAvatar.bodyRoll),
|
rotation: Quat.multiply(MyAvatar.orientation, Quat.fromVec3Degrees({x: 0.0, y: 180.0, z: 0.0})),
|
||||||
scale: {
|
scale: {
|
||||||
x: 2,
|
x: 2 * MyAvatar.sensorToWorldScale,
|
||||||
y: MyAvatar.scale * 0.5 + 0.5,
|
y: MyAvatar.scale * 0.5 + 0.5 * MyAvatar.sensorToWorldScale,
|
||||||
z: 2
|
z: 2 * MyAvatar.sensorToWorldScale
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue