mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 16:58:09 +02:00
Set minimum angular size too model selection
This commit is contained in:
parent
5801ea2011
commit
641b9e8253
1 changed files with 4 additions and 2 deletions
|
@ -34,6 +34,7 @@ var LASER_COLOR = { red: 255, green: 0, blue: 0 };
|
||||||
var LASER_LENGTH_FACTOR = 500
|
var LASER_LENGTH_FACTOR = 500
|
||||||
;
|
;
|
||||||
|
|
||||||
|
var MIN_ANGULAR_SIZE = 2;
|
||||||
var MAX_ANGULAR_SIZE = 45;
|
var MAX_ANGULAR_SIZE = 45;
|
||||||
|
|
||||||
var LEFT = 0;
|
var LEFT = 0;
|
||||||
|
@ -828,8 +829,9 @@ function mousePressEvent(event) {
|
||||||
var X = Vec3.sum(A, Vec3.multiply(B, x));
|
var X = Vec3.sum(A, Vec3.multiply(B, x));
|
||||||
var d = Vec3.length(Vec3.subtract(P, X));
|
var d = Vec3.length(Vec3.subtract(P, X));
|
||||||
|
|
||||||
if (0 < x && x < LASER_LENGTH_FACTOR) {
|
var angularSize = 2 * Math.atan(properties.radius / Vec3.distance(Camera.getPosition(), properties.position)) * 180 / 3.14;
|
||||||
if (2 * Math.atan(properties.radius / Vec3.distance(Camera.getPosition(), properties.position)) * 180 / 3.14 < MAX_ANGULAR_SIZE) {
|
if (0 < x && angularSize > MIN_ANGULAR_SIZE) {
|
||||||
|
if (angularSize < MAX_ANGULAR_SIZE) {
|
||||||
modelSelected = true;
|
modelSelected = true;
|
||||||
selectedModelID = foundModel;
|
selectedModelID = foundModel;
|
||||||
selectedModelProperties = properties;
|
selectedModelProperties = properties;
|
||||||
|
|
Loading…
Reference in a new issue