@vyr/three 0.0.1 → 0.0.3

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.
Files changed (63) hide show
  1. package/package.json +1 -26
  2. package/src/actor/ComposerServiceActor.ts +7 -6
  3. package/src/actor/HTMLConvertActor.ts +4 -4
  4. package/src/actor/OrbitControllerActor.ts +19 -19
  5. package/src/actor/SceneServiceActor.ts +9 -9
  6. package/src/actor/TransformControllerActor.ts +3 -3
  7. package/src/controls/TransformControls.ts +12 -16
  8. package/src/descriptor/OrbitControllerDescriptor.ts +2 -2
  9. package/src/descriptor/TransformControllerDescriptor.ts +2 -2
  10. package/src/interpreter/ComposerServiceInterpreter.ts +1 -1
  11. package/src/interpreter/GeoMapInterpreter.ts +32 -32
  12. package/src/interpreter/HTMLConvertInterpreter.ts +9 -9
  13. package/src/interpreter/InstancedMeshInterpreter.ts +13 -13
  14. package/src/interpreter/MeshInterpreter.ts +6 -7
  15. package/src/interpreter/ModelInterpreter.ts +10 -10
  16. package/src/interpreter/NodeInterpreter.ts +19 -19
  17. package/src/interpreter/OrbitControllerInterpreter.ts +20 -20
  18. package/src/interpreter/OrthographicCameraInterpreter.ts +2 -2
  19. package/src/interpreter/ParticleInterpreter.ts +13 -13
  20. package/src/interpreter/PassInterpreter.ts +16 -16
  21. package/src/interpreter/PerspectiveCameraInterpreter.ts +8 -8
  22. package/src/interpreter/PointsInterpreter.ts +13 -13
  23. package/src/interpreter/SceneServiceInterpreter.ts +28 -28
  24. package/src/interpreter/ServiceSchedulerInterpreter.ts +6 -6
  25. package/src/interpreter/SpriteInterpreter.ts +10 -10
  26. package/src/interpreter/TextInterpreter.ts +10 -10
  27. package/src/interpreter/TransformControllerInterpreter.ts +17 -17
  28. package/src/interpreter/animation/AnimationActionInterpreter.ts +10 -10
  29. package/src/interpreter/geometry/BoxGeometryInterpreter.ts +8 -8
  30. package/src/interpreter/geometry/BufferGeometryInterpreter.ts +8 -8
  31. package/src/interpreter/geometry/CircleGeometryInterpreter.ts +8 -8
  32. package/src/interpreter/geometry/CylinderGeometryInterpreter.ts +8 -8
  33. package/src/interpreter/geometry/ExtrudeGeometryInterpreter.ts +10 -10
  34. package/src/interpreter/geometry/PlaneGeometryInterpreter.ts +8 -8
  35. package/src/interpreter/geometry/RingGeometryInterpreter.ts +8 -8
  36. package/src/interpreter/geometry/SphereGeometryInterpreter.ts +8 -8
  37. package/src/interpreter/geometry/SurfaceGeometryInterpreter.ts +2 -3
  38. package/src/interpreter/geometry/TubeGeometryInterpreter.ts +10 -10
  39. package/src/interpreter/helper/AxesHelperInterpreter.ts +7 -8
  40. package/src/interpreter/light/AmbientLightInterpreter.ts +8 -8
  41. package/src/interpreter/light/DirectionalLightInterpreter.ts +14 -14
  42. package/src/interpreter/light/HemisphereLightInterpreter.ts +8 -8
  43. package/src/interpreter/light/PointLightInterpreter.ts +11 -11
  44. package/src/interpreter/light/RectAreaLightInterpreter.ts +8 -8
  45. package/src/interpreter/light/SpotLightInterpreter.ts +14 -14
  46. package/src/interpreter/material/MaterialInterpreter.ts +4 -4
  47. package/src/interpreter/material/MeshBasicMaterialInterpreter.ts +9 -10
  48. package/src/interpreter/material/MeshPhongMaterialInterpreter.ts +13 -14
  49. package/src/interpreter/material/MeshStandardMaterialInterpreter.ts +14 -15
  50. package/src/interpreter/material/PointsMaterialInterpreter.ts +6 -7
  51. package/src/interpreter/material/ShaderMaterialInterpreter.ts +9 -9
  52. package/src/interpreter/material/ShadowMaterialInterpreter.ts +4 -5
  53. package/src/interpreter/material/SpriteMaterialInterpreter.ts +6 -7
  54. package/src/interpreter/texture/TextureInterpreter.ts +8 -8
  55. package/src/preset/execute/GeoMap/drilldown.ts +6 -7
  56. package/src/preset/index.ts +2 -2
  57. package/src/preset/interaction/GeoMap/drilldown.ts +26 -0
  58. package/src/utils/geometry/index.ts +3 -3
  59. package/src/utils/material/index.ts +6 -6
  60. package/src/utils/texture/index.ts +3 -3
  61. package/src/preset/routine/GeoMap/drilldown.ts +0 -26
  62. /package/src/preset/{routine → interaction}/GeoMap/index.ts +0 -0
  63. /package/src/preset/{routine → interaction}/index.ts +0 -0
@@ -1,5 +1,5 @@
1
1
  import { DirectionalLight, Object3D } from "three";
2
- import { Descriptor, PickupObject, UpdateArgs } from "@vyr/engine";
2
+ import { Descriptor, PickupObject } from "@vyr/engine";
3
3
  import { NodeInterpreter } from "../NodeInterpreter";
4
4
  import { DirectionalLightDescriptor } from "../../descriptor";
5
5
  import { NodeActor } from "../../actor";
@@ -9,12 +9,12 @@ class DirectionalLightInterpreter extends NodeInterpreter {
9
9
 
10
10
  target: Object3D | null = null
11
11
 
12
- protected createActor(descriptor: DirectionalLightDescriptor, args: UpdateArgs) {
12
+ protected createActor(descriptor: DirectionalLightDescriptor) {
13
13
  const actor = new NodeActor(new DirectionalLight())
14
14
  return actor
15
15
  }
16
16
 
17
- setLight(actor: NodeActor<DirectionalLight>, descriptor: DirectionalLightDescriptor, args: UpdateArgs) {
17
+ setLight(actor: NodeActor<DirectionalLight>, descriptor: DirectionalLightDescriptor) {
18
18
  actor.object.color.set(descriptor.color)
19
19
  actor.object.intensity = descriptor.intensity
20
20
  actor.object.shadow.bias = descriptor.bias
@@ -41,7 +41,7 @@ class DirectionalLightInterpreter extends NodeInterpreter {
41
41
  actor.object.shadow.camera.updateProjectionMatrix()
42
42
  }
43
43
 
44
- setTarget(actor: NodeActor<DirectionalLight>, descriptor: DirectionalLightDescriptor, args: UpdateArgs) {
44
+ setTarget(actor: NodeActor<DirectionalLight>, descriptor: DirectionalLightDescriptor) {
45
45
  let targetValue = descriptor.target
46
46
  if (targetValue === '') {
47
47
  const target = new Object3D()
@@ -50,7 +50,7 @@ class DirectionalLightInterpreter extends NodeInterpreter {
50
50
  } else {
51
51
  const target = Descriptor.get<Descriptor>(targetValue)
52
52
  if (target !== null) {
53
- const targetActor = this.graphics.getActor<NodeActor>(target, args)
53
+ const targetActor = this.graphics.getActor<NodeActor>(target)
54
54
  if (targetActor instanceof NodeActor) {
55
55
  actor.object.target = targetActor.object
56
56
  } else {
@@ -64,20 +64,20 @@ class DirectionalLightInterpreter extends NodeInterpreter {
64
64
 
65
65
  }
66
66
 
67
- update(descriptor: DirectionalLightDescriptor, args: UpdateArgs) {
68
- super.update(descriptor, args)
69
- const actor = this.getActor<NodeActor<DirectionalLight>>(descriptor, args)
70
- this.setLight(actor, descriptor, args)
71
- this.setTarget(actor, descriptor, args)
67
+ update(descriptor: DirectionalLightDescriptor) {
68
+ super.update(descriptor)
69
+ const actor = this.getActor<NodeActor<DirectionalLight>>(descriptor)
70
+ this.setLight(actor, descriptor)
71
+ this.setTarget(actor, descriptor)
72
72
  }
73
73
 
74
- free(descriptor: DirectionalLightDescriptor, args: UpdateArgs) {
75
- const actor = this.getActor<NodeActor<DirectionalLight>>(descriptor, args)
74
+ free(descriptor: DirectionalLightDescriptor) {
75
+ const actor = this.getActor<NodeActor<DirectionalLight>>(descriptor)
76
76
  actor.object.dispose()
77
- super.free(descriptor, args)
77
+ super.free(descriptor)
78
78
  }
79
79
 
80
- pickup(descriptor: DirectionalLightDescriptor, args: UpdateArgs, result: PickupObject[]) { }
80
+ pickup(descriptor: DirectionalLightDescriptor, result: PickupObject[]) { }
81
81
  }
82
82
  NodeInterpreter.register(DirectionalLightInterpreter)
83
83
 
@@ -1,5 +1,5 @@
1
1
  import { HemisphereLight } from "three";
2
- import { PickupObject, UpdateArgs } from "@vyr/engine";
2
+ import { PickupObject } from "@vyr/engine";
3
3
  import { NodeInterpreter } from "../NodeInterpreter";
4
4
  import { HemisphereLightDescriptor } from "../../descriptor";
5
5
  import { NodeActor } from "../../actor";
@@ -7,24 +7,24 @@ import { NodeActor } from "../../actor";
7
7
  class HemisphereLightInterpreter extends NodeInterpreter {
8
8
  static type = HemisphereLightDescriptor.type
9
9
 
10
- protected createActor(descriptor: HemisphereLightDescriptor, args: UpdateArgs) {
10
+ protected createActor(descriptor: HemisphereLightDescriptor) {
11
11
  const actor = new NodeActor(new HemisphereLight())
12
12
  return actor
13
13
  }
14
14
 
15
- setLight(actor: NodeActor<HemisphereLight>, descriptor: HemisphereLightDescriptor, args: UpdateArgs) {
15
+ setLight(actor: NodeActor<HemisphereLight>, descriptor: HemisphereLightDescriptor) {
16
16
  actor.object.color.set(descriptor.color)
17
17
  actor.object.intensity = descriptor.intensity
18
18
  actor.object.groundColor.set(descriptor.groundColor)
19
19
  }
20
20
 
21
- update(descriptor: HemisphereLightDescriptor, args: UpdateArgs) {
22
- super.update(descriptor, args)
23
- const actor = this.getActor<NodeActor<HemisphereLight>>(descriptor, args)
24
- this.setLight(actor, descriptor, args)
21
+ update(descriptor: HemisphereLightDescriptor) {
22
+ super.update(descriptor)
23
+ const actor = this.getActor<NodeActor<HemisphereLight>>(descriptor)
24
+ this.setLight(actor, descriptor)
25
25
  }
26
26
 
27
- pickup(descriptor: HemisphereLightDescriptor, args: UpdateArgs, result: PickupObject[]) { }
27
+ pickup(descriptor: HemisphereLightDescriptor, result: PickupObject[]) { }
28
28
  }
29
29
  NodeInterpreter.register(HemisphereLightInterpreter)
30
30
 
@@ -1,5 +1,5 @@
1
1
  import { PointLight } from "three";
2
- import { PickupObject, UpdateArgs } from "@vyr/engine";
2
+ import { PickupObject } from "@vyr/engine";
3
3
  import { NodeInterpreter } from "../NodeInterpreter";
4
4
  import { PointLightDescriptor } from "../../descriptor";
5
5
  import { NodeActor } from "../../actor";
@@ -7,12 +7,12 @@ import { NodeActor } from "../../actor";
7
7
  class PointLightInterpreter extends NodeInterpreter {
8
8
  static type = PointLightDescriptor.type
9
9
 
10
- protected createActor(descriptor: PointLightDescriptor, args: UpdateArgs) {
10
+ protected createActor(descriptor: PointLightDescriptor) {
11
11
  const actor = new NodeActor(new PointLight())
12
12
  return actor
13
13
  }
14
14
 
15
- setLight(actor: NodeActor<PointLight>, descriptor: PointLightDescriptor, args: UpdateArgs) {
15
+ setLight(actor: NodeActor<PointLight>, descriptor: PointLightDescriptor) {
16
16
  actor.object.color.set(descriptor.color)
17
17
  actor.object.intensity = descriptor.intensity
18
18
  actor.object.decay = descriptor.decay
@@ -26,19 +26,19 @@ class PointLightInterpreter extends NodeInterpreter {
26
26
  }
27
27
 
28
28
 
29
- update(descriptor: PointLightDescriptor, args: UpdateArgs) {
30
- super.update(descriptor, args)
31
- const actor = this.getActor<NodeActor<PointLight>>(descriptor, args)
32
- this.setLight(actor, descriptor, args)
29
+ update(descriptor: PointLightDescriptor) {
30
+ super.update(descriptor)
31
+ const actor = this.getActor<NodeActor<PointLight>>(descriptor)
32
+ this.setLight(actor, descriptor)
33
33
  }
34
34
 
35
- free(descriptor: PointLightDescriptor, args: UpdateArgs) {
36
- const actor = this.getActor<NodeActor<PointLight>>(descriptor, args)
35
+ free(descriptor: PointLightDescriptor) {
36
+ const actor = this.getActor<NodeActor<PointLight>>(descriptor)
37
37
  actor.object.dispose()
38
- super.free(descriptor, args)
38
+ super.free(descriptor)
39
39
  }
40
40
 
41
- pickup(descriptor: PointLightDescriptor, args: UpdateArgs, result: PickupObject[]) { }
41
+ pickup(descriptor: PointLightDescriptor, result: PickupObject[]) { }
42
42
  }
43
43
  NodeInterpreter.register(PointLightInterpreter)
44
44
 
@@ -1,5 +1,5 @@
1
1
  import { RectAreaLight } from "three";
2
- import { PickupObject, UpdateArgs } from "@vyr/engine";
2
+ import { PickupObject } from "@vyr/engine";
3
3
  import { NodeInterpreter } from "../NodeInterpreter";
4
4
  import { RectAreaLightDescriptor } from "../../descriptor";
5
5
  import { NodeActor } from "../../actor";
@@ -7,12 +7,12 @@ import { NodeActor } from "../../actor";
7
7
  class RectAreaLightInterpreter extends NodeInterpreter {
8
8
  static type = RectAreaLightDescriptor.type
9
9
 
10
- protected createActor(descriptor: RectAreaLightDescriptor, args: UpdateArgs) {
10
+ protected createActor(descriptor: RectAreaLightDescriptor) {
11
11
  const actor = new NodeActor(new RectAreaLight())
12
12
  return actor
13
13
  }
14
14
 
15
- setLight(actor: NodeActor<RectAreaLight>, descriptor: RectAreaLightDescriptor, args: UpdateArgs) {
15
+ setLight(actor: NodeActor<RectAreaLight>, descriptor: RectAreaLightDescriptor) {
16
16
  actor.object.color.set(descriptor.color)
17
17
  actor.object.intensity = descriptor.intensity
18
18
  actor.object.width = descriptor.width
@@ -20,13 +20,13 @@ class RectAreaLightInterpreter extends NodeInterpreter {
20
20
  actor.object.power = descriptor.power
21
21
  }
22
22
 
23
- update(descriptor: RectAreaLightDescriptor, args: UpdateArgs) {
24
- super.update(descriptor, args)
25
- const actor = this.getActor<NodeActor<RectAreaLight>>(descriptor, args)
26
- this.setLight(actor, descriptor, args)
23
+ update(descriptor: RectAreaLightDescriptor) {
24
+ super.update(descriptor)
25
+ const actor = this.getActor<NodeActor<RectAreaLight>>(descriptor)
26
+ this.setLight(actor, descriptor)
27
27
  }
28
28
 
29
- pickup(descriptor: RectAreaLightDescriptor, args: UpdateArgs, result: PickupObject[]) { }
29
+ pickup(descriptor: RectAreaLightDescriptor, result: PickupObject[]) { }
30
30
  }
31
31
  NodeInterpreter.register(RectAreaLightInterpreter)
32
32
 
@@ -1,5 +1,5 @@
1
1
  import { Object3D, SpotLight } from "three";
2
- import { Descriptor, PickupObject, UpdateArgs } from "@vyr/engine";
2
+ import { Descriptor, PickupObject } from "@vyr/engine";
3
3
  import { NodeInterpreter } from "../NodeInterpreter";
4
4
  import { SpotLightDescriptor } from "../../descriptor";
5
5
  import { NodeActor } from "../../actor";
@@ -7,12 +7,12 @@ import { NodeActor } from "../../actor";
7
7
  class SpotLightInterpreter extends NodeInterpreter {
8
8
  static type = SpotLightDescriptor.type
9
9
 
10
- protected createActor(descriptor: SpotLightDescriptor, args: UpdateArgs) {
10
+ protected createActor(descriptor: SpotLightDescriptor) {
11
11
  const actor = new NodeActor(new SpotLight())
12
12
  return actor
13
13
  }
14
14
 
15
- setLight(actor: NodeActor<SpotLight>, descriptor: SpotLightDescriptor, args: UpdateArgs) {
15
+ setLight(actor: NodeActor<SpotLight>, descriptor: SpotLightDescriptor) {
16
16
  actor.object.color.set(descriptor.color)
17
17
  actor.object.intensity = descriptor.intensity
18
18
  actor.object.angle = descriptor.angle
@@ -27,7 +27,7 @@ class SpotLightInterpreter extends NodeInterpreter {
27
27
  actor.object.shadow.camera.far = camera.far
28
28
  }
29
29
 
30
- setTarget(actor: NodeActor<SpotLight>, descriptor: SpotLightDescriptor, args: UpdateArgs) {
30
+ setTarget(actor: NodeActor<SpotLight>, descriptor: SpotLightDescriptor) {
31
31
  if (descriptor.target === '') {
32
32
  const target = new Object3D()
33
33
  target.position.copy(actor.object.target.position)
@@ -35,7 +35,7 @@ class SpotLightInterpreter extends NodeInterpreter {
35
35
  } else {
36
36
  const target = Descriptor.get<Descriptor>(descriptor.target)
37
37
  if (target !== null) {
38
- const targetActor = this.graphics.getActor<NodeActor>(target, args)
38
+ const targetActor = this.graphics.getActor<NodeActor>(target)
39
39
  if (targetActor instanceof NodeActor) {
40
40
  actor.object.target = targetActor.object
41
41
  } else {
@@ -47,20 +47,20 @@ class SpotLightInterpreter extends NodeInterpreter {
47
47
  }
48
48
  }
49
49
 
50
- update(descriptor: SpotLightDescriptor, args: UpdateArgs) {
51
- super.update(descriptor, args)
52
- const actor = this.getActor<NodeActor<SpotLight>>(descriptor, args)
53
- this.setLight(actor, descriptor, args)
54
- this.setTarget(actor, descriptor, args)
50
+ update(descriptor: SpotLightDescriptor) {
51
+ super.update(descriptor)
52
+ const actor = this.getActor<NodeActor<SpotLight>>(descriptor)
53
+ this.setLight(actor, descriptor)
54
+ this.setTarget(actor, descriptor)
55
55
  }
56
56
 
57
- free(descriptor: SpotLightDescriptor, args: UpdateArgs) {
58
- const actor = this.getActor<NodeActor<SpotLight>>(descriptor, args)
57
+ free(descriptor: SpotLightDescriptor) {
58
+ const actor = this.getActor<NodeActor<SpotLight>>(descriptor)
59
59
  actor.object.dispose()
60
- super.free(descriptor, args)
60
+ super.free(descriptor)
61
61
  }
62
62
 
63
- pickup(descriptor: SpotLightDescriptor, args: UpdateArgs, result: PickupObject[]) { }
63
+ pickup(descriptor: SpotLightDescriptor, result: PickupObject[]) { }
64
64
  }
65
65
  NodeInterpreter.register(SpotLightInterpreter)
66
66
 
@@ -1,5 +1,5 @@
1
1
  import { Material } from "three";
2
- import { Interpreter, UpdateArgs } from "@vyr/engine";
2
+ import { Interpreter } from "@vyr/engine";
3
3
  import { MaterialDescriptor } from "../../descriptor";
4
4
  import { MaterialActor } from "../../actor";
5
5
  import { material as _material } from "../../utils";
@@ -23,10 +23,10 @@ class MaterialInterpreter extends Interpreter {
23
23
  material.needsUpdate = true
24
24
  }
25
25
 
26
- free(descriptor: MaterialDescriptor, args: UpdateArgs) {
27
- const actor = this.getActor<MaterialActor>(descriptor, args)
26
+ free(descriptor: MaterialDescriptor) {
27
+ const actor = this.getActor<MaterialActor>(descriptor)
28
28
  actor.object.dispose()
29
- super.free(descriptor, args)
29
+ super.free(descriptor)
30
30
  }
31
31
  }
32
32
  Interpreter.register(MaterialInterpreter)
@@ -1,5 +1,4 @@
1
1
  import { MeshBasicMaterial } from "three";
2
- import { UpdateArgs } from "@vyr/engine";
3
2
  import { MaterialInterpreter } from './MaterialInterpreter'
4
3
  import { MeshBasicMaterialDescriptor } from "../../descriptor";
5
4
  import { MaterialActor } from "../../actor";
@@ -8,7 +7,7 @@ import { texture } from "../../utils";
8
7
  class MeshBasicMaterialInterpreter extends MaterialInterpreter {
9
8
  static type = MeshBasicMaterialDescriptor.type
10
9
 
11
- protected createActor(descriptor: MeshBasicMaterialDescriptor, args: UpdateArgs) {
10
+ protected createActor(descriptor: MeshBasicMaterialDescriptor) {
12
11
  const actor = new MaterialActor(new MeshBasicMaterial())
13
12
  return actor
14
13
  }
@@ -27,15 +26,15 @@ class MeshBasicMaterialInterpreter extends MaterialInterpreter {
27
26
  material.wireframe = descriptor.wireframe
28
27
  }
29
28
 
30
- update(descriptor: MeshBasicMaterialDescriptor, args: UpdateArgs) {
31
- super.update(descriptor, args)
32
- const actor = this.getActor<MaterialActor<MeshBasicMaterial>>(descriptor, args)
29
+ update(descriptor: MeshBasicMaterialDescriptor) {
30
+ super.update(descriptor)
31
+ const actor = this.getActor<MaterialActor<MeshBasicMaterial>>(descriptor)
33
32
  this.setProperty(actor.object, descriptor)
34
- texture.setMap(actor.object, 'map', descriptor, this.graphics, args)
35
- texture.setMap(actor.object, 'alphaMap', descriptor, this.graphics, args)
36
- texture.setMap(actor.object, 'envMap', descriptor, this.graphics, args)
37
- texture.setMap(actor.object, 'lightMap', descriptor, this.graphics, args)
38
- texture.setMap(actor.object, 'specularMap', descriptor, this.graphics, args)
33
+ texture.setMap(actor.object, 'map', descriptor, this.graphics)
34
+ texture.setMap(actor.object, 'alphaMap', descriptor, this.graphics)
35
+ texture.setMap(actor.object, 'envMap', descriptor, this.graphics)
36
+ texture.setMap(actor.object, 'lightMap', descriptor, this.graphics)
37
+ texture.setMap(actor.object, 'specularMap', descriptor, this.graphics)
39
38
  }
40
39
  }
41
40
  MaterialInterpreter.register(MeshBasicMaterialInterpreter)
@@ -1,5 +1,4 @@
1
1
  import { MeshPhongMaterial } from "three";
2
- import { UpdateArgs } from "@vyr/engine";
3
2
  import { MaterialInterpreter } from "./MaterialInterpreter";
4
3
  import { MeshPhongMaterialDescriptor } from "../../descriptor";
5
4
  import { MaterialActor } from "../../actor";
@@ -8,7 +7,7 @@ import { texture } from "../../utils";
8
7
  class MeshPhongMaterialInterpreter extends MaterialInterpreter {
9
8
  static type = MeshPhongMaterialDescriptor.type
10
9
 
11
- protected createActor(descriptor: MeshPhongMaterialDescriptor, args: UpdateArgs) {
10
+ protected createActor(descriptor: MeshPhongMaterialDescriptor) {
12
11
  const actor = new MaterialActor(new MeshPhongMaterial())
13
12
  return actor
14
13
  }
@@ -43,19 +42,19 @@ class MeshPhongMaterialInterpreter extends MaterialInterpreter {
43
42
  material.wireframe = descriptor.wireframe
44
43
  }
45
44
 
46
- update(descriptor: MeshPhongMaterialDescriptor, args: UpdateArgs) {
47
- super.update(descriptor, args)
48
- const actor = this.getActor<MaterialActor<MeshPhongMaterial>>(descriptor, args)
45
+ update(descriptor: MeshPhongMaterialDescriptor) {
46
+ super.update(descriptor)
47
+ const actor = this.getActor<MaterialActor<MeshPhongMaterial>>(descriptor)
49
48
  this.setProperty(actor.object, descriptor)
50
- texture.setMap(actor.object, 'map', descriptor, this.graphics, args)
51
- texture.setMap(actor.object, 'alphaMap', descriptor, this.graphics, args)
52
- texture.setMap(actor.object, 'envMap', descriptor, this.graphics, args)
53
- texture.setMap(actor.object, 'lightMap', descriptor, this.graphics, args)
54
- texture.setMap(actor.object, 'specularMap', descriptor, this.graphics, args)
55
- texture.setMap(actor.object, 'aoMap', descriptor, this.graphics, args)
56
- texture.setMap(actor.object, 'bumpMap', descriptor, this.graphics, args)
57
- texture.setMap(actor.object, 'emissiveMap', descriptor, this.graphics, args)
58
- texture.setMap(actor.object, 'normalMap', descriptor, this.graphics, args)
49
+ texture.setMap(actor.object, 'map', descriptor, this.graphics)
50
+ texture.setMap(actor.object, 'alphaMap', descriptor, this.graphics)
51
+ texture.setMap(actor.object, 'envMap', descriptor, this.graphics)
52
+ texture.setMap(actor.object, 'lightMap', descriptor, this.graphics)
53
+ texture.setMap(actor.object, 'specularMap', descriptor, this.graphics)
54
+ texture.setMap(actor.object, 'aoMap', descriptor, this.graphics)
55
+ texture.setMap(actor.object, 'bumpMap', descriptor, this.graphics)
56
+ texture.setMap(actor.object, 'emissiveMap', descriptor, this.graphics)
57
+ texture.setMap(actor.object, 'normalMap', descriptor, this.graphics)
59
58
  }
60
59
  }
61
60
  MaterialInterpreter.register(MeshPhongMaterialInterpreter)
@@ -1,5 +1,4 @@
1
1
  import { MeshStandardMaterial } from "three";
2
- import { UpdateArgs } from "@vyr/engine";
3
2
  import { MaterialInterpreter } from "./MaterialInterpreter";
4
3
  import { MeshStandardMaterialDescriptor } from "../../descriptor";
5
4
  import { MaterialActor } from "../../actor";
@@ -8,7 +7,7 @@ import { texture } from "../../utils";
8
7
  class MeshStandardMaterialInterpreter extends MaterialInterpreter {
9
8
  static type = MeshStandardMaterialDescriptor.type
10
9
 
11
- protected createActor(descriptor: MeshStandardMaterialDescriptor, args: UpdateArgs) {
10
+ protected createActor(descriptor: MeshStandardMaterialDescriptor) {
12
11
  const actor = new MaterialActor(new MeshStandardMaterial())
13
12
  return actor
14
13
  }
@@ -37,20 +36,20 @@ class MeshStandardMaterialInterpreter extends MaterialInterpreter {
37
36
  material.wireframe = descriptor.wireframe
38
37
  }
39
38
 
40
- update(descriptor: MeshStandardMaterialDescriptor, args: UpdateArgs) {
41
- super.update(descriptor, args)
42
- const actor = this.getActor<MaterialActor<MeshStandardMaterial>>(descriptor, args)
39
+ update(descriptor: MeshStandardMaterialDescriptor) {
40
+ super.update(descriptor)
41
+ const actor = this.getActor<MaterialActor<MeshStandardMaterial>>(descriptor)
43
42
  this.setProperty(actor.object, descriptor)
44
- texture.setMap(actor.object, 'map', descriptor, this.graphics, args)
45
- texture.setMap(actor.object, 'alphaMap', descriptor, this.graphics, args)
46
- texture.setMap(actor.object, 'lightMap', descriptor, this.graphics, args)
47
- texture.setMap(actor.object, 'aoMap', descriptor, this.graphics, args)
48
- texture.setMap(actor.object, 'bumpMap', descriptor, this.graphics, args)
49
- texture.setMap(actor.object, 'displacementMap', descriptor, this.graphics, args)
50
- texture.setMap(actor.object, 'emissiveMap', descriptor, this.graphics, args)
51
- texture.setMap(actor.object, 'metalnessMap', descriptor, this.graphics, args)
52
- texture.setMap(actor.object, 'normalMap', descriptor, this.graphics, args)
53
- texture.setMap(actor.object, 'roughnessMap', descriptor, this.graphics, args)
43
+ texture.setMap(actor.object, 'map', descriptor, this.graphics)
44
+ texture.setMap(actor.object, 'alphaMap', descriptor, this.graphics)
45
+ texture.setMap(actor.object, 'lightMap', descriptor, this.graphics)
46
+ texture.setMap(actor.object, 'aoMap', descriptor, this.graphics)
47
+ texture.setMap(actor.object, 'bumpMap', descriptor, this.graphics)
48
+ texture.setMap(actor.object, 'displacementMap', descriptor, this.graphics)
49
+ texture.setMap(actor.object, 'emissiveMap', descriptor, this.graphics)
50
+ texture.setMap(actor.object, 'metalnessMap', descriptor, this.graphics)
51
+ texture.setMap(actor.object, 'normalMap', descriptor, this.graphics)
52
+ texture.setMap(actor.object, 'roughnessMap', descriptor, this.graphics)
54
53
  }
55
54
  }
56
55
  MaterialInterpreter.register(MeshStandardMaterialInterpreter)
@@ -1,5 +1,4 @@
1
1
  import { PointsMaterial } from "three";
2
- import { UpdateArgs } from "@vyr/engine";
3
2
  import { MaterialInterpreter } from './MaterialInterpreter'
4
3
  import { PointsMaterialDescriptor } from "../../descriptor";
5
4
  import { MaterialActor } from "../../actor";
@@ -8,7 +7,7 @@ import { texture } from "../../utils";
8
7
  class PointsMaterialInterpreter extends MaterialInterpreter {
9
8
  static type = PointsMaterialDescriptor.type
10
9
 
11
- protected createActor(descriptor: PointsMaterialDescriptor, args: UpdateArgs) {
10
+ protected createActor(descriptor: PointsMaterialDescriptor) {
12
11
  const actor = new MaterialActor(new PointsMaterial())
13
12
  return actor
14
13
  }
@@ -23,12 +22,12 @@ class PointsMaterialInterpreter extends MaterialInterpreter {
23
22
  material.fog = descriptor.fog
24
23
  }
25
24
 
26
- update(descriptor: PointsMaterialDescriptor, args: UpdateArgs) {
27
- super.update(descriptor, args)
28
- const actor = this.getActor<MaterialActor<PointsMaterial>>(descriptor, args)
25
+ update(descriptor: PointsMaterialDescriptor) {
26
+ super.update(descriptor)
27
+ const actor = this.getActor<MaterialActor<PointsMaterial>>(descriptor)
29
28
  this.setProperty(actor.object, descriptor)
30
- texture.setMap(actor.object, 'map', descriptor, this.graphics, args)
31
- texture.setMap(actor.object, 'alphaMap', descriptor, this.graphics, args)
29
+ texture.setMap(actor.object, 'map', descriptor, this.graphics)
30
+ texture.setMap(actor.object, 'alphaMap', descriptor, this.graphics)
32
31
  }
33
32
  }
34
33
  MaterialInterpreter.register(PointsMaterialInterpreter)
@@ -1,5 +1,5 @@
1
1
  import { ShaderMaterial } from "three";
2
- import { Asset, Scriptable, UpdateArgs } from "@vyr/engine";
2
+ import { Asset, Scriptable, ScriptableArgs } from "@vyr/engine";
3
3
  import { MaterialInterpreter } from './MaterialInterpreter'
4
4
  import { MaterialActor } from "../../actor";
5
5
  import { ShaderMaterialAttribute, ShaderMaterialDescriptor } from "../../descriptor";
@@ -9,7 +9,7 @@ class ShaderMaterialInterpreter extends MaterialInterpreter {
9
9
  static defaultVertexShader = 'void main() { gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );}'
10
10
  static defaultFragmentShader = 'void main() { gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );}'
11
11
 
12
- protected createActor(descriptor: ShaderMaterialDescriptor, args: UpdateArgs) {
12
+ protected createActor(descriptor: ShaderMaterialDescriptor) {
13
13
  const actor = new MaterialActor(new ShaderMaterial())
14
14
  return actor
15
15
  }
@@ -23,27 +23,27 @@ class ShaderMaterialInterpreter extends MaterialInterpreter {
23
23
  material.wireframe = descriptor.wireframe
24
24
  }
25
25
 
26
- setShaderAsset(material: ShaderMaterial, descriptor: ShaderMaterialDescriptor, args: UpdateArgs) {
26
+ setShaderAsset(material: ShaderMaterial, descriptor: ShaderMaterialDescriptor) {
27
27
  material.uniforms = {}
28
28
  material.vertexShader = ShaderMaterialInterpreter.defaultVertexShader
29
29
  material.fragmentShader = ShaderMaterialInterpreter.defaultFragmentShader
30
30
  material.uniformsNeedUpdate = true
31
31
 
32
32
  if (descriptor.shader) {
33
- const shaderAsset = Asset.get<Scriptable>(descriptor.shader)
33
+ const shaderAsset = Asset.get<Scriptable<ScriptableArgs<undefined, undefined, undefined>>>(descriptor.shader)
34
34
  if (shaderAsset === null) return
35
- const attribute: ShaderMaterialAttribute = shaderAsset.execute(descriptor, this.graphics, args)
35
+ const attribute: ShaderMaterialAttribute = shaderAsset.execute(this.graphics, { input: undefined, result: undefined, trigger: descriptor })
36
36
  material.uniforms = attribute.uniforms
37
37
  material.fragmentShader = attribute.fragmentShader
38
38
  material.vertexShader = attribute.vertexShader
39
39
  }
40
40
  }
41
41
 
42
- update(descriptor: ShaderMaterialDescriptor, args: UpdateArgs) {
43
- super.update(descriptor, args)
44
- const actor = this.getActor<MaterialActor<ShaderMaterial>>(descriptor, args)
42
+ update(descriptor: ShaderMaterialDescriptor) {
43
+ super.update(descriptor)
44
+ const actor = this.getActor<MaterialActor<ShaderMaterial>>(descriptor)
45
45
  this.setProperty(actor.object, descriptor)
46
- this.setShaderAsset(actor.object, descriptor, args)
46
+ this.setShaderAsset(actor.object, descriptor)
47
47
  }
48
48
  }
49
49
  MaterialInterpreter.register(ShaderMaterialInterpreter)
@@ -1,5 +1,4 @@
1
1
  import { ShadowMaterial } from "three";
2
- import { UpdateArgs } from "@vyr/engine";
3
2
  import { MaterialInterpreter } from './MaterialInterpreter'
4
3
  import { ShadowMaterialDescriptor } from "../../descriptor";
5
4
  import { MaterialActor } from "../../actor";
@@ -7,7 +6,7 @@ import { MaterialActor } from "../../actor";
7
6
  class ShadowMaterialInterpreter extends MaterialInterpreter {
8
7
  static type = ShadowMaterialDescriptor.type
9
8
 
10
- protected createActor(descriptor: ShadowMaterialDescriptor, args: UpdateArgs) {
9
+ protected createActor(descriptor: ShadowMaterialDescriptor) {
11
10
  const actor = new MaterialActor(new ShadowMaterial())
12
11
  return actor
13
12
  }
@@ -20,9 +19,9 @@ class ShadowMaterialInterpreter extends MaterialInterpreter {
20
19
  material.fog = descriptor.fog
21
20
  }
22
21
 
23
- update(descriptor: ShadowMaterialDescriptor, args: UpdateArgs) {
24
- super.update(descriptor, args)
25
- const actor = this.getActor<MaterialActor<ShadowMaterial>>(descriptor, args)
22
+ update(descriptor: ShadowMaterialDescriptor) {
23
+ super.update(descriptor)
24
+ const actor = this.getActor<MaterialActor<ShadowMaterial>>(descriptor)
26
25
  this.setProperty(actor.object, descriptor)
27
26
  }
28
27
  }
@@ -1,5 +1,4 @@
1
1
  import { SpriteMaterial } from "three";
2
- import { UpdateArgs } from "@vyr/engine";
3
2
  import { MaterialInterpreter } from './MaterialInterpreter'
4
3
  import { SpriteMaterialDescriptor } from "../../descriptor";
5
4
  import { MaterialActor } from "../../actor";
@@ -8,7 +7,7 @@ import { texture } from "../../utils";
8
7
  class SpriteMaterialInterpreter extends MaterialInterpreter {
9
8
  static type = SpriteMaterialDescriptor.type
10
9
 
11
- protected createActor(descriptor: SpriteMaterialDescriptor, args: UpdateArgs) {
10
+ protected createActor(descriptor: SpriteMaterialDescriptor) {
12
11
  const actor = new MaterialActor(new SpriteMaterial())
13
12
  return actor
14
13
  }
@@ -23,12 +22,12 @@ class SpriteMaterialInterpreter extends MaterialInterpreter {
23
22
  material.fog = descriptor.fog
24
23
  }
25
24
 
26
- update(descriptor: SpriteMaterialDescriptor, args: UpdateArgs) {
27
- super.update(descriptor, args)
28
- const actor = this.getActor<MaterialActor<SpriteMaterial>>(descriptor, args)
25
+ update(descriptor: SpriteMaterialDescriptor) {
26
+ super.update(descriptor)
27
+ const actor = this.getActor<MaterialActor<SpriteMaterial>>(descriptor)
29
28
  this.setProperty(actor.object, descriptor)
30
- texture.setMap(actor.object, 'map', descriptor, this.graphics, args)
31
- texture.setMap(actor.object, 'alphaMap', descriptor, this.graphics, args)
29
+ texture.setMap(actor.object, 'map', descriptor, this.graphics)
30
+ texture.setMap(actor.object, 'alphaMap', descriptor, this.graphics)
32
31
  }
33
32
  }
34
33
  MaterialInterpreter.register(SpriteMaterialInterpreter)
@@ -1,12 +1,12 @@
1
1
  import { Texture } from "three";
2
- import { Asset, Interpreter, UpdateArgs } from "@vyr/engine";
2
+ import { Asset, Interpreter } from "@vyr/engine";
3
3
  import { TextureDescriptor } from '../../descriptor'
4
4
  import { TextureActor } from "../../actor";
5
5
 
6
6
  class TextureInterpreter extends Interpreter {
7
7
  static type = TextureDescriptor.type
8
8
 
9
- protected createActor(descriptor: TextureDescriptor, args: UpdateArgs) {
9
+ protected createActor(descriptor: TextureDescriptor) {
10
10
  const actor = new TextureActor(new Texture())
11
11
  return actor
12
12
  }
@@ -40,18 +40,18 @@ class TextureInterpreter extends Interpreter {
40
40
  }
41
41
  }
42
42
 
43
- update(descriptor: TextureDescriptor, args: UpdateArgs) {
44
- super.update(descriptor, args)
45
- let actor = this.getActor<TextureActor>(descriptor, args)
43
+ update(descriptor: TextureDescriptor) {
44
+ super.update(descriptor)
45
+ let actor = this.getActor<TextureActor>(descriptor)
46
46
  this.setProperty(actor, descriptor)
47
47
  this.setImage(actor, descriptor)
48
48
  if (actor.object.image) actor.object.needsUpdate = true
49
49
  }
50
50
 
51
- free(descriptor: TextureDescriptor, args: UpdateArgs) {
52
- const actor = this.getActor<TextureActor>(descriptor, args)
51
+ free(descriptor: TextureDescriptor) {
52
+ const actor = this.getActor<TextureActor>(descriptor)
53
53
  actor.object.dispose()
54
- super.free(descriptor, args)
54
+ super.free(descriptor)
55
55
  }
56
56
  }
57
57
  Interpreter.register(TextureInterpreter)