add inspect avatars

This commit is contained in:
Triplelexx 2018-03-16 20:27:05 +00:00
parent 563be9ab91
commit 7101a37bf9

View file

@ -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;
} }
} }
} }