mirror of
https://github.com/overte-org/overte.git
synced 2025-04-15 03:47:56 +02:00
add inspect avatars
This commit is contained in:
parent
563be9ab91
commit
7101a37bf9
1 changed files with 7 additions and 9 deletions
|
@ -56,7 +56,6 @@ var mode = noMode;
|
||||||
var mouseLastX = 0;
|
var mouseLastX = 0;
|
||||||
var mouseLastY = 0;
|
var mouseLastY = 0;
|
||||||
|
|
||||||
|
|
||||||
var center = {
|
var center = {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0,
|
||||||
|
@ -259,16 +258,16 @@ function mousePressEvent(event) {
|
||||||
// Compute trajectories related values
|
// Compute trajectories related values
|
||||||
var pickRay = Camera.computePickRay(mouseLastX, mouseLastY);
|
var pickRay = Camera.computePickRay(mouseLastX, mouseLastY);
|
||||||
var modelIntersection = Entities.findRayIntersection(pickRay, true);
|
var modelIntersection = Entities.findRayIntersection(pickRay, true);
|
||||||
|
var avatarIntersection = AvatarList.findRayIntersection(pickRay);
|
||||||
|
|
||||||
position = Camera.getPosition();
|
position = Camera.getPosition();
|
||||||
|
|
||||||
var distance = -1;
|
if (avatarIntersection.intersects || (modelIntersection.intersects && modelIntersection.accurate)) {
|
||||||
var string = "";
|
if (avatarIntersection.intersects) {
|
||||||
|
center = avatarIntersection.intersection;
|
||||||
if (modelIntersection.intersects && modelIntersection.accurate) {
|
} else {
|
||||||
distance = modelIntersection.distance;
|
center = modelIntersection.intersection;
|
||||||
center = modelIntersection.intersection;
|
}
|
||||||
string = "Inspecting model";
|
|
||||||
// We've selected our target, now orbit towards it automatically
|
// We've selected our target, now orbit towards it automatically
|
||||||
rotatingTowardsTarget = true;
|
rotatingTowardsTarget = true;
|
||||||
// calculate our target cam rotation
|
// calculate our target cam rotation
|
||||||
|
@ -284,7 +283,6 @@ function mousePressEvent(event) {
|
||||||
|
|
||||||
isActive = true;
|
isActive = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue