Showing the changes to scripts/system/controllers/controllerModules (1 of 1 file). Show all
Unified · Split
| @@ -22,7 +22,6 @@ Script.include("/~/system/libraries/controllers.js"); · 21 unmodified lines | ||
| 22 | 22 | (function() { // BEGIN LOCAL_SCOPE |
| 23 | 23 | |
| 24 | 24 | var TARGET_MODEL_URL = Script.resolvePath("../../assets/models/teleport-destination.fbx"); |
| 25 | − var TOO_CLOSE_MODEL_URL = Script.resolvePath("../../assets/models/teleport-cancel.fbx"); | |
| 26 | 25 | var SEAT_MODEL_URL = Script.resolvePath("../../assets/models/teleport-seat.fbx"); |
| 27 | 26 | |
| 28 | 27 | var TARGET_MODEL_DIMENSIONS = { |
| @@ -49,8 +48,6 @@ Script.include("/~/system/libraries/controllers.js"); · 20 unmodified lines | ||
| 49 | 48 | blue: 73 |
| 50 | 49 | }; |
| 51 | 50 | |
| 52 | − var COOL_IN_DURATION = 300; | |
| 53 | − | |
| 54 | 51 | var handInfo = { |
| 55 | 52 | right: { |
| 56 | 53 | controllerInput: Controller.Standard.RightHand |
| @@ -61,37 +58,19 @@ Script.include("/~/system/libraries/controllers.js"); · 4 unmodified lines | ||
| 61 | 58 | }; |
| 62 | 59 | |
| 63 | 60 | var cancelPath = { |
| 64 | − type: "line3d", | |
| 65 | 61 | color: COLORS_TELEPORT_CANCEL, |
| 66 | − ignorePickIntersection: true, | |
| 67 | 62 | alpha: 1, |
| 68 | − solid: true, | |
| 69 | − drawInFront: true, | |
| 70 | − glow: 1.0 | |
| 63 | + width: 0.025 | |
| 71 | 64 | }; |
| 72 | 65 | var teleportPath = { |
| 73 | − type: "line3d", | |
| 74 | 66 | color: COLORS_TELEPORT_CAN_TELEPORT, |
| 75 | − ignorePickIntersection: true, | |
| 76 | 67 | alpha: 1, |
| 77 | − solid: true, | |
| 78 | − drawInFront: true, | |
| 79 | − glow: 1.0 | |
| 68 | + width: 0.025 | |
| 80 | 69 | }; |
| 81 | 70 | var seatPath = { |
| 82 | − type: "line3d", | |
| 83 | 71 | color: COLORS_TELEPORT_SEAT, |
| 84 | − ignorePickIntersection: true, | |
| 85 | 72 | alpha: 1, |
| 86 | − solid: true, | |
| 87 | − drawInFront: true, | |
| 88 | − glow: 1.0 | |
| 89 | − }; | |
| 90 | − var cancelEnd = { | |
| 91 | − type: "model", | |
| 92 | − url: TOO_CLOSE_MODEL_URL, | |
| 93 | − dimensions: TARGET_MODEL_DIMENSIONS, | |
| 94 | − ignorePickIntersection: true | |
| 73 | + width: 0.025 | |
| 95 | 74 | }; |
| 96 | 75 | var teleportEnd = { |
| 97 | 76 | type: "model", |
| @@ -107,20 +86,18 @@ Script.include("/~/system/libraries/controllers.js"); · 9 unmodified lines | ||
| 107 | 86 | }; |
| 108 | 87 | |
| 109 | 88 | |
| 110 | − var teleportRenderStates = [{name: "cancel", path: cancelPath, end: cancelEnd}, | |
| 89 | + var teleportRenderStates = [{name: "cancel", path: cancelPath}, | |
| 111 | 90 | {name: "teleport", path: teleportPath, end: teleportEnd}, |
| 112 | 91 | {name: "seat", path: seatPath, end: seatEnd}]; |
| 113 | 92 | |
| 114 | − var DEFAULT_DISTANCE = 50; | |
| 93 | + var DEFAULT_DISTANCE = 8.0; | |
| 115 | 94 | var teleportDefaultRenderStates = [{name: "cancel", distance: DEFAULT_DISTANCE, path: cancelPath}]; |
| 116 | 95 | |
| 117 | − var coolInTimeout = null; | |
| 118 | 96 | var ignoredEntities = []; |
| 119 | 97 | |
| 120 | 98 | |
| 121 | 99 | var TELEPORTER_STATES = { |
| 122 | 100 | IDLE: 'idle', |
| 123 | − COOL_IN: 'cool_in', | |
| 124 | 101 | TARGETTING: 'targetting', |
| 125 | 102 | TARGETTING_INVALID: 'targetting_invalid' |
| 126 | 103 | }; |
| @@ -133,7 +110,7 @@ Script.include("/~/system/libraries/controllers.js"); · 6 unmodified lines | ||
| 133 | 110 | SEAT: 'seat' // The current target is a seat |
| 134 | 111 | }; |
| 135 | 112 | |
| 136 | − var speed = 7.0; | |
| 113 | + var speed = 12.0; | |
| 137 | 114 | var accelerationAxis = {x: 0.0, y: -5.0, z: 0.0}; |
| 138 | 115 | |
| 139 | 116 | function Teleporter(hand) { |
| @@ -151,8 +128,10 @@ Script.include("/~/system/libraries/controllers.js"); · 11 unmodified lines | ||
| 151 | 128 | return otherModule; |
| 152 | 129 | }; |
| 153 | 130 | |
| 154 | − this.teleportParabolaHandVisible = Pointers.createPointer(PickType.Ray, { | |
| 131 | + this.teleportParabolaHandVisible = Pointers.createPointer(PickType.Parabola, { | |
| 155 | 132 | joint: (_this.hand === RIGHT_HAND) ? "_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND" : "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND", |
| 133 | + dirOffset: { x: 0, y: 1, z: 0.1 }, | |
| 134 | + posOffset: { x: (_this.hand === RIGHT_HAND) ? 0.03 : -0.03, y: 0.2, z: 0.02 }, | |
| 156 | 135 | filter: Picks.PICK_ENTITIES, |
| 157 | 136 | faceAvatar: true, |
| 158 | 137 | scaleWithAvatar: true, |
| @@ -161,10 +140,13 @@ Script.include("/~/system/libraries/controllers.js"); · 2 unmodified lines | ||
| 161 | 140 | accelerationAxis: accelerationAxis, |
| 162 | 141 | rotateAccelerationWithAvatar: true, |
| 163 | 142 | renderStates: teleportRenderStates, |
| 164 | − defaultRenderStates: teleportDefaultRenderStates | |
| 143 | + defaultRenderStates: teleportDefaultRenderStates, | |
| 144 | + maxDistance: 8.0 | |
| 165 | 145 | }); |
| 166 | − this.teleportParabolaHandInvisible = Pointers.createPointer(PickType.Ray, { | |
| 146 | + this.teleportParabolaHandInvisible = Pointers.createPointer(PickType.Parabola, { | |
| 167 | 147 | joint: (_this.hand === RIGHT_HAND) ? "_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND" : "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND", |
| 148 | + dirOffset: { x: 0, y: 1, z: 0.1 }, | |
| 149 | + posOffset: { x: (_this.hand === RIGHT_HAND) ? 0.03 : -0.03, y: 0.2, z: 0.02 }, | |
| 168 | 150 | filter: Picks.PICK_ENTITIES | Picks.PICK_INCLUDE_INVISIBLE, |
| 169 | 151 | faceAvatar: true, |
| 170 | 152 | scaleWithAvatar: true, |
| @@ -172,9 +154,10 @@ Script.include("/~/system/libraries/controllers.js"); · 1 unmodified line | ||
| 172 | 154 | speed: speed, |
| 173 | 155 | accelerationAxis: accelerationAxis, |
| 174 | 156 | rotateAccelerationWithAvatar: true, |
| 175 | − renderStates: teleportRenderStates | |
| 157 | + renderStates: teleportRenderStates, | |
| 158 | + maxDistance: 8.0 | |
| 176 | 159 | }); |
| 177 | − this.teleportParabolaHeadVisible = Pointers.createPointer(PickType.Ray, { | |
| 160 | + this.teleportParabolaHeadVisible = Pointers.createPointer(PickType.Parabola, { | |
| 178 | 161 | joint: "Avatar", |
| 179 | 162 | filter: Picks.PICK_ENTITIES, |
| 180 | 163 | faceAvatar: true, |
| @@ -184,9 +167,10 @@ Script.include("/~/system/libraries/controllers.js"); · 3 unmodified lines | ||
| 184 | 167 | accelerationAxis: accelerationAxis, |
| 185 | 168 | rotateAccelerationWithAvatar: true, |
| 186 | 169 | renderStates: teleportRenderStates, |
| 187 | − defaultRenderStates: teleportDefaultRenderStates | |
| 170 | + defaultRenderStates: teleportDefaultRenderStates, | |
| 171 | + maxDistance: 8.0 | |
| 188 | 172 | }); |
| 189 | − this.teleportParabolaHeadInvisible = Pointers.createPointer(PickType.Ray, { | |
| 173 | + this.teleportParabolaHeadInvisible = Pointers.createPointer(PickType.Parabola, { | |
| 190 | 174 | joint: "Avatar", |
| 191 | 175 | filter: Picks.PICK_ENTITIES | Picks.PICK_INCLUDE_INVISIBLE, |
| 192 | 176 | faceAvatar: true, |
| @@ -195,7 +179,8 @@ Script.include("/~/system/libraries/controllers.js"); · 2 unmodified lines | ||
| 195 | 179 | speed: speed, |
| 196 | 180 | accelerationAxis: accelerationAxis, |
| 197 | 181 | rotateAccelerationWithAvatar: true, |
| 198 | − renderStates: teleportRenderStates | |
| 182 | + renderStates: teleportRenderStates, | |
| 183 | + maxDistance: 8.0 | |
| 199 | 184 | }); |
| 200 | 185 | |
| 201 | 186 | this.cleanup = function() { |
| @@ -216,16 +201,7 @@ Script.include("/~/system/libraries/controllers.js"); · 14 unmodified lines | ||
| 216 | 201 | 100); |
| 217 | 202 | |
| 218 | 203 | this.enterTeleport = function() { |
| 219 | − if (coolInTimeout !== null) { | |
| 220 | − Script.clearTimeout(coolInTimeout); | |
| 221 | − } | |
| 222 | − | |
| 223 | − this.state = TELEPORTER_STATES.COOL_IN; | |
| 224 | − coolInTimeout = Script.setTimeout(function() { | |
| 225 | − if (_this.state === TELEPORTER_STATES.COOL_IN) { | |
| 226 | − _this.state = TELEPORTER_STATES.TARGETTING; | |
| 227 | − } | |
| 228 | − }, COOL_IN_DURATION); | |
| 204 | + this.state = TELEPORTER_STATES.TARGETTING; | |
| 229 | 205 | }; |
| 230 | 206 | |
| 231 | 207 | this.isReady = function(controllerData, deltaTime) { |
| @@ -287,11 +263,7 @@ Script.include("/~/system/libraries/controllers.js"); · 55 unmodified lines | ||
| 287 | 263 | } else if (teleportLocationType === TARGET.INVALID || teleportLocationType === TARGET.INVISIBLE) { |
| 288 | 264 | this.setTeleportState(mode, "", "cancel"); |
| 289 | 265 | } else if (teleportLocationType === TARGET.SURFACE) { |
| 290 | − if (this.state === TELEPORTER_STATES.COOL_IN) { | |
| 291 | − this.setTeleportState(mode, "cancel", ""); | |
| 292 | − } else { | |
| 293 | − this.setTeleportState(mode, "teleport", ""); | |
| 294 | − } | |
| 266 | + this.setTeleportState(mode, "teleport", ""); | |
| 295 | 267 | } else if (teleportLocationType === TARGET.SEAT) { |
| 296 | 268 | this.setTeleportState(mode, "", "seat"); |
| 297 | 269 | } |
| @@ -304,7 +276,7 @@ Script.include("/~/system/libraries/controllers.js"); · 6 unmodified lines | ||
| 304 | 276 | return makeRunningValues(true, [], []); |
| 305 | 277 | } |
| 306 | 278 | |
| 307 | − if (target === TARGET.NONE || target === TARGET.INVALID || this.state === TELEPORTER_STATES.COOL_IN) { | |
| 279 | + if (target === TARGET.NONE || target === TARGET.INVALID) { | |
| 308 | 280 | // Do nothing |
| 309 | 281 | } else if (target === TARGET.SEAT) { |
| 310 | 282 | Entities.callEntityMethod(result.objectID, 'sit'); |