@babylonjs/core 6.24.0 → 6.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Buffers/buffer.align.d.ts +25 -0
- package/Buffers/buffer.align.js +120 -0
- package/Buffers/buffer.align.js.map +1 -0
- package/Buffers/buffer.d.ts +15 -3
- package/Buffers/buffer.js +27 -7
- package/Buffers/buffer.js.map +1 -1
- package/Buffers/index.d.ts +1 -0
- package/Buffers/index.js +1 -0
- package/Buffers/index.js.map +1 -1
- package/Cameras/Inputs/BaseCameraPointersInput.js +0 -3
- package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/flyCameraMouseInput.js +1 -4
- package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.js +0 -6
- package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
- package/Cameras/RigModes/index.d.ts +0 -1
- package/Cameras/RigModes/index.js +0 -1
- package/Cameras/RigModes/index.js.map +1 -1
- package/Cameras/RigModes/vrRigMode.js +1 -1
- package/Cameras/RigModes/vrRigMode.js.map +1 -1
- package/Cameras/VR/index.d.ts +0 -1
- package/Cameras/VR/index.js +0 -1
- package/Cameras/VR/index.js.map +1 -1
- package/Cameras/VR/vrExperienceHelper.d.ts +7 -66
- package/Cameras/VR/vrExperienceHelper.js +17 -702
- package/Cameras/VR/vrExperienceHelper.js.map +1 -1
- package/Cameras/camera.d.ts +15 -20
- package/Cameras/camera.js +41 -36
- package/Cameras/camera.js.map +1 -1
- package/Cameras/targetCamera.js +1 -1
- package/Cameras/targetCamera.js.map +1 -1
- package/Engines/Extensions/index.d.ts +0 -1
- package/Engines/Extensions/index.js +0 -1
- package/Engines/Extensions/index.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.d.ts +4 -0
- package/Engines/WebGL/webGLRenderTargetWrapper.js +4 -0
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +8 -7
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
- package/Engines/constants.d.ts +0 -4
- package/Engines/constants.js +0 -4
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.d.ts +38 -258
- package/Engines/engine.js +0 -65
- package/Engines/engine.js.map +1 -1
- package/Engines/engineFactory.js +9 -14
- package/Engines/engineFactory.js.map +1 -1
- package/Engines/engineFeatures.d.ts +2 -0
- package/Engines/engineFeatures.js.map +1 -1
- package/Engines/nativeEngine.js +1 -0
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +1 -0
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +22 -5
- package/Engines/thinEngine.js +55 -22
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +1 -0
- package/Engines/webgpuEngine.js +4 -2
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.d.ts +9 -8
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.js +34 -16
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.d.ts +4 -3
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js +14 -6
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.d.ts +19 -14
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js +64 -27
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.d.ts +39 -41
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js +152 -74
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.d.ts +12 -12
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js +42 -21
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.d.ts +17 -14
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js +62 -26
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.d.ts +13 -10
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js +46 -18
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.d.ts +4 -1
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +6 -2
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js +7 -2
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.d.ts +5 -3
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +10 -5
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.d.ts +4 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js +6 -2
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js +7 -2
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +7 -2
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.d.ts +4 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +6 -2
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +6 -2
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +12 -3
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +5 -3
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +11 -6
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js +7 -2
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js +7 -2
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +8 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.d.ts +6 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +22 -16
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.d.ts +7 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js +15 -10
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +8 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +7 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +14 -7
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +5 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +9 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +8 -3
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +41 -3
- package/FlowGraph/flowGraph.js +135 -0
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphAsyncExecutionBlock.d.ts +2 -1
- package/FlowGraph/flowGraphAsyncExecutionBlock.js +2 -2
- package/FlowGraph/flowGraphAsyncExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphBlock.d.ts +15 -3
- package/FlowGraph/flowGraphBlock.js +50 -7
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +34 -4
- package/FlowGraph/flowGraphConnection.js +49 -3
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +25 -5
- package/FlowGraph/flowGraphContext.js +86 -4
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +7 -1
- package/FlowGraph/flowGraphCoordinator.js +18 -2
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.d.ts +4 -11
- package/FlowGraph/flowGraphDataConnection.js +16 -14
- package/FlowGraph/flowGraphDataConnection.js.map +1 -1
- package/FlowGraph/flowGraphExecutionBlock.d.ts +8 -3
- package/FlowGraph/flowGraphExecutionBlock.js +37 -6
- package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphRichTypes.d.ts +5 -9
- package/FlowGraph/flowGraphRichTypes.js +29 -44
- package/FlowGraph/flowGraphRichTypes.js.map +1 -1
- package/FlowGraph/flowGraphSignalConnection.js +2 -0
- package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
- package/FlowGraph/flowGraphVariableDefinitions.d.ts +22 -2
- package/FlowGraph/flowGraphVariableDefinitions.js +29 -0
- package/FlowGraph/flowGraphVariableDefinitions.js.map +1 -1
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.d.ts +2 -1
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js +2 -2
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js.map +1 -1
- package/Gamepads/gamepadManager.js +0 -5
- package/Gamepads/gamepadManager.js.map +1 -1
- package/Gamepads/index.d.ts +0 -1
- package/Gamepads/index.js +0 -2
- package/Gamepads/index.js.map +1 -1
- package/Gizmos/gizmo.js +1 -4
- package/Gizmos/gizmo.js.map +1 -1
- package/Materials/GreasedLine/greasedLineMaterialDefaults.d.ts +24 -0
- package/Materials/GreasedLine/greasedLineMaterialDefaults.js +19 -0
- package/Materials/GreasedLine/greasedLineMaterialDefaults.js.map +1 -0
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.d.ts +243 -0
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.js +55 -0
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.js.map +1 -0
- package/Materials/GreasedLine/greasedLinePluginMaterial.d.ts +253 -0
- package/Materials/{greasedLinePluginMaterial.js → GreasedLine/greasedLinePluginMaterial.js} +148 -205
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -0
- package/Materials/{greasedLineSimpleMaterial.d.ts → GreasedLine/greasedLineSimpleMaterial.d.ts} +20 -48
- package/Materials/{greasedLineSimpleMaterial.js → GreasedLine/greasedLineSimpleMaterial.js} +74 -91
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -0
- package/Materials/Node/Blocks/Input/prePassTextureBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Input/prePassTextureBlock.js.map +1 -1
- package/Materials/Textures/texture.js +1 -0
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/index.d.ts +4 -1
- package/Materials/index.js +4 -1
- package/Materials/index.js.map +1 -1
- package/Maths/math.vector.d.ts +32 -22
- package/Maths/math.vector.js +54 -43
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.d.ts +7 -6
- package/Meshes/Builders/greasedLineBuilder.js +65 -31
- package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +216 -0
- package/Meshes/GreasedLine/greasedLineBaseMesh.js +247 -0
- package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -0
- package/Meshes/GreasedLine/greasedLineMesh.d.ts +92 -0
- package/Meshes/{greasedLineMesh.js → GreasedLine/greasedLineMesh.js} +29 -223
- package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -0
- package/Meshes/GreasedLine/greasedLineRibbonMesh.d.ts +107 -0
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +462 -0
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -0
- package/Meshes/Node/Blocks/Sources/meshBlock.d.ts +9 -2
- package/Meshes/Node/Blocks/Sources/meshBlock.js +17 -5
- package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.d.ts +15 -0
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +50 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js +5 -5
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometry.d.ts +1 -2
- package/Meshes/Node/nodeGeometry.js +3 -4
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlock.d.ts +1 -2
- package/Meshes/Node/nodeGeometryBlock.js +1 -2
- package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
- package/Meshes/geometry.js +6 -12
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/index.d.ts +3 -1
- package/Meshes/index.js +3 -1
- package/Meshes/index.js.map +1 -1
- package/Meshes/mesh.d.ts +4 -0
- package/Meshes/mesh.js +7 -0
- package/Meshes/mesh.js.map +1 -1
- package/Misc/deepCopier.js +3 -0
- package/Misc/deepCopier.js.map +1 -1
- package/Misc/greasedLineTools.d.ts +52 -5
- package/Misc/greasedLineTools.js +180 -10
- package/Misc/greasedLineTools.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +9 -2
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/motionBlurPostProcess.js +4 -1
- package/PostProcesses/motionBlurPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.js +1 -6
- package/PostProcesses/postProcess.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +4 -0
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Shaders/greasedLine.fragment.js +2 -5
- package/Shaders/greasedLine.fragment.js.map +1 -1
- package/Shaders/greasedLine.vertex.js +15 -4
- package/Shaders/greasedLine.vertex.js.map +1 -1
- package/XR/webXRDefaultExperience.d.ts +1 -1
- package/XR/webXRDefaultExperience.js +1 -1
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +17 -10
- package/scene.js +25 -30
- package/scene.js.map +1 -1
- package/Cameras/RigModes/webVRRigMode.d.ts +0 -5
- package/Cameras/RigModes/webVRRigMode.js +0 -34
- package/Cameras/RigModes/webVRRigMode.js.map +0 -1
- package/Cameras/VR/webVRCamera.d.ts +0 -316
- package/Cameras/VR/webVRCamera.js +0 -618
- package/Cameras/VR/webVRCamera.js.map +0 -1
- package/Engines/Extensions/engine.webVR.d.ts +0 -91
- package/Engines/Extensions/engine.webVR.js +0 -195
- package/Engines/Extensions/engine.webVR.js.map +0 -1
- package/FlowGraph/Blocks/Execution/flowGraphCustomFunctionBlock.d.ts +0 -23
- package/FlowGraph/Blocks/Execution/flowGraphCustomFunctionBlock.js +0 -18
- package/FlowGraph/Blocks/Execution/flowGraphCustomFunctionBlock.js.map +0 -1
- package/Gamepads/Controllers/daydreamController.d.ts +0 -38
- package/Gamepads/Controllers/daydreamController.js +0 -70
- package/Gamepads/Controllers/daydreamController.js.map +0 -1
- package/Gamepads/Controllers/gearVRController.d.ts +0 -39
- package/Gamepads/Controllers/gearVRController.js +0 -79
- package/Gamepads/Controllers/gearVRController.js.map +0 -1
- package/Gamepads/Controllers/genericController.d.ts +0 -34
- package/Gamepads/Controllers/genericController.js +0 -48
- package/Gamepads/Controllers/genericController.js.map +0 -1
- package/Gamepads/Controllers/index.d.ts +0 -8
- package/Gamepads/Controllers/index.js +0 -9
- package/Gamepads/Controllers/index.js.map +0 -1
- package/Gamepads/Controllers/oculusTouchController.d.ts +0 -78
- package/Gamepads/Controllers/oculusTouchController.js +0 -196
- package/Gamepads/Controllers/oculusTouchController.js.map +0 -1
- package/Gamepads/Controllers/poseEnabledController.d.ts +0 -219
- package/Gamepads/Controllers/poseEnabledController.js +0 -293
- package/Gamepads/Controllers/poseEnabledController.js.map +0 -1
- package/Gamepads/Controllers/viveController.d.ts +0 -52
- package/Gamepads/Controllers/viveController.js +0 -115
- package/Gamepads/Controllers/viveController.js.map +0 -1
- package/Gamepads/Controllers/webVRController.d.ts +0 -85
- package/Gamepads/Controllers/webVRController.js +0 -122
- package/Gamepads/Controllers/webVRController.js.map +0 -1
- package/Gamepads/Controllers/windowsMotionController.d.ts +0 -212
- package/Gamepads/Controllers/windowsMotionController.js +0 -519
- package/Gamepads/Controllers/windowsMotionController.js.map +0 -1
- package/Materials/greasedLinePluginMaterial.d.ts +0 -496
- package/Materials/greasedLinePluginMaterial.js.map +0 -1
- package/Materials/greasedLineSimpleMaterial.js.map +0 -1
- package/Meshes/greasedLineMesh.d.ts +0 -204
- package/Meshes/greasedLineMesh.js.map +0 -1
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { Scene } from "../../scene";
|
|
2
|
-
import type { AbstractMesh } from "../../Meshes/abstractMesh";
|
|
3
|
-
import { WebVRController } from "./webVRController";
|
|
4
|
-
import type { ExtendedGamepadButton } from "./poseEnabledController";
|
|
5
|
-
/**
|
|
6
|
-
* Gear VR Controller
|
|
7
|
-
*/
|
|
8
|
-
export declare class GearVRController extends WebVRController {
|
|
9
|
-
/**
|
|
10
|
-
* Base Url for the controller model.
|
|
11
|
-
*/
|
|
12
|
-
static MODEL_BASE_URL: string;
|
|
13
|
-
/**
|
|
14
|
-
* File name for the controller model.
|
|
15
|
-
*/
|
|
16
|
-
static MODEL_FILENAME: string;
|
|
17
|
-
/**
|
|
18
|
-
* Gamepad Id prefix used to identify this controller.
|
|
19
|
-
*/
|
|
20
|
-
static readonly GAMEPAD_ID_PREFIX: string;
|
|
21
|
-
private readonly _buttonIndexToObservableNameMap;
|
|
22
|
-
/**
|
|
23
|
-
* Creates a new GearVRController from a gamepad
|
|
24
|
-
* @param vrGamepad the gamepad that the controller should be created from
|
|
25
|
-
*/
|
|
26
|
-
constructor(vrGamepad: any);
|
|
27
|
-
/**
|
|
28
|
-
* Implements abstract method on WebVRController class, loading controller meshes and calling this.attachToMesh if successful.
|
|
29
|
-
* @param scene scene in which to add meshes
|
|
30
|
-
* @param meshLoaded optional callback function that will be called if the mesh loads successfully.
|
|
31
|
-
*/
|
|
32
|
-
initControllerMesh(scene: Scene, meshLoaded?: (mesh: AbstractMesh) => void): void;
|
|
33
|
-
/**
|
|
34
|
-
* Called once for each button that changed state since the last frame
|
|
35
|
-
* @param buttonIdx Which button index changed
|
|
36
|
-
* @param state New state of the button
|
|
37
|
-
*/
|
|
38
|
-
protected _handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton): void;
|
|
39
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { Vector3 } from "../../Maths/math.vector.js";
|
|
2
|
-
import { Mesh } from "../../Meshes/mesh.js";
|
|
3
|
-
import { SceneLoader } from "../../Loading/sceneLoader.js";
|
|
4
|
-
import { WebVRController } from "./webVRController.js";
|
|
5
|
-
import { PoseEnabledControllerType, PoseEnabledControllerHelper } from "./poseEnabledController.js";
|
|
6
|
-
/**
|
|
7
|
-
* Gear VR Controller
|
|
8
|
-
*/
|
|
9
|
-
export class GearVRController extends WebVRController {
|
|
10
|
-
/**
|
|
11
|
-
* Creates a new GearVRController from a gamepad
|
|
12
|
-
* @param vrGamepad the gamepad that the controller should be created from
|
|
13
|
-
*/
|
|
14
|
-
constructor(vrGamepad) {
|
|
15
|
-
super(vrGamepad);
|
|
16
|
-
this._buttonIndexToObservableNameMap = [
|
|
17
|
-
"onPadStateChangedObservable",
|
|
18
|
-
"onTriggerStateChangedObservable", // Trigger
|
|
19
|
-
];
|
|
20
|
-
this.controllerType = PoseEnabledControllerType.GEAR_VR;
|
|
21
|
-
// Initial starting position defaults to where hand would be (incase of only 3dof controller)
|
|
22
|
-
this._calculatedPosition = new Vector3(this.hand == "left" ? -0.15 : 0.15, -0.5, 0.25);
|
|
23
|
-
this._disableTrackPosition(this._calculatedPosition);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Implements abstract method on WebVRController class, loading controller meshes and calling this.attachToMesh if successful.
|
|
27
|
-
* @param scene scene in which to add meshes
|
|
28
|
-
* @param meshLoaded optional callback function that will be called if the mesh loads successfully.
|
|
29
|
-
*/
|
|
30
|
-
initControllerMesh(scene, meshLoaded) {
|
|
31
|
-
SceneLoader.ImportMesh("", GearVRController.MODEL_BASE_URL, GearVRController.MODEL_FILENAME, scene, (newMeshes) => {
|
|
32
|
-
// Offset the controller so it will rotate around the users wrist
|
|
33
|
-
const mesh = new Mesh("", scene);
|
|
34
|
-
newMeshes[1].parent = mesh;
|
|
35
|
-
newMeshes[1].position.z = -0.15;
|
|
36
|
-
this._defaultModel = mesh;
|
|
37
|
-
this.attachToMesh(this._defaultModel);
|
|
38
|
-
if (meshLoaded) {
|
|
39
|
-
meshLoaded(this._defaultModel);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Called once for each button that changed state since the last frame
|
|
45
|
-
* @param buttonIdx Which button index changed
|
|
46
|
-
* @param state New state of the button
|
|
47
|
-
*/
|
|
48
|
-
_handleButtonChange(buttonIdx, state) {
|
|
49
|
-
if (buttonIdx < this._buttonIndexToObservableNameMap.length) {
|
|
50
|
-
const observableName = this._buttonIndexToObservableNameMap[buttonIdx];
|
|
51
|
-
// Only emit events for buttons that we know how to map from index to observable
|
|
52
|
-
const observable = this[observableName];
|
|
53
|
-
if (observable) {
|
|
54
|
-
observable.notifyObservers(state);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Base Url for the controller model.
|
|
61
|
-
*/
|
|
62
|
-
GearVRController.MODEL_BASE_URL = "https://controllers.babylonjs.com/generic/";
|
|
63
|
-
/**
|
|
64
|
-
* File name for the controller model.
|
|
65
|
-
*/
|
|
66
|
-
GearVRController.MODEL_FILENAME = "generic.babylon";
|
|
67
|
-
/**
|
|
68
|
-
* Gamepad Id prefix used to identify this controller.
|
|
69
|
-
*/
|
|
70
|
-
GearVRController.GAMEPAD_ID_PREFIX = "Gear VR"; // id is 'Gear VR Controller'
|
|
71
|
-
PoseEnabledControllerHelper._ControllerFactories.push({
|
|
72
|
-
canCreate: (gamepadInfo) => {
|
|
73
|
-
return gamepadInfo.id.indexOf(GearVRController.GAMEPAD_ID_PREFIX) === 0 || gamepadInfo.id.indexOf("Oculus Go") !== -1 || gamepadInfo.id.indexOf("Vive Focus") !== -1;
|
|
74
|
-
},
|
|
75
|
-
create: (gamepadInfo) => {
|
|
76
|
-
return new GearVRController(gamepadInfo);
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
//# sourceMappingURL=gearVRController.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gearVRController.js","sourceRoot":"","sources":["../../../../../dev/core/src/Gamepads/Controllers/gearVRController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEjG;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,eAAe;IAoBjD;;;OAGG;IACH,YAAY,SAAc;QACtB,KAAK,CAAC,SAAS,CAAC,CAAC;QAVJ,oCAA+B,GAAG;YAC/C,6BAA6B;YAC7B,iCAAiC,EAAE,UAAU;SAChD,CAAC;QAQE,IAAI,CAAC,cAAc,GAAG,yBAAyB,CAAC,OAAO,CAAC;QACxD,6FAA6F;QAC7F,IAAI,CAAC,mBAAmB,GAAG,I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AW,4CAA4C,AAAvD,CAAwD;AACpF;;GAEG;AACW,+BAAc,GAAW,iBAAiB,AAA5B,CAA6B;AAEzD;;GAEG;AACoB,kCAAiB,GAAW,SAAS,AAApB,CAAqB,CAAC,6BAA6B;AAwD/F,2BAA2B,CAAC,oBAAoB,CAAC,IAAI,CAAC;IAClD,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE;QACvB,OAAO,WAAW,CAAC,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,IAAI,WAAW,CAAC,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IACzK,CAAC;IACD,MAAM,EAAE,CAAC,WAAW,EAAE,EAAE;QACpB,OAAO,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;CACJ,CAAC,CAAC","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport { Vector3 } from \"../../Maths/math.vector\";\r\nimport type { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport { Mesh } from \"../../Meshes/mesh\";\r\nimport { SceneLoader } from \"../../Loading/sceneLoader\";\r\nimport { WebVRController } from \"./webVRController\";\r\nimport type { ExtendedGamepadButton } from \"./poseEnabledController\";\r\nimport { PoseEnabledControllerType, PoseEnabledControllerHelper } from \"./poseEnabledController\";\r\n\r\n/**\r\n * Gear VR Controller\r\n */\r\nexport class GearVRController extends WebVRController {\r\n /**\r\n * Base Url for the controller model.\r\n */\r\n public static MODEL_BASE_URL: string = \"https://controllers.babylonjs.com/generic/\";\r\n /**\r\n * File name for the controller model.\r\n */\r\n public static MODEL_FILENAME: string = \"generic.babylon\";\r\n\r\n /**\r\n * Gamepad Id prefix used to identify this controller.\r\n */\r\n public static readonly GAMEPAD_ID_PREFIX: string = \"Gear VR\"; // id is 'Gear VR Controller'\r\n\r\n private readonly _buttonIndexToObservableNameMap = [\r\n \"onPadStateChangedObservable\", // Pad\r\n \"onTriggerStateChangedObservable\", // Trigger\r\n ];\r\n\r\n /**\r\n * Creates a new GearVRController from a gamepad\r\n * @param vrGamepad the gamepad that the controller should be created from\r\n */\r\n constructor(vrGamepad: any) {\r\n super(vrGamepad);\r\n this.controllerType = PoseEnabledControllerType.GEAR_VR;\r\n // Initial starting position defaults to where hand would be (incase of only 3dof controller)\r\n this._calculatedPosition = new Vector3(this.hand == \"left\" ? -0.15 : 0.15, -0.5, 0.25);\r\n this._disableTrackPosition(this._calculatedPosition);\r\n }\r\n\r\n /**\r\n * Implements abstract method on WebVRController class, loading controller meshes and calling this.attachToMesh if successful.\r\n * @param scene scene in which to add meshes\r\n * @param meshLoaded optional callback function that will be called if the mesh loads successfully.\r\n */\r\n public initControllerMesh(scene: Scene, meshLoaded?: (mesh: AbstractMesh) => void) {\r\n SceneLoader.ImportMesh(\"\", GearVRController.MODEL_BASE_URL, GearVRController.MODEL_FILENAME, scene, (newMeshes) => {\r\n // Offset the controller so it will rotate around the users wrist\r\n const mesh = new Mesh(\"\", scene);\r\n newMeshes[1].parent = mesh;\r\n newMeshes[1].position.z = -0.15;\r\n this._defaultModel = mesh;\r\n this.attachToMesh(this._defaultModel);\r\n if (meshLoaded) {\r\n meshLoaded(this._defaultModel);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Called once for each button that changed state since the last frame\r\n * @param buttonIdx Which button index changed\r\n * @param state New state of the button\r\n */\r\n protected _handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton) {\r\n if (buttonIdx < this._buttonIndexToObservableNameMap.length) {\r\n const observableName: string = this._buttonIndexToObservableNameMap[buttonIdx];\r\n\r\n // Only emit events for buttons that we know how to map from index to observable\r\n const observable = (<any>this)[observableName];\r\n if (observable) {\r\n observable.notifyObservers(state);\r\n }\r\n }\r\n }\r\n}\r\n\r\nPoseEnabledControllerHelper._ControllerFactories.push({\r\n canCreate: (gamepadInfo) => {\r\n return gamepadInfo.id.indexOf(GearVRController.GAMEPAD_ID_PREFIX) === 0 || gamepadInfo.id.indexOf(\"Oculus Go\") !== -1 || gamepadInfo.id.indexOf(\"Vive Focus\") !== -1;\r\n },\r\n create: (gamepadInfo) => {\r\n return new GearVRController(gamepadInfo);\r\n },\r\n});\r\n"]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { Scene } from "../../scene";
|
|
2
|
-
import type { AbstractMesh } from "../../Meshes/abstractMesh";
|
|
3
|
-
import { WebVRController } from "./webVRController";
|
|
4
|
-
import type { ExtendedGamepadButton } from "./poseEnabledController";
|
|
5
|
-
/**
|
|
6
|
-
* Generic Controller
|
|
7
|
-
*/
|
|
8
|
-
export declare class GenericController extends WebVRController {
|
|
9
|
-
/**
|
|
10
|
-
* Base Url for the controller model.
|
|
11
|
-
*/
|
|
12
|
-
static readonly MODEL_BASE_URL: string;
|
|
13
|
-
/**
|
|
14
|
-
* File name for the controller model.
|
|
15
|
-
*/
|
|
16
|
-
static readonly MODEL_FILENAME: string;
|
|
17
|
-
/**
|
|
18
|
-
* Creates a new GenericController from a gamepad
|
|
19
|
-
* @param vrGamepad the gamepad that the controller should be created from
|
|
20
|
-
*/
|
|
21
|
-
constructor(vrGamepad: any);
|
|
22
|
-
/**
|
|
23
|
-
* Implements abstract method on WebVRController class, loading controller meshes and calling this.attachToMesh if successful.
|
|
24
|
-
* @param scene scene in which to add meshes
|
|
25
|
-
* @param meshLoaded optional callback function that will be called if the mesh loads successfully.
|
|
26
|
-
*/
|
|
27
|
-
initControllerMesh(scene: Scene, meshLoaded?: (mesh: AbstractMesh) => void): void;
|
|
28
|
-
/**
|
|
29
|
-
* Called once for each button that changed state since the last frame
|
|
30
|
-
* @param buttonIdx Which button index changed
|
|
31
|
-
* @param state New state of the button
|
|
32
|
-
*/
|
|
33
|
-
protected _handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton): void;
|
|
34
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { SceneLoader } from "../../Loading/sceneLoader.js";
|
|
2
|
-
import { WebVRController } from "./webVRController.js";
|
|
3
|
-
import { PoseEnabledControllerHelper } from "./poseEnabledController.js";
|
|
4
|
-
/**
|
|
5
|
-
* Generic Controller
|
|
6
|
-
*/
|
|
7
|
-
export class GenericController extends WebVRController {
|
|
8
|
-
/**
|
|
9
|
-
* Creates a new GenericController from a gamepad
|
|
10
|
-
* @param vrGamepad the gamepad that the controller should be created from
|
|
11
|
-
*/
|
|
12
|
-
constructor(vrGamepad) {
|
|
13
|
-
super(vrGamepad);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Implements abstract method on WebVRController class, loading controller meshes and calling this.attachToMesh if successful.
|
|
17
|
-
* @param scene scene in which to add meshes
|
|
18
|
-
* @param meshLoaded optional callback function that will be called if the mesh loads successfully.
|
|
19
|
-
*/
|
|
20
|
-
initControllerMesh(scene, meshLoaded) {
|
|
21
|
-
SceneLoader.ImportMesh("", GenericController.MODEL_BASE_URL, GenericController.MODEL_FILENAME, scene, (newMeshes) => {
|
|
22
|
-
this._defaultModel = newMeshes[1];
|
|
23
|
-
this.attachToMesh(this._defaultModel);
|
|
24
|
-
if (meshLoaded) {
|
|
25
|
-
meshLoaded(this._defaultModel);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Called once for each button that changed state since the last frame
|
|
31
|
-
* @param buttonIdx Which button index changed
|
|
32
|
-
* @param state New state of the button
|
|
33
|
-
*/
|
|
34
|
-
_handleButtonChange(buttonIdx, state) {
|
|
35
|
-
console.log("Button id: " + buttonIdx + "state: ");
|
|
36
|
-
console.dir(state);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Base Url for the controller model.
|
|
41
|
-
*/
|
|
42
|
-
GenericController.MODEL_BASE_URL = "https://controllers.babylonjs.com/generic/";
|
|
43
|
-
/**
|
|
44
|
-
* File name for the controller model.
|
|
45
|
-
*/
|
|
46
|
-
GenericController.MODEL_FILENAME = "generic.babylon";
|
|
47
|
-
PoseEnabledControllerHelper._DefaultControllerFactory = (gamepadInfo) => new GenericController(gamepadInfo);
|
|
48
|
-
//# sourceMappingURL=genericController.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"genericController.js","sourceRoot":"","sources":["../../../../../dev/core/src/Gamepads/Controllers/genericController.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,eAAe;IAUlD;;;OAGG;IACH,YAAY,SAAc;QACtB,KAAK,CAAC,SAAS,CAAC,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACI,kBAAkB,CAAC,KAAY,EAAE,UAAyC;QAC7E,WAAW,CAAC,UAAU,CAAC,EAAE,EAAE,iBAAiB,CAAC,cAAc,EAAE,iBAAiB,CAAC,cAAc,EAAE,KAAK,EAAE,CAAC,SAAS,EAAE,EAAE;YAChH,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;YAClC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACtC,IAAI,UAAU,EAAE;gBACZ,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;aAClC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACO,mBAAmB,CAAC,SAAiB,EAAE,KAA4B;QACzE,OAAO,CAAC,GAAG,CAAC,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC;QACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;;AAxCD;;GAEG;AACoB,gCAAc,GAAW,4CAA4C,CAAC;AAC7F;;GAEG;AACoB,gCAAc,GAAW,iBAAiB,CAAC;AAoCtE,2BAA2B,CAAC,yBAAyB,GAAG,CAAC,WAAgB,EAAE,EAAE,CAAC,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport type { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport { SceneLoader } from \"../../Loading/sceneLoader\";\r\n\r\nimport { WebVRController } from \"./webVRController\";\r\nimport type { ExtendedGamepadButton } from \"./poseEnabledController\";\r\nimport { PoseEnabledControllerHelper } from \"./poseEnabledController\";\r\n\r\n/**\r\n * Generic Controller\r\n */\r\nexport class GenericController extends WebVRController {\r\n /**\r\n * Base Url for the controller model.\r\n */\r\n public static readonly MODEL_BASE_URL: string = \"https://controllers.babylonjs.com/generic/\";\r\n /**\r\n * File name for the controller model.\r\n */\r\n public static readonly MODEL_FILENAME: string = \"generic.babylon\";\r\n\r\n /**\r\n * Creates a new GenericController from a gamepad\r\n * @param vrGamepad the gamepad that the controller should be created from\r\n */\r\n constructor(vrGamepad: any) {\r\n super(vrGamepad);\r\n }\r\n\r\n /**\r\n * Implements abstract method on WebVRController class, loading controller meshes and calling this.attachToMesh if successful.\r\n * @param scene scene in which to add meshes\r\n * @param meshLoaded optional callback function that will be called if the mesh loads successfully.\r\n */\r\n public initControllerMesh(scene: Scene, meshLoaded?: (mesh: AbstractMesh) => void) {\r\n SceneLoader.ImportMesh(\"\", GenericController.MODEL_BASE_URL, GenericController.MODEL_FILENAME, scene, (newMeshes) => {\r\n this._defaultModel = newMeshes[1];\r\n this.attachToMesh(this._defaultModel);\r\n if (meshLoaded) {\r\n meshLoaded(this._defaultModel);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Called once for each button that changed state since the last frame\r\n * @param buttonIdx Which button index changed\r\n * @param state New state of the button\r\n */\r\n protected _handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton) {\r\n console.log(\"Button id: \" + buttonIdx + \"state: \");\r\n console.dir(state);\r\n }\r\n}\r\n\r\nPoseEnabledControllerHelper._DefaultControllerFactory = (gamepadInfo: any) => new GenericController(gamepadInfo);\r\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from "./daydreamController";
|
|
2
|
-
export * from "./gearVRController";
|
|
3
|
-
export * from "./genericController";
|
|
4
|
-
export * from "./oculusTouchController";
|
|
5
|
-
export * from "./poseEnabledController";
|
|
6
|
-
export * from "./viveController";
|
|
7
|
-
export * from "./webVRController";
|
|
8
|
-
export * from "./windowsMotionController";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "./daydreamController.js";
|
|
2
|
-
export * from "./gearVRController.js";
|
|
3
|
-
export * from "./genericController.js";
|
|
4
|
-
export * from "./oculusTouchController.js";
|
|
5
|
-
export * from "./poseEnabledController.js";
|
|
6
|
-
export * from "./viveController.js";
|
|
7
|
-
export * from "./webVRController.js";
|
|
8
|
-
export * from "./windowsMotionController.js";
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Gamepads/Controllers/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC","sourcesContent":["export * from \"./daydreamController\";\r\nexport * from \"./gearVRController\";\r\nexport * from \"./genericController\";\r\nexport * from \"./oculusTouchController\";\r\nexport * from \"./poseEnabledController\";\r\nexport * from \"./viveController\";\r\nexport * from \"./webVRController\";\r\nexport * from \"./windowsMotionController\";\r\n"]}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { Observable } from "../../Misc/observable";
|
|
2
|
-
import type { Scene } from "../../scene";
|
|
3
|
-
import type { AbstractMesh } from "../../Meshes/abstractMesh";
|
|
4
|
-
import { WebVRController } from "./webVRController";
|
|
5
|
-
import type { ExtendedGamepadButton } from "./poseEnabledController";
|
|
6
|
-
/**
|
|
7
|
-
* Oculus Touch Controller
|
|
8
|
-
*/
|
|
9
|
-
export declare class OculusTouchController extends WebVRController {
|
|
10
|
-
/**
|
|
11
|
-
* Base Url for the controller model.
|
|
12
|
-
*/
|
|
13
|
-
static MODEL_BASE_URL: string;
|
|
14
|
-
/**
|
|
15
|
-
* File name for the left controller model.
|
|
16
|
-
*/
|
|
17
|
-
static MODEL_LEFT_FILENAME: string;
|
|
18
|
-
/**
|
|
19
|
-
* File name for the right controller model.
|
|
20
|
-
*/
|
|
21
|
-
static MODEL_RIGHT_FILENAME: string;
|
|
22
|
-
/**
|
|
23
|
-
* Base Url for the Quest controller model.
|
|
24
|
-
*/
|
|
25
|
-
static QUEST_MODEL_BASE_URL: string;
|
|
26
|
-
/**
|
|
27
|
-
* @internal
|
|
28
|
-
* If the controllers are running on a device that needs the updated Quest controller models
|
|
29
|
-
*/
|
|
30
|
-
static _IsQuest: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Fired when the secondary trigger on this controller is modified
|
|
33
|
-
*/
|
|
34
|
-
onSecondaryTriggerStateChangedObservable: Observable<ExtendedGamepadButton>;
|
|
35
|
-
/**
|
|
36
|
-
* Fired when the thumb rest on this controller is modified
|
|
37
|
-
*/
|
|
38
|
-
onThumbRestChangedObservable: Observable<ExtendedGamepadButton>;
|
|
39
|
-
/**
|
|
40
|
-
* Creates a new OculusTouchController from a gamepad
|
|
41
|
-
* @param vrGamepad the gamepad that the controller should be created from
|
|
42
|
-
*/
|
|
43
|
-
constructor(vrGamepad: any);
|
|
44
|
-
/**
|
|
45
|
-
* Implements abstract method on WebVRController class, loading controller meshes and calling this.attachToMesh if successful.
|
|
46
|
-
* @param scene scene in which to add meshes
|
|
47
|
-
* @param meshLoaded optional callback function that will be called if the mesh loads successfully.
|
|
48
|
-
*/
|
|
49
|
-
initControllerMesh(scene: Scene, meshLoaded?: (mesh: AbstractMesh) => void): void;
|
|
50
|
-
/**
|
|
51
|
-
* Fired when the A button on this controller is modified
|
|
52
|
-
*/
|
|
53
|
-
get onAButtonStateChangedObservable(): Observable<ExtendedGamepadButton>;
|
|
54
|
-
/**
|
|
55
|
-
* Fired when the B button on this controller is modified
|
|
56
|
-
*/
|
|
57
|
-
get onBButtonStateChangedObservable(): Observable<ExtendedGamepadButton>;
|
|
58
|
-
/**
|
|
59
|
-
* Fired when the X button on this controller is modified
|
|
60
|
-
*/
|
|
61
|
-
get onXButtonStateChangedObservable(): Observable<ExtendedGamepadButton>;
|
|
62
|
-
/**
|
|
63
|
-
* Fired when the Y button on this controller is modified
|
|
64
|
-
*/
|
|
65
|
-
get onYButtonStateChangedObservable(): Observable<ExtendedGamepadButton>;
|
|
66
|
-
/**
|
|
67
|
-
* Called once for each button that changed state since the last frame
|
|
68
|
-
* 0) thumb stick (touch, press, value = pressed (0,1)). value is in this.leftStick
|
|
69
|
-
* 1) index trigger (touch (?), press (only when value > 0.1), value 0 to 1)
|
|
70
|
-
* 2) secondary trigger (same)
|
|
71
|
-
* 3) A (right) X (left), touch, pressed = value
|
|
72
|
-
* 4) B / Y
|
|
73
|
-
* 5) thumb rest
|
|
74
|
-
* @param buttonIdx Which button index changed
|
|
75
|
-
* @param state New state of the button
|
|
76
|
-
*/
|
|
77
|
-
protected _handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton): void;
|
|
78
|
-
}
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import { Observable } from "../../Misc/observable.js";
|
|
2
|
-
import { SceneLoader } from "../../Loading/sceneLoader.js";
|
|
3
|
-
import { WebVRController } from "./webVRController.js";
|
|
4
|
-
import { PoseEnabledControllerType, PoseEnabledControllerHelper } from "./poseEnabledController.js";
|
|
5
|
-
import { EngineStore } from "../../Engines/engineStore.js";
|
|
6
|
-
/**
|
|
7
|
-
* Oculus Touch Controller
|
|
8
|
-
*/
|
|
9
|
-
export class OculusTouchController extends WebVRController {
|
|
10
|
-
/**
|
|
11
|
-
* Creates a new OculusTouchController from a gamepad
|
|
12
|
-
* @param vrGamepad the gamepad that the controller should be created from
|
|
13
|
-
*/
|
|
14
|
-
constructor(vrGamepad) {
|
|
15
|
-
super(vrGamepad);
|
|
16
|
-
/**
|
|
17
|
-
* Fired when the secondary trigger on this controller is modified
|
|
18
|
-
*/
|
|
19
|
-
this.onSecondaryTriggerStateChangedObservable = new Observable();
|
|
20
|
-
/**
|
|
21
|
-
* Fired when the thumb rest on this controller is modified
|
|
22
|
-
*/
|
|
23
|
-
this.onThumbRestChangedObservable = new Observable();
|
|
24
|
-
this.controllerType = PoseEnabledControllerType.OCULUS;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Implements abstract method on WebVRController class, loading controller meshes and calling this.attachToMesh if successful.
|
|
28
|
-
* @param scene scene in which to add meshes
|
|
29
|
-
* @param meshLoaded optional callback function that will be called if the mesh loads successfully.
|
|
30
|
-
*/
|
|
31
|
-
initControllerMesh(scene, meshLoaded) {
|
|
32
|
-
let meshName;
|
|
33
|
-
// Hand
|
|
34
|
-
if (this.hand === "left") {
|
|
35
|
-
meshName = OculusTouchController.MODEL_LEFT_FILENAME;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
// Right is the default if no hand is specified
|
|
39
|
-
meshName = OculusTouchController.MODEL_RIGHT_FILENAME;
|
|
40
|
-
}
|
|
41
|
-
SceneLoader.ImportMesh("", OculusTouchController._IsQuest ? OculusTouchController.QUEST_MODEL_BASE_URL : OculusTouchController.MODEL_BASE_URL, meshName, scene, (newMeshes) => {
|
|
42
|
-
/*
|
|
43
|
-
Parent Mesh name: oculus_touch_left
|
|
44
|
-
- body
|
|
45
|
-
- trigger
|
|
46
|
-
- thumbstick
|
|
47
|
-
- grip
|
|
48
|
-
- button_y
|
|
49
|
-
- button_x
|
|
50
|
-
- button_enter
|
|
51
|
-
*/
|
|
52
|
-
this._defaultModel = OculusTouchController._IsQuest ? newMeshes[0] : newMeshes[1];
|
|
53
|
-
this.attachToMesh(this._defaultModel);
|
|
54
|
-
if (meshLoaded) {
|
|
55
|
-
meshLoaded(this._defaultModel);
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Fired when the A button on this controller is modified
|
|
61
|
-
*/
|
|
62
|
-
get onAButtonStateChangedObservable() {
|
|
63
|
-
if (this.hand === "right") {
|
|
64
|
-
return this.onMainButtonStateChangedObservable;
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
throw new Error("No A button on left hand");
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Fired when the B button on this controller is modified
|
|
72
|
-
*/
|
|
73
|
-
get onBButtonStateChangedObservable() {
|
|
74
|
-
if (this.hand === "right") {
|
|
75
|
-
return this.onSecondaryButtonStateChangedObservable;
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
throw new Error("No B button on left hand");
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Fired when the X button on this controller is modified
|
|
83
|
-
*/
|
|
84
|
-
get onXButtonStateChangedObservable() {
|
|
85
|
-
if (this.hand === "left") {
|
|
86
|
-
return this.onMainButtonStateChangedObservable;
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
throw new Error("No X button on right hand");
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Fired when the Y button on this controller is modified
|
|
94
|
-
*/
|
|
95
|
-
get onYButtonStateChangedObservable() {
|
|
96
|
-
if (this.hand === "left") {
|
|
97
|
-
return this.onSecondaryButtonStateChangedObservable;
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
throw new Error("No Y button on right hand");
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Called once for each button that changed state since the last frame
|
|
105
|
-
* 0) thumb stick (touch, press, value = pressed (0,1)). value is in this.leftStick
|
|
106
|
-
* 1) index trigger (touch (?), press (only when value > 0.1), value 0 to 1)
|
|
107
|
-
* 2) secondary trigger (same)
|
|
108
|
-
* 3) A (right) X (left), touch, pressed = value
|
|
109
|
-
* 4) B / Y
|
|
110
|
-
* 5) thumb rest
|
|
111
|
-
* @param buttonIdx Which button index changed
|
|
112
|
-
* @param state New state of the button
|
|
113
|
-
*/
|
|
114
|
-
_handleButtonChange(buttonIdx, state) {
|
|
115
|
-
const notifyObject = state; //{ state: state, changes: changes };
|
|
116
|
-
const triggerDirection = this.hand === "right" ? -1 : 1;
|
|
117
|
-
switch (buttonIdx) {
|
|
118
|
-
case 0:
|
|
119
|
-
this.onPadStateChangedObservable.notifyObservers(notifyObject);
|
|
120
|
-
return;
|
|
121
|
-
case 1: // index trigger
|
|
122
|
-
if (!OculusTouchController._IsQuest && this._defaultModel) {
|
|
123
|
-
this._defaultModel.getChildren()[3].rotation.x = -notifyObject.value * 0.2;
|
|
124
|
-
this._defaultModel.getChildren()[3].position.y = -notifyObject.value * 0.005;
|
|
125
|
-
this._defaultModel.getChildren()[3].position.z = -notifyObject.value * 0.005;
|
|
126
|
-
}
|
|
127
|
-
this.onTriggerStateChangedObservable.notifyObservers(notifyObject);
|
|
128
|
-
return;
|
|
129
|
-
case 2: // secondary trigger
|
|
130
|
-
if (!OculusTouchController._IsQuest && this._defaultModel) {
|
|
131
|
-
this._defaultModel.getChildren()[4].position.x = triggerDirection * notifyObject.value * 0.0035;
|
|
132
|
-
}
|
|
133
|
-
this.onSecondaryTriggerStateChangedObservable.notifyObservers(notifyObject);
|
|
134
|
-
return;
|
|
135
|
-
case 3:
|
|
136
|
-
if (!OculusTouchController._IsQuest && this._defaultModel) {
|
|
137
|
-
if (notifyObject.pressed) {
|
|
138
|
-
this._defaultModel.getChildren()[1].position.y = -0.001;
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
this._defaultModel.getChildren()[1].position.y = 0;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
this.onMainButtonStateChangedObservable.notifyObservers(notifyObject);
|
|
145
|
-
return;
|
|
146
|
-
case 4:
|
|
147
|
-
if (!OculusTouchController._IsQuest && this._defaultModel) {
|
|
148
|
-
if (notifyObject.pressed) {
|
|
149
|
-
this._defaultModel.getChildren()[2].position.y = -0.001;
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
this._defaultModel.getChildren()[2].position.y = 0;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
this.onSecondaryButtonStateChangedObservable.notifyObservers(notifyObject);
|
|
156
|
-
return;
|
|
157
|
-
case 5:
|
|
158
|
-
this.onThumbRestChangedObservable.notifyObservers(notifyObject);
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Base Url for the controller model.
|
|
165
|
-
*/
|
|
166
|
-
OculusTouchController.MODEL_BASE_URL = "https://controllers.babylonjs.com/oculus/";
|
|
167
|
-
/**
|
|
168
|
-
* File name for the left controller model.
|
|
169
|
-
*/
|
|
170
|
-
OculusTouchController.MODEL_LEFT_FILENAME = "left.babylon";
|
|
171
|
-
/**
|
|
172
|
-
* File name for the right controller model.
|
|
173
|
-
*/
|
|
174
|
-
OculusTouchController.MODEL_RIGHT_FILENAME = "right.babylon";
|
|
175
|
-
/**
|
|
176
|
-
* Base Url for the Quest controller model.
|
|
177
|
-
*/
|
|
178
|
-
OculusTouchController.QUEST_MODEL_BASE_URL = "https://controllers.babylonjs.com/oculusQuest/";
|
|
179
|
-
/**
|
|
180
|
-
* @internal
|
|
181
|
-
* If the controllers are running on a device that needs the updated Quest controller models
|
|
182
|
-
*/
|
|
183
|
-
OculusTouchController._IsQuest = false;
|
|
184
|
-
PoseEnabledControllerHelper._ControllerFactories.push({
|
|
185
|
-
canCreate: (gamepadInfo) => {
|
|
186
|
-
// If the headset reports being an Oculus Quest, use the Quest controller models
|
|
187
|
-
if (EngineStore.LastCreatedEngine && EngineStore.LastCreatedEngine._vrDisplay && EngineStore.LastCreatedEngine._vrDisplay.displayName === "Oculus Quest") {
|
|
188
|
-
OculusTouchController._IsQuest = true;
|
|
189
|
-
}
|
|
190
|
-
return gamepadInfo.id.indexOf("Oculus Touch") !== -1;
|
|
191
|
-
},
|
|
192
|
-
create: (gamepadInfo) => {
|
|
193
|
-
return new OculusTouchController(gamepadInfo);
|
|
194
|
-
},
|
|
195
|
-
});
|
|
196
|
-
//# sourceMappingURL=oculusTouchController.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oculusTouchController.js","sourceRoot":"","sources":["../../../../../dev/core/src/Gamepads/Controllers/oculusTouchController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,eAAe;IAmCtD;;;OAGG;IACH,YAAY,SAAc;QACtB,KAAK,CAAC,SAAS,CAAC,CAAC;QAfrB;;WAEG;QACI,6CAAwC,GAAG,IAAI,UAAU,EAAyB,CAAC;QAE1F;;WAEG;QACI,iCAA4B,GAAG,IAAI,UAAU,EAAyB,CAAC;QAQ1E,IAAI,CAAC,cAAc,GAAG,yBAAyB,CAAC,MAAM,CAAC;IAC3D,CAAC;IAED;;;;OAIG;IACI,kBAAkB,CAAC,KAAY,EAAE,UAAyC;QAC7E,IAAI,QAAQ,CAAC;QAEb,OAAO;QACP,IAAI,IAAI,CAAC,IAAI,KA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BAChE,OAAO;SACd;IACL,CAAC;;AAzLD;;GAEG;AACW,oCAAc,GAAW,2CAA2C,AAAtD,CAAuD;AACnF;;GAEG;AACW,yCAAmB,GAAW,cAAc,AAAzB,CAA0B;AAC3D;;GAEG;AACW,0CAAoB,GAAW,eAAe,AAA1B,CAA2B;AAE7D;;GAEG;AACW,0CAAoB,GAAW,gDAAgD,AAA3D,CAA4D;AAE9F;;;GAGG;AACW,8BAAQ,GAAG,KAAK,AAAR,CAAS;AAsKnC,2BAA2B,CAAC,oBAAoB,CAAC,IAAI,CAAC;IAClD,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE;QACvB,gFAAgF;QAChF,IAAI,WAAW,CAAC,iBAAiB,IAAI,WAAW,CAAC,iBAAiB,CAAC,UAAU,IAAI,WAAW,CAAC,iBAAiB,CAAC,UAAU,CAAC,WAAW,KAAK,cAAc,EAAE;YACtJ,qBAAqB,CAAC,QAAQ,GAAG,IAAI,CAAC;SACzC;QACD,OAAO,WAAW,CAAC,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IACzD,CAAC;IACD,MAAM,EAAE,CAAC,WAAW,EAAE,EAAE;QACpB,OAAO,IAAI,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAClD,CAAC;CACJ,CAAC,CAAC","sourcesContent":["import { Observable } from \"../../Misc/observable\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport { SceneLoader } from \"../../Loading/sceneLoader\";\r\nimport { WebVRController } from \"./webVRController\";\r\nimport type { ExtendedGamepadButton } from \"./poseEnabledController\";\r\nimport { PoseEnabledControllerType, PoseEnabledControllerHelper } from \"./poseEnabledController\";\r\nimport { EngineStore } from \"../../Engines/engineStore\";\r\n/**\r\n * Oculus Touch Controller\r\n */\r\nexport class OculusTouchController extends WebVRController {\r\n /**\r\n * Base Url for the controller model.\r\n */\r\n public static MODEL_BASE_URL: string = \"https://controllers.babylonjs.com/oculus/\";\r\n /**\r\n * File name for the left controller model.\r\n */\r\n public static MODEL_LEFT_FILENAME: string = \"left.babylon\";\r\n /**\r\n * File name for the right controller model.\r\n */\r\n public static MODEL_RIGHT_FILENAME: string = \"right.babylon\";\r\n\r\n /**\r\n * Base Url for the Quest controller model.\r\n */\r\n public static QUEST_MODEL_BASE_URL: string = \"https://controllers.babylonjs.com/oculusQuest/\";\r\n\r\n /**\r\n * @internal\r\n * If the controllers are running on a device that needs the updated Quest controller models\r\n */\r\n public static _IsQuest = false;\r\n\r\n /**\r\n * Fired when the secondary trigger on this controller is modified\r\n */\r\n public onSecondaryTriggerStateChangedObservable = new Observable<ExtendedGamepadButton>();\r\n\r\n /**\r\n * Fired when the thumb rest on this controller is modified\r\n */\r\n public onThumbRestChangedObservable = new Observable<ExtendedGamepadButton>();\r\n\r\n /**\r\n * Creates a new OculusTouchController from a gamepad\r\n * @param vrGamepad the gamepad that the controller should be created from\r\n */\r\n constructor(vrGamepad: any) {\r\n super(vrGamepad);\r\n this.controllerType = PoseEnabledControllerType.OCULUS;\r\n }\r\n\r\n /**\r\n * Implements abstract method on WebVRController class, loading controller meshes and calling this.attachToMesh if successful.\r\n * @param scene scene in which to add meshes\r\n * @param meshLoaded optional callback function that will be called if the mesh loads successfully.\r\n */\r\n public initControllerMesh(scene: Scene, meshLoaded?: (mesh: AbstractMesh) => void) {\r\n let meshName;\r\n\r\n // Hand\r\n if (this.hand === \"left\") {\r\n meshName = OculusTouchController.MODEL_LEFT_FILENAME;\r\n } else {\r\n // Right is the default if no hand is specified\r\n meshName = OculusTouchController.MODEL_RIGHT_FILENAME;\r\n }\r\n\r\n SceneLoader.ImportMesh(\r\n \"\",\r\n OculusTouchController._IsQuest ? OculusTouchController.QUEST_MODEL_BASE_URL : OculusTouchController.MODEL_BASE_URL,\r\n meshName,\r\n scene,\r\n (newMeshes) => {\r\n /*\r\n Parent Mesh name: oculus_touch_left\r\n - body\r\n - trigger\r\n - thumbstick\r\n - grip\r\n - button_y\r\n - button_x\r\n - button_enter\r\n */\r\n\r\n this._defaultModel = OculusTouchController._IsQuest ? newMeshes[0] : newMeshes[1];\r\n this.attachToMesh(this._defaultModel);\r\n if (meshLoaded) {\r\n meshLoaded(this._defaultModel);\r\n }\r\n }\r\n );\r\n }\r\n\r\n /**\r\n * Fired when the A button on this controller is modified\r\n */\r\n public get onAButtonStateChangedObservable() {\r\n if (this.hand === \"right\") {\r\n return this.onMainButtonStateChangedObservable;\r\n } else {\r\n throw new Error(\"No A button on left hand\");\r\n }\r\n }\r\n\r\n /**\r\n * Fired when the B button on this controller is modified\r\n */\r\n public get onBButtonStateChangedObservable() {\r\n if (this.hand === \"right\") {\r\n return this.onSecondaryButtonStateChangedObservable;\r\n } else {\r\n throw new Error(\"No B button on left hand\");\r\n }\r\n }\r\n\r\n /**\r\n * Fired when the X button on this controller is modified\r\n */\r\n public get onXButtonStateChangedObservable() {\r\n if (this.hand === \"left\") {\r\n return this.onMainButtonStateChangedObservable;\r\n } else {\r\n throw new Error(\"No X button on right hand\");\r\n }\r\n }\r\n\r\n /**\r\n * Fired when the Y button on this controller is modified\r\n */\r\n public get onYButtonStateChangedObservable() {\r\n if (this.hand === \"left\") {\r\n return this.onSecondaryButtonStateChangedObservable;\r\n } else {\r\n throw new Error(\"No Y button on right hand\");\r\n }\r\n }\r\n\r\n /**\r\n * Called once for each button that changed state since the last frame\r\n * 0) thumb stick (touch, press, value = pressed (0,1)). value is in this.leftStick\r\n * 1) index trigger (touch (?), press (only when value > 0.1), value 0 to 1)\r\n * 2) secondary trigger (same)\r\n * 3) A (right) X (left), touch, pressed = value\r\n * 4) B / Y\r\n * 5) thumb rest\r\n * @param buttonIdx Which button index changed\r\n * @param state New state of the button\r\n */\r\n protected _handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton) {\r\n const notifyObject = state; //{ state: state, changes: changes };\r\n const triggerDirection = this.hand === \"right\" ? -1 : 1;\r\n switch (buttonIdx) {\r\n case 0:\r\n this.onPadStateChangedObservable.notifyObservers(notifyObject);\r\n return;\r\n case 1: // index trigger\r\n if (!OculusTouchController._IsQuest && this._defaultModel) {\r\n (<AbstractMesh>this._defaultModel.getChildren()[3]).rotation.x = -notifyObject.value * 0.2;\r\n (<AbstractMesh>this._defaultModel.getChildren()[3]).position.y = -notifyObject.value * 0.005;\r\n (<AbstractMesh>this._defaultModel.getChildren()[3]).position.z = -notifyObject.value * 0.005;\r\n }\r\n this.onTriggerStateChangedObservable.notifyObservers(notifyObject);\r\n return;\r\n case 2: // secondary trigger\r\n if (!OculusTouchController._IsQuest && this._defaultModel) {\r\n (<AbstractMesh>this._defaultModel.getChildren()[4]).position.x = triggerDirection * notifyObject.value * 0.0035;\r\n }\r\n this.onSecondaryTriggerStateChangedObservable.notifyObservers(notifyObject);\r\n return;\r\n case 3:\r\n if (!OculusTouchController._IsQuest && this._defaultModel) {\r\n if (notifyObject.pressed) {\r\n (<AbstractMesh>this._defaultModel.getChildren()[1]).position.y = -0.001;\r\n } else {\r\n (<AbstractMesh>this._defaultModel.getChildren()[1]).position.y = 0;\r\n }\r\n }\r\n this.onMainButtonStateChangedObservable.notifyObservers(notifyObject);\r\n return;\r\n case 4:\r\n if (!OculusTouchController._IsQuest && this._defaultModel) {\r\n if (notifyObject.pressed) {\r\n (<AbstractMesh>this._defaultModel.getChildren()[2]).position.y = -0.001;\r\n } else {\r\n (<AbstractMesh>this._defaultModel.getChildren()[2]).position.y = 0;\r\n }\r\n }\r\n this.onSecondaryButtonStateChangedObservable.notifyObservers(notifyObject);\r\n return;\r\n case 5:\r\n this.onThumbRestChangedObservable.notifyObservers(notifyObject);\r\n return;\r\n }\r\n }\r\n}\r\n\r\nPoseEnabledControllerHelper._ControllerFactories.push({\r\n canCreate: (gamepadInfo) => {\r\n // If the headset reports being an Oculus Quest, use the Quest controller models\r\n if (EngineStore.LastCreatedEngine && EngineStore.LastCreatedEngine._vrDisplay && EngineStore.LastCreatedEngine._vrDisplay.displayName === \"Oculus Quest\") {\r\n OculusTouchController._IsQuest = true;\r\n }\r\n return gamepadInfo.id.indexOf(\"Oculus Touch\") !== -1;\r\n },\r\n create: (gamepadInfo) => {\r\n return new OculusTouchController(gamepadInfo);\r\n },\r\n});\r\n"]}
|