From d0ba53a06910727d828bce19100567aa719c03e6 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 4 Oct 2016 20:22:22 -0700 Subject: [PATCH] Change name of isTooCloseToTeleport to be more descriptive --- scripts/system/controllers/teleport.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/system/controllers/teleport.js b/scripts/system/controllers/teleport.js index 6d13b41d4f..2a7dbb000b 100644 --- a/scripts/system/controllers/teleport.js +++ b/scripts/system/controllers/teleport.js @@ -459,7 +459,7 @@ function Teleporter() { z: intersection.intersection.z }; - this.tooClose = isTooCloseToTeleport(position, intersection.surfaceNormal); + this.tooClose = isValidTeleportLocation(position, intersection.surfaceNormal); var towardUs = Quat.fromPitchYawRollDegrees(0, euler.y, 0); Overlays.editOverlay(this.targetOverlay, { @@ -480,7 +480,7 @@ function Teleporter() { z: intersection.intersection.z }; - this.tooClose = isTooCloseToTeleport(position, intersection.surfaceNormal); + this.tooClose = isValidTeleportLocation(position, intersection.surfaceNormal); var towardUs = Quat.fromPitchYawRollDegrees(0, euler.y, 0); Overlays.editOverlay(this.cancelOverlay, { @@ -637,7 +637,7 @@ function isMoving() { // than MAX_ANGLE_FROM_UP_TO_TELEPORT degrees from <0, 1, 0> (straight up), then // you can't teleport there. var MAX_ANGLE_FROM_UP_TO_TELEPORT = 70; -function isTooCloseToTeleport(position, surfaceNormal) { +function isValidTeleportLocation(position, surfaceNormal) { var adj = Math.sqrt(surfaceNormal.x * surfaceNormal.x + surfaceNormal.z * surfaceNormal.z); var angleUp = Math.atan2(surfaceNormal.y, adj) * (180 / Math.PI); return angleUp < (90 - MAX_ANGLE_FROM_UP_TO_TELEPORT) ||