mirror of
https://github.com/lubosz/overte.git
synced 2025-04-25 00:03:16 +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;
|
||||
})();
|
||||
|
||||
|
|
Loading…
Reference in a new issue