@onerjs/core 8.27.12 → 8.27.14
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/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/screenSpaceCurvaturePostProcessBlock.d.ts +39 -0
- package/FrameGraph/Node/Blocks/PostProcesses/screenSpaceCurvaturePostProcessBlock.js +86 -0
- package/FrameGraph/Node/Blocks/PostProcesses/screenSpaceCurvaturePostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/sharpenPostProcessBlock.d.ts +34 -0
- package/FrameGraph/Node/Blocks/PostProcesses/sharpenPostProcessBlock.js +74 -0
- package/FrameGraph/Node/Blocks/PostProcesses/sharpenPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/index.d.ts +2 -0
- package/FrameGraph/Node/Blocks/index.js +2 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/customPostProcessTask.d.ts +21 -0
- package/FrameGraph/Tasks/PostProcesses/customPostProcessTask.js +18 -0
- package/FrameGraph/Tasks/PostProcesses/customPostProcessTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/screenSpaceCurvatureTask.d.ts +22 -0
- package/FrameGraph/Tasks/PostProcesses/screenSpaceCurvatureTask.js +27 -0
- package/FrameGraph/Tasks/PostProcesses/screenSpaceCurvatureTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/sharpenTask.d.ts +17 -0
- package/FrameGraph/Tasks/PostProcesses/sharpenTask.js +23 -0
- package/FrameGraph/Tasks/PostProcesses/sharpenTask.js.map +1 -0
- package/FrameGraph/frameGraphTextureManager.d.ts +6 -2
- package/FrameGraph/frameGraphTextureManager.js +22 -8
- package/FrameGraph/frameGraphTextureManager.js.map +1 -1
- package/FrameGraph/index.d.ts +3 -0
- package/FrameGraph/index.js +3 -0
- package/FrameGraph/index.js.map +1 -1
- package/Materials/PBR/openPbrMaterial.d.ts +39 -0
- package/Materials/PBR/openPbrMaterial.js +46 -0
- package/Materials/PBR/openPbrMaterial.js.map +1 -1
- package/Materials/materialHelper.functions.d.ts +1 -7
- package/Materials/materialHelper.functions.js +2 -15
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/materialHelper.functions.pure.d.ts +10 -0
- package/Materials/materialHelper.functions.pure.js +21 -0
- package/Materials/materialHelper.functions.pure.js.map +1 -0
- package/Meshes/geometry.js +6 -6
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/mesh.js +2 -2
- package/Meshes/mesh.js.map +1 -1
- package/PostProcesses/index.d.ts +2 -0
- package/PostProcesses/index.js +2 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.d.ts +6 -2
- package/PostProcesses/screenSpaceCurvaturePostProcess.js +37 -13
- package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
- package/PostProcesses/sharpenPostProcess.d.ts +6 -3
- package/PostProcesses/sharpenPostProcess.js +39 -24
- package/PostProcesses/sharpenPostProcess.js.map +1 -1
- package/PostProcesses/thinCustomPostProcess.d.ts +20 -0
- package/PostProcesses/thinCustomPostProcess.js +32 -0
- package/PostProcesses/thinCustomPostProcess.js.map +1 -0
- package/PostProcesses/thinScreenSpaceCurvaturePostProcess.d.ts +36 -0
- package/PostProcesses/thinScreenSpaceCurvaturePostProcess.js +61 -0
- package/PostProcesses/thinScreenSpaceCurvaturePostProcess.js.map +1 -0
- package/PostProcesses/thinSharpenPostProcess.d.ts +40 -0
- package/PostProcesses/thinSharpenPostProcess.js +64 -0
- package/PostProcesses/thinSharpenPostProcess.js.map +1 -0
- package/Rendering/objectRenderer.js +3 -1
- package/Rendering/objectRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrDielectricReflectance.js +8 -9
- package/Shaders/ShadersInclude/openpbrDielectricReflectance.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrDirectLighting.js +13 -6
- package/Shaders/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js +10 -2
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js +7 -1
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrFragmentSamplersDeclaration.js +2 -0
- package/Shaders/ShadersInclude/openpbrFragmentSamplersDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrThinFilmLayerData.d.ts +5 -0
- package/Shaders/ShadersInclude/openpbrThinFilmLayerData.js +27 -0
- package/Shaders/ShadersInclude/openpbrThinFilmLayerData.js.map +1 -0
- package/Shaders/ShadersInclude/openpbrUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/openpbrUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.js +6 -0
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.js.map +1 -1
- package/Shaders/openpbr.fragment.d.ts +1 -0
- package/Shaders/openpbr.fragment.js +7 -1
- package/Shaders/openpbr.fragment.js.map +1 -1
- package/Shaders/openpbr.vertex.js +4 -0
- package/Shaders/openpbr.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBaseLayerData.js +2 -2
- package/ShadersWGSL/ShadersInclude/openpbrBaseLayerData.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js +13 -6
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js +10 -2
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrFragmentSamplersDeclaration.js +2 -0
- package/ShadersWGSL/ShadersInclude/openpbrFragmentSamplersDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrThinFilmLayerData.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/openpbrThinFilmLayerData.js +27 -0
- package/ShadersWGSL/ShadersInclude/openpbrThinFilmLayerData.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrUboDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +3 -3
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/ShadersWGSL/openpbr.fragment.d.ts +1 -0
- package/ShadersWGSL/openpbr.fragment.js +7 -1
- package/ShadersWGSL/openpbr.fragment.js.map +1 -1
- package/ShadersWGSL/openpbr.vertex.js +4 -0
- package/ShadersWGSL/openpbr.vertex.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +1 -1
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/screenSpaceCurvature.fragment.d.ts +5 -0
- package/ShadersWGSL/screenSpaceCurvature.fragment.js +25 -0
- package/ShadersWGSL/screenSpaceCurvature.fragment.js.map +1 -0
- package/Sprites/spriteRenderer.js +1 -1
- package/Sprites/spriteRenderer.js.map +1 -1
- package/XR/motionController/index.d.ts +1 -0
- package/XR/motionController/index.js +1 -0
- package/XR/motionController/index.js.map +1 -1
- package/XR/motionController/webXRMotionControllerManager.js +1 -0
- package/XR/motionController/webXRMotionControllerManager.js.map +1 -1
- package/XR/motionController/webXROculusHandController.d.ts +25 -0
- package/XR/motionController/webXROculusHandController.js +246 -0
- package/XR/motionController/webXROculusHandController.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { WebXRAbstractMotionController } from "./webXRAbstractMotionController.js";
|
|
2
|
+
import { WebXRMotionControllerManager } from "./webXRMotionControllerManager.js";
|
|
3
|
+
/**
|
|
4
|
+
* Oculus hand controller class that supports microgestures
|
|
5
|
+
*/
|
|
6
|
+
export class WebXROculusHandController extends WebXRAbstractMotionController {
|
|
7
|
+
/**
|
|
8
|
+
* Create a new hand controller object, without loading a controller model
|
|
9
|
+
* @param scene the scene to use to create this controller
|
|
10
|
+
* @param gamepadObject the corresponding gamepad object
|
|
11
|
+
* @param handedness the handedness of the controller
|
|
12
|
+
*/
|
|
13
|
+
constructor(scene, gamepadObject, handedness) {
|
|
14
|
+
// Don't load the controller model - for now, hands have no real model.
|
|
15
|
+
super(scene, OculusHandProfile[handedness], gamepadObject, handedness, true);
|
|
16
|
+
this.profileId = "oculus-hand";
|
|
17
|
+
}
|
|
18
|
+
_getFilenameAndPath() {
|
|
19
|
+
return {
|
|
20
|
+
filename: "generic.babylon",
|
|
21
|
+
path: "https://controllers.babylonjs.com/generic/",
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
_getModelLoadingConstraints() {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
_processLoadedModel(_meshes) {
|
|
28
|
+
// no-op
|
|
29
|
+
}
|
|
30
|
+
_setRootMesh(meshes) {
|
|
31
|
+
// no-op
|
|
32
|
+
}
|
|
33
|
+
_updateModel() {
|
|
34
|
+
// no-op
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// register the profiles
|
|
38
|
+
WebXRMotionControllerManager.RegisterController("oculus-hand", (xrInput, scene) => {
|
|
39
|
+
return new WebXROculusHandController(scene, xrInput.gamepad, xrInput.handedness);
|
|
40
|
+
});
|
|
41
|
+
// https://github.com/immersive-web/webxr-input-profiles/blob/main/packages/registry/profiles/oculus/oculus-hand.json
|
|
42
|
+
const OculusHandProfile = {
|
|
43
|
+
left: {
|
|
44
|
+
selectComponentId: "xr-standard-trigger",
|
|
45
|
+
components: {
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
47
|
+
"xr-standard-trigger": {
|
|
48
|
+
type: "trigger",
|
|
49
|
+
gamepadIndices: {
|
|
50
|
+
button: 0,
|
|
51
|
+
},
|
|
52
|
+
rootNodeName: "xr-standard-trigger",
|
|
53
|
+
visualResponses: {},
|
|
54
|
+
},
|
|
55
|
+
menu: {
|
|
56
|
+
type: "button",
|
|
57
|
+
gamepadIndices: {
|
|
58
|
+
button: 4,
|
|
59
|
+
},
|
|
60
|
+
rootNodeName: "menu",
|
|
61
|
+
visualResponses: {},
|
|
62
|
+
},
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
64
|
+
"swipe-left": {
|
|
65
|
+
type: "button",
|
|
66
|
+
gamepadIndices: {
|
|
67
|
+
button: 5,
|
|
68
|
+
},
|
|
69
|
+
rootNodeName: "swipe-left",
|
|
70
|
+
visualResponses: {},
|
|
71
|
+
},
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
73
|
+
"swipe-right": {
|
|
74
|
+
type: "button",
|
|
75
|
+
gamepadIndices: {
|
|
76
|
+
button: 6,
|
|
77
|
+
},
|
|
78
|
+
rootNodeName: "swipe-right",
|
|
79
|
+
visualResponses: {},
|
|
80
|
+
},
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
82
|
+
"swipe-forward": {
|
|
83
|
+
type: "button",
|
|
84
|
+
gamepadIndices: {
|
|
85
|
+
button: 7,
|
|
86
|
+
},
|
|
87
|
+
rootNodeName: "swipe-forward",
|
|
88
|
+
visualResponses: {},
|
|
89
|
+
},
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
91
|
+
"swipe-backward": {
|
|
92
|
+
type: "button",
|
|
93
|
+
gamepadIndices: {
|
|
94
|
+
button: 8,
|
|
95
|
+
},
|
|
96
|
+
rootNodeName: "swipe-backward",
|
|
97
|
+
visualResponses: {},
|
|
98
|
+
},
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
100
|
+
"tap-thumb": {
|
|
101
|
+
type: "button",
|
|
102
|
+
gamepadIndices: {
|
|
103
|
+
button: 9,
|
|
104
|
+
},
|
|
105
|
+
rootNodeName: "tap-thumb",
|
|
106
|
+
visualResponses: {},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
gamepadMapping: "xr-standard",
|
|
110
|
+
rootNodeName: "oculus-hand-left",
|
|
111
|
+
assetPath: "left.glb",
|
|
112
|
+
},
|
|
113
|
+
right: {
|
|
114
|
+
selectComponentId: "xr-standard-trigger",
|
|
115
|
+
components: {
|
|
116
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
117
|
+
"xr-standard-trigger": {
|
|
118
|
+
type: "trigger",
|
|
119
|
+
gamepadIndices: {
|
|
120
|
+
button: 0,
|
|
121
|
+
},
|
|
122
|
+
rootNodeName: "xr-standard-trigger",
|
|
123
|
+
visualResponses: {},
|
|
124
|
+
},
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
126
|
+
"swipe-left": {
|
|
127
|
+
type: "button",
|
|
128
|
+
gamepadIndices: {
|
|
129
|
+
button: 5,
|
|
130
|
+
},
|
|
131
|
+
rootNodeName: "swipe-left",
|
|
132
|
+
visualResponses: {},
|
|
133
|
+
},
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
135
|
+
"swipe-right": {
|
|
136
|
+
type: "button",
|
|
137
|
+
gamepadIndices: {
|
|
138
|
+
button: 6,
|
|
139
|
+
},
|
|
140
|
+
rootNodeName: "swipe-right",
|
|
141
|
+
visualResponses: {},
|
|
142
|
+
},
|
|
143
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
144
|
+
"swipe-forward": {
|
|
145
|
+
type: "button",
|
|
146
|
+
gamepadIndices: {
|
|
147
|
+
button: 7,
|
|
148
|
+
},
|
|
149
|
+
rootNodeName: "swipe-forward",
|
|
150
|
+
visualResponses: {},
|
|
151
|
+
},
|
|
152
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
153
|
+
"swipe-backward": {
|
|
154
|
+
type: "button",
|
|
155
|
+
gamepadIndices: {
|
|
156
|
+
button: 8,
|
|
157
|
+
},
|
|
158
|
+
rootNodeName: "swipe-backward",
|
|
159
|
+
visualResponses: {},
|
|
160
|
+
},
|
|
161
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
162
|
+
"tap-thumb": {
|
|
163
|
+
type: "button",
|
|
164
|
+
gamepadIndices: {
|
|
165
|
+
button: 9,
|
|
166
|
+
},
|
|
167
|
+
rootNodeName: "tap-thumb",
|
|
168
|
+
visualResponses: {},
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
gamepadMapping: "xr-standard",
|
|
172
|
+
rootNodeName: "oculus-hand-right",
|
|
173
|
+
assetPath: "right.glb",
|
|
174
|
+
},
|
|
175
|
+
none: {
|
|
176
|
+
selectComponentId: "xr-standard-trigger",
|
|
177
|
+
components: {
|
|
178
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
179
|
+
"xr-standard-trigger": {
|
|
180
|
+
type: "trigger",
|
|
181
|
+
gamepadIndices: {
|
|
182
|
+
button: 0,
|
|
183
|
+
},
|
|
184
|
+
rootNodeName: "xr-standard-trigger",
|
|
185
|
+
visualResponses: {},
|
|
186
|
+
},
|
|
187
|
+
menu: {
|
|
188
|
+
type: "button",
|
|
189
|
+
gamepadIndices: {
|
|
190
|
+
button: 4,
|
|
191
|
+
},
|
|
192
|
+
rootNodeName: "menu",
|
|
193
|
+
visualResponses: {},
|
|
194
|
+
},
|
|
195
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
196
|
+
"swipe-left": {
|
|
197
|
+
type: "button",
|
|
198
|
+
gamepadIndices: {
|
|
199
|
+
button: 5,
|
|
200
|
+
},
|
|
201
|
+
rootNodeName: "swipe-left",
|
|
202
|
+
visualResponses: {},
|
|
203
|
+
},
|
|
204
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
205
|
+
"swipe-right": {
|
|
206
|
+
type: "button",
|
|
207
|
+
gamepadIndices: {
|
|
208
|
+
button: 6,
|
|
209
|
+
},
|
|
210
|
+
rootNodeName: "swipe-right",
|
|
211
|
+
visualResponses: {},
|
|
212
|
+
},
|
|
213
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
214
|
+
"swipe-forward": {
|
|
215
|
+
type: "button",
|
|
216
|
+
gamepadIndices: {
|
|
217
|
+
button: 7,
|
|
218
|
+
},
|
|
219
|
+
rootNodeName: "swipe-forward",
|
|
220
|
+
visualResponses: {},
|
|
221
|
+
},
|
|
222
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
223
|
+
"swipe-backward": {
|
|
224
|
+
type: "button",
|
|
225
|
+
gamepadIndices: {
|
|
226
|
+
button: 8,
|
|
227
|
+
},
|
|
228
|
+
rootNodeName: "swipe-backward",
|
|
229
|
+
visualResponses: {},
|
|
230
|
+
},
|
|
231
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
232
|
+
"tap-thumb": {
|
|
233
|
+
type: "button",
|
|
234
|
+
gamepadIndices: {
|
|
235
|
+
button: 9,
|
|
236
|
+
},
|
|
237
|
+
rootNodeName: "tap-thumb",
|
|
238
|
+
visualResponses: {},
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
gamepadMapping: "xr-standard",
|
|
242
|
+
rootNodeName: "oculus-hand-none",
|
|
243
|
+
assetPath: "none.glb",
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
//# sourceMappingURL=webXROculusHandController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webXROculusHandController.js","sourceRoot":"","sources":["../../../../../dev/core/src/XR/motionController/webXROculusHandController.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAGhF,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,6BAA6B;IAGxE;;;;;OAKG;IACH,YAAY,KAAY,EAAE,aAA6C,EAAE,UAAsC;QAC3G,uEAA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,aAAa,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,cAAc,EAAE;oBACZ,MAAM,EAAE,CAAC;iBACZ;gBACD,YAAY,EAAE,aAAa;gBAC3B,eAAe,EAAE,EAAE;aACtB;YACD,gEAAgE;YAChE,eAAe,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,cAAc,EAAE;oBACZ,MAAM,EAAE,CAAC;iBACZ;gBACD,YAAY,EAAE,eAAe;gBAC7B,eAAe,EAAE,EAAE;aACtB;YACD,gEAAgE;YAChE,gBAAgB,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,cAAc,EAAE;oBACZ,MAAM,EAAE,CAAC;iBACZ;gBACD,YAAY,EAAE,gBAAgB;gBAC9B,eAAe,EAAE,EAAE;aACtB;YACD,gEAAgE;YAChE,WAAW,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,cAAc,EAAE;oBACZ,MAAM,EAAE,CAAC;iBACZ;gBACD,YAAY,EAAE,WAAW;gBACzB,eAAe,EAAE,EAAE;aACtB;SACJ;QACD,cAAc,EAAE,aAAa;QAC7B,YAAY,EAAE,kBAAkB;QAChC,SAAS,EAAE,UAAU;KACxB;CACJ,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport type { IMotionControllerLayoutMap, IMinimalMotionControllerObject, MotionControllerHandedness } from \"./webXRAbstractMotionController\";\r\nimport { WebXRAbstractMotionController } from \"./webXRAbstractMotionController\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport { WebXRMotionControllerManager } from \"./webXRMotionControllerManager\";\r\n\r\n/**\r\n * Oculus hand controller class that supports microgestures\r\n */\r\nexport class WebXROculusHandController extends WebXRAbstractMotionController {\r\n public profileId = \"oculus-hand\";\r\n\r\n /**\r\n * Create a new hand controller object, without loading a controller model\r\n * @param scene the scene to use to create this controller\r\n * @param gamepadObject the corresponding gamepad object\r\n * @param handedness the handedness of the controller\r\n */\r\n constructor(scene: Scene, gamepadObject: IMinimalMotionControllerObject, handedness: MotionControllerHandedness) {\r\n // Don't load the controller model - for now, hands have no real model.\r\n super(scene, OculusHandProfile[handedness], gamepadObject, handedness, true);\r\n }\r\n\r\n protected _getFilenameAndPath(): { filename: string; path: string } {\r\n return {\r\n filename: \"generic.babylon\",\r\n path: \"https://controllers.babylonjs.com/generic/\",\r\n };\r\n }\r\n\r\n protected _getModelLoadingConstraints(): boolean {\r\n return true;\r\n }\r\n\r\n protected _processLoadedModel(_meshes: AbstractMesh[]): void {\r\n // no-op\r\n }\r\n\r\n protected _setRootMesh(meshes: AbstractMesh[]): void {\r\n // no-op\r\n }\r\n\r\n protected _updateModel(): void {\r\n // no-op\r\n }\r\n}\r\n\r\n// register the profiles\r\nWebXRMotionControllerManager.RegisterController(\"oculus-hand\", (xrInput: XRInputSource, scene: Scene) => {\r\n return new WebXROculusHandController(scene, <any>xrInput.gamepad, xrInput.handedness);\r\n});\r\n\r\n// https://github.com/immersive-web/webxr-input-profiles/blob/main/packages/registry/profiles/oculus/oculus-hand.json\r\nconst OculusHandProfile: IMotionControllerLayoutMap = {\r\n left: {\r\n selectComponentId: \"xr-standard-trigger\",\r\n components: {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"xr-standard-trigger\": {\r\n type: \"trigger\",\r\n gamepadIndices: {\r\n button: 0,\r\n },\r\n rootNodeName: \"xr-standard-trigger\",\r\n visualResponses: {},\r\n },\r\n menu: {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 4,\r\n },\r\n rootNodeName: \"menu\",\r\n visualResponses: {},\r\n },\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"swipe-left\": {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 5,\r\n },\r\n rootNodeName: \"swipe-left\",\r\n visualResponses: {},\r\n },\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"swipe-right\": {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 6,\r\n },\r\n rootNodeName: \"swipe-right\",\r\n visualResponses: {},\r\n },\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"swipe-forward\": {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 7,\r\n },\r\n rootNodeName: \"swipe-forward\",\r\n visualResponses: {},\r\n },\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"swipe-backward\": {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 8,\r\n },\r\n rootNodeName: \"swipe-backward\",\r\n visualResponses: {},\r\n },\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"tap-thumb\": {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 9,\r\n },\r\n rootNodeName: \"tap-thumb\",\r\n visualResponses: {},\r\n },\r\n },\r\n gamepadMapping: \"xr-standard\",\r\n rootNodeName: \"oculus-hand-left\",\r\n assetPath: \"left.glb\",\r\n },\r\n right: {\r\n selectComponentId: \"xr-standard-trigger\",\r\n components: {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"xr-standard-trigger\": {\r\n type: \"trigger\",\r\n gamepadIndices: {\r\n button: 0,\r\n },\r\n rootNodeName: \"xr-standard-trigger\",\r\n visualResponses: {},\r\n },\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"swipe-left\": {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 5,\r\n },\r\n rootNodeName: \"swipe-left\",\r\n visualResponses: {},\r\n },\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"swipe-right\": {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 6,\r\n },\r\n rootNodeName: \"swipe-right\",\r\n visualResponses: {},\r\n },\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"swipe-forward\": {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 7,\r\n },\r\n rootNodeName: \"swipe-forward\",\r\n visualResponses: {},\r\n },\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"swipe-backward\": {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 8,\r\n },\r\n rootNodeName: \"swipe-backward\",\r\n visualResponses: {},\r\n },\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"tap-thumb\": {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 9,\r\n },\r\n rootNodeName: \"tap-thumb\",\r\n visualResponses: {},\r\n },\r\n },\r\n gamepadMapping: \"xr-standard\",\r\n rootNodeName: \"oculus-hand-right\",\r\n assetPath: \"right.glb\",\r\n },\r\n none: {\r\n selectComponentId: \"xr-standard-trigger\",\r\n components: {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"xr-standard-trigger\": {\r\n type: \"trigger\",\r\n gamepadIndices: {\r\n button: 0,\r\n },\r\n rootNodeName: \"xr-standard-trigger\",\r\n visualResponses: {},\r\n },\r\n menu: {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 4,\r\n },\r\n rootNodeName: \"menu\",\r\n visualResponses: {},\r\n },\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"swipe-left\": {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 5,\r\n },\r\n rootNodeName: \"swipe-left\",\r\n visualResponses: {},\r\n },\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"swipe-right\": {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 6,\r\n },\r\n rootNodeName: \"swipe-right\",\r\n visualResponses: {},\r\n },\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"swipe-forward\": {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 7,\r\n },\r\n rootNodeName: \"swipe-forward\",\r\n visualResponses: {},\r\n },\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"swipe-backward\": {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 8,\r\n },\r\n rootNodeName: \"swipe-backward\",\r\n visualResponses: {},\r\n },\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"tap-thumb\": {\r\n type: \"button\",\r\n gamepadIndices: {\r\n button: 9,\r\n },\r\n rootNodeName: \"tap-thumb\",\r\n visualResponses: {},\r\n },\r\n },\r\n gamepadMapping: \"xr-standard\",\r\n rootNodeName: \"oculus-hand-none\",\r\n assetPath: \"none.glb\",\r\n },\r\n};\r\n"]}
|