mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 10:07:58 +02:00
Add support for teleportToEntity
Add support for teleportToEntity
This commit is contained in:
parent
9004251bcf
commit
3241ea7c1f
1 changed files with 10 additions and 0 deletions
|
@ -636,6 +636,16 @@ SelectionManager = (function() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
that.teleportToEntity = function() {
|
||||||
|
if (SelectionManager.hasSelection()) {
|
||||||
|
var distanceFromTarget = 3 + Math.max(Math.max(SelectionManager.worldDimensions.x, SelectionManager.worldDimensions.y), SelectionManager.worldDimensions.z);
|
||||||
|
var teleportTargetPosition = Vec3.sum(SelectionManager.worldPosition, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: distanceFromTarget }));
|
||||||
|
MyAvatar.goToLocation(teleportTargetPosition, false);
|
||||||
|
} else {
|
||||||
|
audioFeedback.rejection();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue