Skip to content

Commit 4770f98

Browse files
committed
maintenance: Update aframe-types to 0.9.1
1 parent c5747f3 commit 4770f98

15 files changed

+73
-97
lines changed

effekseer/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
"@rollup/plugin-typescript": "^11.1.1",
2929
"@types/animejs": "3.1.0",
3030
"@types/three": "0.147.1",
31-
"aframe-types": "0.8.22",
32-
"aframe-typescript": "0.8.2",
31+
"aframe-types": "0.9.1",
3332
"concurrently": "^7.1.0",
3433
"rimraf": "^5.0.1",
3534
"rollup": "^2.71.1",

effekseer/rollup.config.dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default [
66
{
77
input: 'src/main.ts',
88
plugins: [
9-
nodeResolve({ resolveOnly: ['aframe-typescript'] }),
9+
nodeResolve(),
1010
typescript({ sourceMap: true }),
1111
],
1212
external: ['aframe', 'effekseer'],

effekseer/rollup.config.prod.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default [
88
{
99
input: 'src/main.ts',
1010
plugins: [
11-
nodeResolve({ resolveOnly: ['aframe-typescript'] }),
11+
nodeResolve(),
1212
typescript({ compilerOptions: { declaration: true, declarationDir: 'typings' } }),
1313
terser(),
1414
],

effekseer/src/effekseer.component.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
import * as AFRAME from 'aframe';
22
import * as THREE from 'three';
33
import 'effekseer';
4-
import { strict } from 'aframe-typescript';
54

65
/**
76
* Component for rendering an Effekseer effect.
87
*/
9-
export const EffekseerComponent = AFRAME.registerComponent('effekseer', strict<{
10-
effect: effekseer.EffekseerEffect|null,
11-
handle: effekseer.EffekseerHandle|null,
12-
13-
tempMatrixArray: Float32Array,
14-
targetLocation: THREE.Vector3,
15-
}, 'effekseer'>().component({
8+
export const EffekseerComponent = AFRAME.registerComponent('effekseer', {
169
schema: {
1710
/** The .efk or .efkpkg file to use */
1811
src: { type: 'asset' },
@@ -24,6 +17,13 @@ export const EffekseerComponent = AFRAME.registerComponent('effekseer', strict<{
2417
/** Whether or not to update the effects scale, position and rotation each tick */
2518
dynamic: { type: 'boolean', default: false },
2619
},
20+
__fields: {} as {
21+
effect: effekseer.EffekseerEffect|null,
22+
handle: effekseer.EffekseerHandle|null,
23+
24+
tempMatrixArray: Float32Array,
25+
targetLocation: THREE.Vector3,
26+
},
2727
init: function() {
2828
this.tempMatrixArray = new Float32Array(16);
2929
this.targetLocation = new THREE.Vector3();
@@ -120,7 +120,7 @@ export const EffekseerComponent = AFRAME.registerComponent('effekseer', strict<{
120120
remove: function() {
121121
this.handle?.stop();
122122
}
123-
}));
123+
});
124124

125125
declare module "aframe" {
126126
interface Components {

effekseer/src/effekseer.system.ts

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as AFRAME from 'aframe';
2-
import { strict } from 'aframe-typescript';
32
import * as THREE from 'three';
43
import 'effekseer';
54
import * as zip from '@zip.js/zip.js';
@@ -25,21 +24,23 @@ const createUnzip = async function(buffer: Uint8Array) {
2524
/**
2625
* System for managing the Effekseer context and handling rendering of the effects
2726
*/
28-
export const EffekseerSystem = AFRAME.registerSystem('effekseer', strict<{
29-
getContext: Promise<effekseer.EffekseerContext>,
30-
context: effekseer.EffekseerContext,
31-
effects: Map<string, effekseer.EffekseerEffect>,
32-
33-
fileLoader: THREE.FileLoader,
34-
sentinel: THREE.Mesh,
35-
}>().system({
27+
export const EffekseerSystem = AFRAME.registerSystem('effekseer', {
3628
schema: {
3729
/** URL to the effekseer.wasm file */
3830
wasmPath: { type: "string" },
3931
/** Frame-rate at which the effects are played back */
4032
frameRate: { type: "number", default: 60.0 }
4133
},
4234

35+
__fields: {} as {
36+
getContext: Promise<effekseer.EffekseerContext>,
37+
context: effekseer.EffekseerContext,
38+
effects: Map<string, effekseer.EffekseerEffect>,
39+
40+
fileLoader: THREE.FileLoader,
41+
sentinel: THREE.Mesh,
42+
},
43+
4344
init: function() {
4445
this.effects = new Map();
4546
this.fileLoader = new THREE.FileLoader().setResponseType('arraybuffer');
@@ -130,7 +131,7 @@ export const EffekseerSystem = AFRAME.registerSystem('effekseer', strict<{
130131
}
131132
this.context.update(dt/1000.0 * this.data.frameRate);
132133
}
133-
}));
134+
});
134135

135136
declare module "aframe" {
136137
interface Systems {

motion-controller/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
"@rollup/plugin-typescript": "^11.1.1",
2929
"@types/animejs": "3.1.0",
3030
"@types/three": "0.147.1",
31-
"aframe-types": "0.8.22",
32-
"aframe-typescript": "0.8.2",
31+
"aframe-types": "0.9.1",
3332
"concurrently": "^7.1.0",
3433
"esbuild": "^0.18.17",
3534
"rimraf": "^5.0.1",

motion-controller/rollup.config.dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default [
66
{
77
input: 'src/main.ts',
88
plugins: [
9-
nodeResolve({ resolveOnly: ['aframe-typescript', '@webxr-input-profiles/motion-controllers'] }),
9+
nodeResolve({ resolveOnly: ['@webxr-input-profiles/motion-controllers'] }),
1010
esbuild(),
1111
],
1212
external: ['aframe'],

motion-controller/src/motion-controller-model.component.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as AFRAME from 'aframe';
22
import * as THREE from 'three';
3-
import { strict } from 'aframe-typescript';
43
import { MotionController, VisualResponse } from '@webxr-input-profiles/motion-controllers';
54
import { hologramMaterialFromStandardMaterial, occluderMaterialFromStandardMaterial, phongMaterialFromStandardMaterial } from './utils';
65
import { HAND_JOINT_NAMES } from './hand-joint-names';
@@ -17,21 +16,22 @@ type EnhancedVisualResponse = VisualResponse & {
1716
maxNode?: THREE.Object3D
1817
};
1918

20-
const MotionControllerModelComponent = AFRAME.registerComponent('motion-controller-model', strict<{
21-
motionControllerSystem: AFRAME.Systems['motion-controller'],
22-
inputSourceRecord: InputSourceRecord|null,
23-
motionController: MotionController|null,
24-
componentMeshes: Map<string, Array<{mesh: THREE.Mesh, originalColor: THREE.Color}>>,
25-
// Only relevant for hand tracking models
26-
handJoints: Array<THREE.Object3D|undefined>
27-
}>().component({
19+
const MotionControllerModelComponent = AFRAME.registerComponent('motion-controller-model', {
2820
schema: {
2921
hand: { type: 'string', oneOf: ['left', 'right'], default: 'left' },
3022
overrideMaterial: { type: 'string', oneOf: ['none', 'phong', 'occluder'], default: 'phong'},
3123
overrideHandMaterial: { type: 'string', oneOf: ['none', 'phong', 'occluder', 'hologram'], default: 'hologram'},
3224
buttonTouchColor: { type: 'color', default: '#8AB' },
3325
buttonPressColor: { type: 'color', default: '#2DF' }
3426
},
27+
__fields: {} as {
28+
motionControllerSystem: AFRAME.Systems['motion-controller'],
29+
inputSourceRecord: InputSourceRecord|null,
30+
motionController: MotionController|null,
31+
componentMeshes: Map<string, Array<{mesh: THREE.Mesh, originalColor: THREE.Color}>>,
32+
// Only relevant for hand tracking models
33+
handJoints: Array<THREE.Object3D|undefined>
34+
},
3535
init: function() {
3636
this.motionControllerSystem = this.el.sceneEl.systems['motion-controller'];
3737
this.componentMeshes = new Map();
@@ -47,7 +47,7 @@ const MotionControllerModelComponent = AFRAME.registerComponent('motion-controll
4747
return;
4848
}
4949
this.el.setObject3D('mesh', gltf.scene);
50-
const isHandModel = this.motionController.id === 'generic-hand';
50+
const isHandModel = this.motionController?.id === 'generic-hand';
5151

5252
// Traverse the mesh to change materials and extract references to hand joints
5353
gltf.scene.traverse(child => {
@@ -87,7 +87,7 @@ const MotionControllerModelComponent = AFRAME.registerComponent('motion-controll
8787
});
8888

8989
this.componentMeshes.clear();
90-
Object.values(this.motionController.components).forEach((component) => {
90+
Object.values(this.motionController!.components).forEach((component) => {
9191
// Can't traverse the rootNodes of the components, as these are hardly ever correct.
9292
// See: https://github.com/immersive-web/webxr-input-profiles/issues/249
9393
const componentMeshes: Array<{mesh: THREE.Mesh, originalColor: THREE.Color}> = [];
@@ -203,7 +203,7 @@ const MotionControllerModelComponent = AFRAME.registerComponent('motion-controll
203203
});
204204
}
205205
}
206-
}));
206+
});
207207

208208
declare module "aframe" {
209209
export interface Components {

motion-controller/src/motion-controller-space.component.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import * as AFRAME from 'aframe';
2-
import { strict } from 'aframe-typescript';
32

4-
const MotionControllerSpaceComponent = AFRAME.registerComponent('motion-controller-space', strict<{
5-
motionControllerSystem: AFRAME.Systems['motion-controller'],
6-
inputSource: XRInputSource|undefined,
7-
}>().component({
3+
const MotionControllerSpaceComponent = AFRAME.registerComponent('motion-controller-space', {
84
schema: {
95
hand: { type: 'string', oneOf: ['left', 'right'], default: 'left' },
106
space: { type: 'string', oneOf: ['gripSpace', 'targetRaySpace'], default: 'targetRaySpace' },
117
},
8+
__fields: {} as {
9+
motionControllerSystem: AFRAME.Systems['motion-controller'],
10+
inputSource: XRInputSource|undefined,
11+
},
1212
init: function() {
1313
this.motionControllerSystem = this.el.sceneEl.systems['motion-controller'];
1414
this.el.sceneEl.addEventListener('motion-controller-change', _event => {
@@ -35,7 +35,7 @@ const MotionControllerSpaceComponent = AFRAME.registerComponent('motion-controll
3535
this.el.object3D.matrix.decompose(this.el.object3D.position, this.el.object3D.quaternion, this.el.object3D.scale);
3636
}
3737
}
38-
}));
38+
});
3939

4040
declare module "aframe" {
4141
export interface Components {

motion-controller/src/motion-controller.system.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as AFRAME from 'aframe';
22
import { SceneEvent } from 'aframe';
3-
import { strict } from 'aframe-typescript';
43
import { Component, fetchProfile, MotionController } from '@webxr-input-profiles/motion-controllers';
54

65
const DEFAULT_INPUT_PROFILE_ASSETS_URI = 'https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets/dist/profiles';
@@ -13,16 +12,7 @@ export interface InputSourceRecord {
1312
jointState?: {poses: Float32Array, radii: Float32Array},
1413
};
1514

16-
const MotionControllerSystem = AFRAME.registerSystem('motion-controller', strict<{
17-
/* Currently active XR session */
18-
xrSession: XRSession|null;
19-
/* List of active input sources */
20-
inputSources: Array<InputSourceRecord>
21-
22-
/* Dedicated slots for left/right hand for convenience */
23-
left: InputSourceRecord|null,
24-
right: InputSourceRecord|null,
25-
}>().system({
15+
const MotionControllerSystem = AFRAME.registerSystem('motion-controller', {
2616
schema: {
2717
/** Base URI for fetching profiles and controller models */
2818
profilesUri: { type: 'string', default: DEFAULT_INPUT_PROFILE_ASSETS_URI },
@@ -31,6 +21,16 @@ const MotionControllerSystem = AFRAME.registerSystem('motion-controller', strict
3121
/** Whether or not input sources representing hands should be reported or not */
3222
enableHands: { type: 'boolean', default: true },
3323
},
24+
__fields: {} as {
25+
/* Currently active XR session */
26+
xrSession: XRSession|null;
27+
/* List of active input sources */
28+
inputSources: Array<InputSourceRecord>
29+
30+
/* Dedicated slots for left/right hand for convenience */
31+
left: InputSourceRecord|null,
32+
right: InputSourceRecord|null,
33+
},
3434
init: function() {
3535
this.inputSources = [];
3636
this.left = null;
@@ -188,7 +188,7 @@ const MotionControllerSystem = AFRAME.registerSystem('motion-controller', strict
188188
// FIXME: Perhaps only fetch radii once or upon request(?)
189189
(xrFrame as any).fillJointRadii(hand.values(), inputSourceRecord.jointState!.radii);
190190
}
191-
}));
191+
});
192192

193193
export interface ButtonEventDetails {
194194
inputSource: XRInputSource;

motion-controller/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"declaration": false,
2020
"rootDir": "src",
2121
"paths": {
22-
"aframe": ["./node_modules/aframe-types"]
22+
"aframe": ["../node_modules/aframe-types"]
2323
}
2424
},
2525
"include": ["src"],

screen-fade/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@compodoc/live-server": "1.2.3",
3636
"@types/animejs": "3.1.0",
3737
"@types/three": "0.147.1",
38-
"aframe-types": "0.8.14",
38+
"aframe-types": "0.9.1",
3939
"concurrently": "^7.1.0",
4040
"rollup": "^2.71.1",
4141
"rollup-plugin-terser": "^7.0.2",

sky-background/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@compodoc/live-server": "1.2.3",
3636
"@types/animejs": "3.1.0",
3737
"@types/three": "0.147.1",
38-
"aframe-types": "0.8.22",
38+
"aframe-types": "0.9.1",
3939
"concurrently": "^7.1.0",
4040
"rollup": "^2.71.1",
4141
"rollup-plugin-terser": "^7.0.2",

sky-background/yarn.lock

+6-6
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ __metadata:
6363
"@compodoc/live-server": "npm:1.2.3"
6464
"@types/animejs": "npm:3.1.0"
6565
"@types/three": "npm:0.147.1"
66-
aframe-types: "npm:0.8.22"
66+
aframe-types: "npm:0.9.1"
6767
concurrently: "npm:^7.1.0"
6868
rollup: "npm:^2.71.1"
6969
rollup-plugin-terser: "npm:^7.0.2"
@@ -213,13 +213,13 @@ __metadata:
213213
languageName: node
214214
linkType: hard
215215

216-
"aframe-types@npm:0.8.22":
217-
version: 0.8.22
218-
resolution: "aframe-types@npm:0.8.22"
216+
"aframe-types@npm:0.9.1":
217+
version: 0.9.1
218+
resolution: "aframe-types@npm:0.9.1"
219219
peerDependencies:
220220
"@types/animejs": 3.1.0
221-
"@types/three": 0.147.1
222-
checksum: 10/ecf7cd1f14af89dc84450281e1544a9fbf75222cf810c407fbdf3b0cfd3ada82b65a9c13040f5f9f91d0767c2d309eb4c535b7853257c0158a238d27f14b857e
221+
"@types/three": 0.164.0
222+
checksum: 10/c671f56599c34e0f4daa8123a90429d3df3812acfbd6df0350adde1cf7c0901432a49bae718043193df4db3718865cea3b8da287bfd2a19f9375af83d056d4cd
223223
languageName: node
224224
linkType: hard
225225

0 commit comments

Comments
 (0)