mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
Only asking for needed props
This commit is contained in:
parent
b9db495ebf
commit
42a2125336
1 changed files with 2 additions and 2 deletions
|
@ -216,12 +216,12 @@ function controller(hand, triggerAction) {
|
|||
this.lineOn(pickRay.origin, Vec3.multiply(pickRay.direction, LINE_LENGTH), NO_INTERSECT_COLOR);
|
||||
}
|
||||
} else {
|
||||
// forward ray test failed, try sphere test.
|
||||
// forward ray test failed, try sphere test.
|
||||
var nearbyEntities = Entities.findEntities(handPosition, GRAB_RADIUS);
|
||||
var minDistance = GRAB_RADIUS;
|
||||
var grabbedEntity = null;
|
||||
for (var i = 0; i < nearbyEntities.length; i++) {
|
||||
var props = Entities.getEntityProperties(nearbyEntities[i]);
|
||||
var props = Entities.getEntityProperties(nearbyEntities[i], ["position", "name", "collisionsWillMove", "locked"]);
|
||||
var distance = Vec3.distance(props.position, handPosition);
|
||||
if (distance < minDistance && props.name !== "pointer") {
|
||||
this.grabbedEntity = nearbyEntities[i];
|
||||
|
|
Loading…
Reference in a new issue