@adatechnology/game-audio 0.2.1 → 0.3.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/dist/index.js CHANGED
@@ -1947,25 +1947,23 @@ function createAudioTestModule(options = {}) {
1947
1947
  if (value > 0) loop?.set({ frequency: value });
1948
1948
  }
1949
1949
  };
1950
- const items = () => [
1951
- {
1952
- id: PROBE_ID,
1953
- name: text.probe,
1954
- movable: false,
1955
- build: (THREE) => {
1956
- const T = THREE;
1957
- const group = new T.Group();
1958
- const post = new T.Mesh(new T.CylinderGeometry(0.04, 0.05, 1.5, 10), new T.MeshStandardMaterial({ color: 4869973 }));
1959
- post.position.set(0, 0.75, 0);
1960
- const speaker = new T.Mesh(new T.BoxGeometry(0.32, 0.4, 0.26), new T.MeshStandardMaterial({ color: 1908772 }));
1961
- speaker.position.set(0, 1.5, 0);
1962
- group.add(post, speaker);
1963
- group.userData[PROBE_ID] = true;
1964
- return group;
1965
- },
1966
- spec: { parts: [{ id: "post", material: "steel", shape: { kind: "box", size: [0.12, 1.7, 0.3] }, position: [0, 0.85, 0], mass: 25, hp: 400 }] }
1967
- }
1968
- ];
1950
+ const items = () => {
1951
+ const probe = options.probe;
1952
+ if (!probe) return [];
1953
+ return [
1954
+ {
1955
+ id: PROBE_ID,
1956
+ name: text.probe,
1957
+ movable: false,
1958
+ build: (THREE) => {
1959
+ const root = probe(THREE);
1960
+ root.userData = root.userData ?? {};
1961
+ root.userData[PROBE_ID] = true;
1962
+ return root;
1963
+ }
1964
+ }
1965
+ ];
1966
+ };
1969
1967
  const controls = () => [
1970
1968
  { kind: "choice", id: "sound", name: text.controls.sound, options: soundOptions(), default: state.sound },
1971
1969
  { kind: "choice", id: "source", name: text.controls.source, hint: text.hints.source, options: [{ id: "bench", name: text.options.bench }, { id: "probe", name: text.options.probe }], default: state.source },
@@ -2042,7 +2040,7 @@ function createAudioTestModule(options = {}) {
2042
2040
  }
2043
2041
  ];
2044
2042
  const area = () => ({
2045
- placements: [{ item: PROBE_ID, position: PROBE_AT, asleep: true }],
2043
+ placements: options.probe ? [{ item: PROBE_ID, position: PROBE_AT, asleep: true }] : [],
2046
2044
  view: { eye: [0, 1.7, 3], target: [0, 1.4, -10] }
2047
2045
  });
2048
2046
  const module = {