Avoid cycle in schema modules

This commit is contained in:
Tony Garnock-Jones 2023-02-02 21:58:53 +01:00
parent 70436ffb01
commit cfefa8d39a
4 changed files with 8 additions and 9 deletions

View File

@ -8,12 +8,7 @@ PortalDestination =
Gravity = <gravity @direction shapes.Vector3> .
AmbientSound = <ambient-sound @name string @spec SoundSpec> .
SoundSpec =
/ @stream <stream @url string>
/ @loop <loop @url string>
.
AmbientSound = <ambient-sound @name string @spec shapes.SoundSpec> .
; Message
Touch = <touch @subject string @object string> .

View File

@ -34,7 +34,11 @@ Color =
/ @transparent <color @r double @g double @b double @alpha double @shape Shape>
.
Sound = <sound @spec scene.SoundSpec @shape Shape> .
Sound = <sound @spec SoundSpec @shape Shape> .
SoundSpec =
/ @stream <stream @url string>
/ @loop <loop @url string>
.
Name = <name @base string @shape Shape> .

View File

@ -34,7 +34,7 @@ function interpretScene(myId: string, runningEngine: RunningEngine, rootMesh: Me
during SceneProtocol.AmbientSound({
"name": $name: string,
"spec": $spec: SceneProtocol.SoundSpec
"spec": $spec: Shapes.SoundSpec
}) => spawn named `sound:${name}` {
const sound = buildSound(name, runningEngine.scene, spec, false);
on stop sound.dispose();

View File

@ -191,7 +191,7 @@ export function buildMesh(
}
}
export function buildSound(name: string, scene: Scene, spec: SceneProtocol.SoundSpec, spatial: boolean): Sound {
export function buildSound(name: string, scene: Scene, spec: Shapes.SoundSpec, spatial: boolean): Sound {
const options: ISoundOptions = {
loop: true,
autoplay: true,