mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 18:24:17 +02:00
Fix for exception in handControllerGrab.js
Specifically this: [UncaughtException] TypeError: Result of expression 'this.handToController' [undefined] is not a function. in file:///C:/msys64/home/anthony/code/hifi/build/interface/Release/scripts/defaultScripts.js:1388
This commit is contained in:
parent
a170436c8c
commit
0c2ebc27cb
1 changed files with 2 additions and 1 deletions
|
@ -1382,10 +1382,11 @@ function MyController(hand) {
|
|||
this.chooseBestEquipHotspot = function(candidateEntities) {
|
||||
var DISTANCE = 0;
|
||||
var equippableHotspots = this.chooseNearEquipHotspots(candidateEntities, DISTANCE);
|
||||
var _this = this;
|
||||
if (equippableHotspots.length > 0) {
|
||||
// sort by distance
|
||||
equippableHotspots.sort(function(a, b) {
|
||||
var handControllerLocation = getControllerWorldLocation(this.handToController(), true);
|
||||
var handControllerLocation = getControllerWorldLocation(_this.handToController(), true);
|
||||
var aDistance = Vec3.distance(a.worldPosition, handControllerLocation.position);
|
||||
var bDistance = Vec3.distance(b.worldPosition, handControllerLocation.position);
|
||||
return aDistance - bDistance;
|
||||
|
|
Loading…
Reference in a new issue