Permalink
Please sign in to comment.
Showing
with
1,279 additions
and 981 deletions.
- +19 −19 dist/preview release/babylon.core.js
- +930 −828 dist/preview release/babylon.d.ts
- +27 −36 dist/preview release/babylon.js
- +104 −3 dist/preview release/babylon.max.js
- +25 −25 dist/preview release/babylon.noworker.js
- +1 −0 dist/preview release/what's new.md
- +30 −30 src/Cameras/Inputs/babylon.arcrotatecamera.input.gamepad.ts
- +1 −1 src/Cameras/babylon.camera.js
- +14 −13 src/Cameras/babylon.camera.ts
- +25 −24 src/Cameras/babylon.cameraInputsManager.ts
- +101 −0 src/Mesh/babylon.meshBuilder.js
- +1 −0 src/Mesh/babylon.meshBuilder.ts
- +1 −1 src/babylon.node.js
- +0 −1 what's new.md
38
dist/preview release/babylon.core.js
19 additions,
19 deletions
not shown because the diff is too large. Please use a local Git client to view these changes.
1,758
dist/preview release/babylon.d.ts
930 additions,
828 deletions
not shown because the diff is too large. Please use a local Git client to view these changes.
63
dist/preview release/babylon.js
27 additions,
36 deletions
not shown because the diff is too large. Please use a local Git client to view these changes.
107
dist/preview release/babylon.max.js
104 additions,
3 deletions
not shown because the diff is too large. Please use a local Git client to view these changes.
50
dist/preview release/babylon.noworker.js
25 additions,
25 deletions
not shown because the diff is too large. Please use a local Git client to view these changes.
1
dist/preview release/what's new.md
60
src/Cameras/Inputs/babylon.arcrotatecamera.input.gamepad.ts
| @@ -1,73 +1,73 @@ | ||
| -module BABYLON { | ||
| +module BABYLON { | ||
| export class ArcRotateCameraGamepadInput implements ICameraInput<ArcRotateCamera> { | ||
| - camera : ArcRotateCamera; | ||
| - | ||
| + camera: ArcRotateCamera; | ||
| + | ||
| public gamepad: Gamepad; | ||
| - private _gamepads: Gamepads; | ||
| + private _gamepads: Gamepads; | ||
| @serialize() | ||
| public gamepadRotationSensibility = 80; | ||
| - | ||
| + | ||
| @serialize() | ||
| public gamepadMoveSensibility = 40; | ||
| - | ||
| - constructor(){ | ||
| + | ||
| + constructor() { | ||
| this._gamepads = new Gamepads((gamepad: Gamepad) => { this._onNewGameConnected(gamepad); }); | ||
| } | ||
| - | ||
| - attachCamera(camera : ArcRotateCamera){ | ||
| + | ||
| + attachCamera(camera: ArcRotateCamera) { | ||
| this.camera = camera; | ||
| } | ||
| - | ||
| - detach(){ | ||
| + | ||
| + detach() { | ||
| this._gamepads.dispose(); | ||
| } | ||
| - | ||
| - checkInputs(){ | ||
| + | ||
| + checkInputs() { | ||
| if (this.gamepad) { | ||
| var camera = this.camera; | ||
| var RSValues = this.gamepad.rightStick; | ||
| - | ||
| - if (RSValues.x != 0){ | ||
| - var normalizedRX = RSValues.x / this.gamepadRotationSensibility; | ||
| + | ||
| + if (RSValues.x != 0) { | ||
| + var normalizedRX = RSValues.x / this.gamepadRotationSensibility; | ||
| if (normalizedRX != 0 && Math.abs(normalizedRX) > 0.005) { | ||
| camera.inertialAlphaOffset += normalizedRX; | ||
| } | ||
| } | ||
| - | ||
| - if (RSValues.y != 0){ | ||
| + | ||
| + if (RSValues.y != 0) { | ||
| var normalizedRY = RSValues.y / this.gamepadRotationSensibility; | ||
| if (normalizedRY != 0 && Math.abs(normalizedRY) > 0.005) { | ||
| camera.inertialBetaOffset += normalizedRY; | ||
| } | ||
| - } | ||
| - | ||
| + } | ||
| + | ||
| var LSValues = this.gamepad.leftStick; | ||
| - if (LSValues.y != 0){ | ||
| - var normalizedLY = LSValues.y / this.gamepadMoveSensibility; | ||
| + if (LSValues.y != 0) { | ||
| + var normalizedLY = LSValues.y / this.gamepadMoveSensibility; | ||
| if (normalizedLY != 0 && Math.abs(normalizedLY) > 0.005) { | ||
| this.camera.inertialRadiusOffset -= normalizedLY; | ||
| } | ||
| } | ||
| - | ||
| + | ||
| } | ||
| } | ||
| - | ||
| + | ||
| private _onNewGameConnected(gamepad: Gamepad) { | ||
| // Only the first gamepad can control the camera | ||
| if (gamepad.index === 0) { | ||
| this.gamepad = gamepad; | ||
| } | ||
| } | ||
| - | ||
| - getTypeName(): string{ | ||
| + | ||
| + getTypeName(): string { | ||
| return "ArcRotateCameraGamepadInput"; | ||
| } | ||
| - | ||
| - getSimpleName(){ | ||
| + | ||
| + getSimpleName() { | ||
| return "gamepad"; | ||
| } | ||
| } | ||
| - | ||
| + | ||
| CameraInputTypes["ArcRotateCameraGamepadInput"] = ArcRotateCameraGamepadInput; | ||
| -} | ||
| +} |
2
src/Cameras/babylon.camera.js
27
src/Cameras/babylon.camera.ts
49
src/Cameras/babylon.cameraInputsManager.ts
101
src/Mesh/babylon.meshBuilder.js
1
src/Mesh/babylon.meshBuilder.ts
2
src/babylon.node.js
1
what's new.md
0 comments on commit
741c07a