@woosh/meep-engine 2.165.4 → 2.165.5

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 (141) hide show
  1. package/editor/Editor.d.ts +65 -65
  2. package/editor/SelectionVisualizer.d.ts +19 -19
  3. package/editor/actions/concrete/ActionUpdateTexture.d.ts +11 -11
  4. package/editor/actions/concrete/ArrayCopyAction.d.ts +19 -19
  5. package/editor/actions/concrete/ComponentAddAction.d.ts +14 -14
  6. package/editor/actions/concrete/ComponentRemoveAction.d.ts +10 -10
  7. package/editor/actions/concrete/EntityCreateAction.d.ts +17 -17
  8. package/editor/actions/concrete/EntityRemoveAction.d.ts +10 -10
  9. package/editor/actions/concrete/ModifyPatchSampler2DAction.d.ts +46 -46
  10. package/editor/actions/concrete/ModifyPatchTextureArray2DAction.d.ts +37 -37
  11. package/editor/actions/concrete/PaintTerrainOverlayAction.d.ts +22 -22
  12. package/editor/actions/concrete/PatchTerrainHeightAction.d.ts +18 -18
  13. package/editor/actions/concrete/SelectionAddAction.d.ts +18 -18
  14. package/editor/actions/concrete/SelectionClearAction.d.ts +8 -8
  15. package/editor/actions/concrete/SelectionRemoveAction.d.ts +9 -9
  16. package/editor/actions/concrete/TransformModifyAction.d.ts +16 -16
  17. package/editor/actions/concrete/WriteGridValueAction.d.ts +14 -14
  18. package/editor/ecs/EditorEntity.d.ts +15 -15
  19. package/editor/ecs/EditorEntitySystem.d.ts +7 -7
  20. package/editor/ecs/component/FieldDescriptor.d.ts +26 -26
  21. package/editor/ecs/component/FieldValueAdapter.d.ts +6 -6
  22. package/editor/ecs/component/TypeEditor.d.ts +24 -24
  23. package/editor/ecs/component/createFieldEditor.d.ts +8 -8
  24. package/editor/ecs/component/createObjectEditor.d.ts +13 -13
  25. package/editor/ecs/component/editors/ColorEditor.d.ts +6 -6
  26. package/editor/ecs/component/editors/HTMLElementEditor.d.ts +6 -6
  27. package/editor/ecs/component/editors/ImagePathEditor.d.ts +6 -6
  28. package/editor/ecs/component/editors/LargeStringEditor.d.ts +15 -15
  29. package/editor/ecs/component/editors/NumericIntervalEditor.d.ts +6 -6
  30. package/editor/ecs/component/editors/ObservedBooleanEditor.d.ts +6 -6
  31. package/editor/ecs/component/editors/ObservedEnumEditor.d.ts +6 -6
  32. package/editor/ecs/component/editors/ObservedIntegerEditor.d.ts +6 -6
  33. package/editor/ecs/component/editors/ObservedStringEditor.d.ts +6 -6
  34. package/editor/ecs/component/editors/Sampler2DEditor.d.ts +6 -6
  35. package/editor/ecs/component/editors/collection/ListEditor.d.ts +7 -7
  36. package/editor/ecs/component/editors/common/BitFlagsEditor.d.ts +11 -11
  37. package/editor/ecs/component/editors/common/EnumEditor.d.ts +7 -7
  38. package/editor/ecs/component/editors/common/makeV3_editor.d.ts +14 -14
  39. package/editor/ecs/component/editors/common/noEditor.d.ts +2 -2
  40. package/editor/ecs/component/editors/ecs/GridObstacleEditor.d.ts +6 -6
  41. package/editor/ecs/component/editors/ecs/MinimapMarkerEditor.d.ts +13 -13
  42. package/editor/ecs/component/editors/ecs/ParameterLookupTableEditor.d.ts +66 -66
  43. package/editor/ecs/component/editors/ecs/ParameterTrackEditor.d.ts +11 -11
  44. package/editor/ecs/component/editors/ecs/ParameterTrackSetEditor.d.ts +13 -13
  45. package/editor/ecs/component/editors/ecs/ParticleEmitterEditor.d.ts +51 -51
  46. package/editor/ecs/component/editors/ecs/ParticleEmitterLayerEditor.d.ts +47 -47
  47. package/editor/ecs/component/editors/ecs/SimulationStepDefinitionEditor.d.ts +15 -15
  48. package/editor/ecs/component/editors/ecs/Trail2DEditor.d.ts +29 -29
  49. package/editor/ecs/component/editors/ecs/TransformEditor.d.ts +19 -19
  50. package/editor/ecs/component/editors/ecs/terrain/SplatMappingEditor.d.ts +18 -18
  51. package/editor/ecs/component/editors/ecs/terrain/TerrainEditor.d.ts +38 -38
  52. package/editor/ecs/component/editors/ecs/terrain/TerrainLayerEditor.d.ts +15 -15
  53. package/editor/ecs/component/editors/ecs/terrain/TerrainLayersEditor.d.ts +18 -18
  54. package/editor/ecs/component/editors/ecs/terrain/TerrainOverlayEditor.d.ts +17 -17
  55. package/editor/ecs/component/editors/geom/QuaternionEditor.d.ts +5 -5
  56. package/editor/ecs/component/editors/geom/Vector1Editor.d.ts +6 -6
  57. package/editor/ecs/component/editors/geom/Vector2Editor.d.ts +5 -5
  58. package/editor/ecs/component/editors/geom/Vector3Editor.d.ts +5 -5
  59. package/editor/ecs/component/editors/geom/Vector4Editor.d.ts +5 -5
  60. package/editor/ecs/component/editors/primitive/ArrayEditor.d.ts +7 -7
  61. package/editor/ecs/component/editors/primitive/BooleanEditor.d.ts +6 -6
  62. package/editor/ecs/component/editors/primitive/FunctionEditor.d.ts +6 -6
  63. package/editor/ecs/component/editors/primitive/NumberEditor.d.ts +7 -7
  64. package/editor/ecs/component/editors/primitive/ObjectEditor.d.ts +5 -5
  65. package/editor/ecs/component/editors/primitive/StringEditor.d.ts +6 -6
  66. package/editor/ecs/component/editors/three/BufferGeometryEditor.d.ts +6 -6
  67. package/editor/ecs/component/editors/three/MaterialEditor.d.ts +6 -6
  68. package/editor/ecs/component/editors/three/MeshEditor.d.ts +6 -6
  69. package/editor/ecs/component/editors/three/TextureEditor.d.ts +6 -6
  70. package/editor/ecs/component/findNearestRegisteredType.d.ts +7 -7
  71. package/editor/enableEditor.d.ts +13 -13
  72. package/editor/library/MeshLibrary.d.ts +12 -12
  73. package/editor/process/DisableGameUIProcess.d.ts +7 -7
  74. package/editor/process/EditorProcess.d.ts +18 -18
  75. package/editor/process/ObstacleGridDisplayProcess.d.ts +12 -12
  76. package/editor/process/ProcessEngine.d.ts +29 -29
  77. package/editor/process/SymbolicDisplayProcess.d.ts +18 -18
  78. package/editor/process/symbolic/ComponentSymbolicDisplay.d.ts +10 -10
  79. package/editor/process/symbolic/SymbolicDisplayInternalAPI.d.ts +64 -64
  80. package/editor/process/symbolic/buildThreeJSHelperEntity.d.ts +8 -8
  81. package/editor/process/symbolic/make3DSymbolicDisplay.d.ts +9 -9
  82. package/editor/process/symbolic/makeCameraSymbolicDisplay.d.ts +6 -6
  83. package/editor/process/symbolic/makeGridPositionSymbolDisplay.d.ts +5 -5
  84. package/editor/process/symbolic/makeHelperBoxGeometry.d.ts +2 -2
  85. package/editor/process/symbolic/makeHelperSphereGeometry.d.ts +8 -8
  86. package/editor/process/symbolic/makeLightSymbolicDisplay.d.ts +6 -6
  87. package/editor/process/symbolic/makeParticleEmitterSymbolicDisplay.d.ts +5 -5
  88. package/editor/process/symbolic/makePathSymbolicDisplay.d.ts +6 -6
  89. package/editor/process/symbolic/makePositionedIconDisplaySymbol.d.ts +8 -8
  90. package/editor/process/symbolic/makeSocketsSymbolicDisplay.d.ts +6 -6
  91. package/editor/process/symbolic/makeSolidArrowGeometry.d.ts +25 -25
  92. package/editor/process/symbolic/makeSoundEmitterSymbolicDisplay.d.ts +5 -5
  93. package/editor/process/symbolic/synchronizeTransform.d.ts +11 -11
  94. package/editor/tools/GridPaintTool.d.ts +16 -16
  95. package/editor/tools/SelectionTool.d.ts +26 -26
  96. package/editor/tools/TopDownCameraControlTool.d.ts +12 -12
  97. package/editor/tools/engine/Tool.d.ts +63 -63
  98. package/editor/tools/engine/ToolEngine.d.ts +22 -22
  99. package/editor/tools/engine/ToolState.d.ts +6 -6
  100. package/editor/tools/paint/TerrainHeightPaintTool.d.ts +17 -17
  101. package/editor/tools/paint/TerrainPaintTool.d.ts +30 -30
  102. package/editor/tools/paint/TerrainTexturePaintTool.d.ts +17 -17
  103. package/editor/tools/v2/TransformMode.d.ts +6 -6
  104. package/editor/view/EditorView.d.ts +38 -38
  105. package/editor/view/ecs/ComponentControlFactory.d.ts +18 -18
  106. package/editor/view/ecs/ComponentControlView.d.ts +23 -23
  107. package/editor/view/ecs/EntityEditor.d.ts +29 -29
  108. package/editor/view/ecs/EntityList.d.ts +21 -21
  109. package/editor/view/ecs/HierarchicalEntityListView.d.ts +7 -7
  110. package/editor/view/ecs/components/DatGuiController.d.ts +45 -45
  111. package/editor/view/ecs/components/GridObstacleController.d.ts +13 -13
  112. package/editor/view/ecs/components/color/GaugeView.d.ts +12 -12
  113. package/editor/view/ecs/components/common/AutoCanvasView.d.ts +19 -19
  114. package/editor/view/ecs/components/common/LineView.d.ts +11 -11
  115. package/editor/view/ecs/components/common/NumberController.d.ts +17 -17
  116. package/editor/view/ecs/components/particles/ColorParameterLUTController.d.ts +13 -13
  117. package/editor/view/makeEntityDecorators.d.ts +5 -5
  118. package/editor/view/tools/ToolSettingsView.d.ts +10 -10
  119. package/editor/view/tools/ToolView.d.ts +12 -12
  120. package/editor/view/v2/SplitView.d.ts +16 -16
  121. package/package.json +1 -1
  122. package/samples/generation/grid/GridTags.d.ts +15 -15
  123. package/samples/generation/grid/MirGridLayers.d.ts +7 -7
  124. package/samples/generation/rules/matcher_tag_occupied.d.ts +2 -2
  125. package/samples/generation/rules/matcher_tag_traversable.d.ts +2 -2
  126. package/samples/generation/rules/matcher_tag_unoccupied.d.ts +2 -2
  127. package/src/engine/graphics/ecs/light/LightContext.d.ts +8 -0
  128. package/src/engine/graphics/ecs/light/LightContext.d.ts.map +1 -1
  129. package/src/engine/graphics/ecs/light/LightContext.js +33 -3
  130. package/src/engine/graphics/ecs/light/LightSystem.d.ts.map +1 -1
  131. package/src/engine/graphics/ecs/light/LightSystem.js +13 -6
  132. package/src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.d.ts +12 -0
  133. package/src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.d.ts.map +1 -1
  134. package/src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.js +184 -6
  135. package/src/engine/graphics/render/buffer/simple-fx/ao/SAOShader.js +381 -362
  136. package/src/engine/graphics/shadows/ShadowMapRenderer.d.ts +10 -0
  137. package/src/engine/graphics/shadows/ShadowMapRenderer.d.ts.map +1 -1
  138. package/src/engine/graphics/shadows/ShadowMapRenderer.js +83 -10
  139. package/src/engine/graphics/shadows/testPointShadowMapRendering.d.ts +2 -0
  140. package/src/engine/graphics/shadows/testPointShadowMapRendering.d.ts.map +1 -0
  141. package/src/engine/graphics/shadows/testPointShadowMapRendering.js +242 -0
@@ -1,20 +1,20 @@
1
- /**
2
- * Automatically tracks size on the screen, including that computed from CSS and - re-renders content when size changes
3
- * @extends View
4
- */
5
- export class AutoCanvasView {
6
- constructor({ classList }?: {
7
- classList?: any[];
8
- });
9
- __sizeObserver: DomSizeObserver;
10
- render(): void;
11
- /**
12
- *
13
- * @param {CanvasRenderingContext2D} ctx
14
- * @param {number} width
15
- * @param {number} height
16
- */
17
- draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
18
- }
19
- import { DomSizeObserver } from "../../../../../src/view/util/DomSizeObserver.js";
1
+ /**
2
+ * Automatically tracks size on the screen, including that computed from CSS and - re-renders content when size changes
3
+ * @extends View
4
+ */
5
+ export class AutoCanvasView {
6
+ constructor({ classList }?: {
7
+ classList?: any[];
8
+ });
9
+ __sizeObserver: DomSizeObserver;
10
+ render(): void;
11
+ /**
12
+ *
13
+ * @param {CanvasRenderingContext2D} ctx
14
+ * @param {number} width
15
+ * @param {number} height
16
+ */
17
+ draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
18
+ }
19
+ import { DomSizeObserver } from "../../../../../src/view/util/DomSizeObserver.js";
20
20
  //# sourceMappingURL=AutoCanvasView.d.ts.map
@@ -1,12 +1,12 @@
1
- /**
2
- * @extends {View}
3
- */
4
- export class LineView extends View<HTMLElement> {
5
- constructor({ elements, classList }: {
6
- elements?: any[];
7
- classList?: any[];
8
- });
9
- el: HTMLDivElement;
10
- }
11
- import View from "../../../../../src/view/View.js";
1
+ /**
2
+ * @extends {View}
3
+ */
4
+ export class LineView extends View<HTMLElement> {
5
+ constructor({ elements, classList }: {
6
+ elements?: any[];
7
+ classList?: any[];
8
+ });
9
+ el: HTMLDivElement;
10
+ }
11
+ import View from "../../../../../src/view/View.js";
12
12
  //# sourceMappingURL=LineView.d.ts.map
@@ -1,18 +1,18 @@
1
- export class NumberController extends View<HTMLElement> {
2
- /**
3
- *
4
- * @param {string[]} [classList]
5
- * @param {number} [value]
6
- * @param figures
7
- */
8
- constructor({ classList, value, figures }?: string[]);
9
- /**
10
- *
11
- * @type {Vector1}
12
- */
13
- value: Vector1;
14
- el: HTMLInputElement;
15
- }
16
- import View from "../../../../../src/view/View.js";
17
- import Vector1 from "../../../../../src/core/geom/Vector1.js";
1
+ export class NumberController extends View<HTMLElement> {
2
+ /**
3
+ *
4
+ * @param {string[]} [classList]
5
+ * @param {number} [value]
6
+ * @param figures
7
+ */
8
+ constructor({ classList, value, figures }?: string[]);
9
+ /**
10
+ *
11
+ * @type {Vector1}
12
+ */
13
+ value: Vector1;
14
+ el: HTMLInputElement;
15
+ }
16
+ import View from "../../../../../src/view/View.js";
17
+ import Vector1 from "../../../../../src/core/geom/Vector1.js";
18
18
  //# sourceMappingURL=NumberController.d.ts.map
@@ -1,14 +1,14 @@
1
- /**
2
- *
3
- * @param {CanvasRenderingContext2D} context
4
- * @param {number} width
5
- * @param {number} height
6
- * @param {number}cellSize
7
- * @param {string} color1
8
- * @param {string} color2
9
- */
10
- export function drawCheckers(context: CanvasRenderingContext2D, width: number, height: number, cellSize: number, color1: string, color2: string): void;
11
- export class ColorParameterLUTController extends GuiControl {
12
- }
13
- import GuiControl from "../../../../../src/view/controller/controls/GuiControl.js";
1
+ /**
2
+ *
3
+ * @param {CanvasRenderingContext2D} context
4
+ * @param {number} width
5
+ * @param {number} height
6
+ * @param {number}cellSize
7
+ * @param {string} color1
8
+ * @param {string} color2
9
+ */
10
+ export function drawCheckers(context: CanvasRenderingContext2D, width: number, height: number, cellSize: number, color1: string, color2: string): void;
11
+ export class ColorParameterLUTController extends GuiControl {
12
+ }
13
+ import GuiControl from "../../../../../src/view/controller/controls/GuiControl.js";
14
14
  //# sourceMappingURL=ColorParameterLUTController.d.ts.map
@@ -1,6 +1,6 @@
1
- /**
2
- *
3
- * @return {(function(entity:number, ecd:EntityComponentDataset, view:View):void)[]}
4
- */
5
- export function makeEntityDecorators(): ((arg0: entity) => number);
1
+ /**
2
+ *
3
+ * @return {(function(entity:number, ecd:EntityComponentDataset, view:View):void)[]}
4
+ */
5
+ export function makeEntityDecorators(): ((arg0: entity) => number);
6
6
  //# sourceMappingURL=makeEntityDecorators.d.ts.map
@@ -1,11 +1,11 @@
1
- export default ToolSettingsView;
2
- declare class ToolSettingsView extends View<HTMLElement> {
3
- constructor(tool: any);
4
- model: any;
5
- gui: any;
6
- el: any;
7
- setTool(tool: any): void;
8
- build(): void;
9
- }
10
- import View from "../../../src/view/View.js";
1
+ export default ToolSettingsView;
2
+ declare class ToolSettingsView extends View<HTMLElement> {
3
+ constructor(tool: any);
4
+ model: any;
5
+ gui: any;
6
+ el: any;
7
+ setTool(tool: any): void;
8
+ build(): void;
9
+ }
10
+ import View from "../../../src/view/View.js";
11
11
  //# sourceMappingURL=ToolSettingsView.d.ts.map
@@ -1,13 +1,13 @@
1
- export default ToolView;
2
- declare class ToolView extends View<HTMLElement> {
3
- /**
4
- *
5
- * @param {Tool} tool
6
- * @param {Editor} editor
7
- * @constructor
8
- */
9
- constructor({ tool, editor }: Tool);
10
- el: Element;
11
- }
12
- import View from "../../../src/view/View.js";
1
+ export default ToolView;
2
+ declare class ToolView extends View<HTMLElement> {
3
+ /**
4
+ *
5
+ * @param {Tool} tool
6
+ * @param {Editor} editor
7
+ * @constructor
8
+ */
9
+ constructor({ tool, editor }: Tool);
10
+ el: Element;
11
+ }
12
+ import View from "../../../src/view/View.js";
13
13
  //# sourceMappingURL=ToolView.d.ts.map
@@ -1,17 +1,17 @@
1
- export class SplitView extends EmptyView {
2
- static from({ a, b, type, fraction }: {
3
- a: any;
4
- b: any;
5
- type?: string;
6
- fraction?: number;
7
- }): SplitView;
8
- constructor();
9
- set fraction(arg: any);
10
- set direction(arg: any);
11
- set childA(arg: any);
12
- set childB(arg: any);
13
- layout(): void;
14
- #private;
15
- }
16
- import EmptyView from "../../../src/view/elements/EmptyView.js";
1
+ export class SplitView extends EmptyView {
2
+ static from({ a, b, type, fraction }: {
3
+ a: any;
4
+ b: any;
5
+ type?: string;
6
+ fraction?: number;
7
+ }): SplitView;
8
+ constructor();
9
+ set fraction(arg: any);
10
+ set direction(arg: any);
11
+ set childA(arg: any);
12
+ set childB(arg: any);
13
+ layout(): void;
14
+ #private;
15
+ }
16
+ import EmptyView from "../../../src/view/elements/EmptyView.js";
17
17
  //# sourceMappingURL=SplitView.d.ts.map
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "Pure JavaScript game engine. Fully featured and production ready.",
7
7
  "type": "module",
8
8
  "author": "Alexander Goldring",
9
- "version": "2.165.4",
9
+ "version": "2.165.5",
10
10
  "main": "build/meep.module.js",
11
11
  "module": "build/meep.module.js",
12
12
  "exports": {
@@ -1,16 +1,16 @@
1
- /**
2
- * Tags
3
- */
4
- export type GridTags = number;
5
- export namespace GridTags {
6
- let Traversable: number;
7
- let Enemy: number;
8
- let Base: number;
9
- let Treasure: number;
10
- let StartingPoint: number;
11
- let Occupied: number;
12
- let Road: number;
13
- let PlayArea: number;
14
- let Objective: number;
15
- }
1
+ /**
2
+ * Tags
3
+ */
4
+ export type GridTags = number;
5
+ export namespace GridTags {
6
+ let Traversable: number;
7
+ let Enemy: number;
8
+ let Base: number;
9
+ let Treasure: number;
10
+ let StartingPoint: number;
11
+ let Occupied: number;
12
+ let Road: number;
13
+ let PlayArea: number;
14
+ let Objective: number;
15
+ }
16
16
  //# sourceMappingURL=GridTags.d.ts.map
@@ -1,8 +1,8 @@
1
- export namespace MirGridLayers {
2
- let Tags: string;
3
- let DistanceFromStart: string;
4
- let DistanceFromPlayArea: string;
5
- let Heights: string;
6
- let Moisture: string;
7
- }
1
+ export namespace MirGridLayers {
2
+ let Tags: string;
3
+ let DistanceFromStart: string;
4
+ let DistanceFromPlayArea: string;
5
+ let Heights: string;
6
+ let Moisture: string;
7
+ }
8
8
  //# sourceMappingURL=MirGridLayers.d.ts.map
@@ -1,3 +1,3 @@
1
- export const matcher_tag_occupied: CellMatcherLayerBitMaskTest;
2
- import { CellMatcherLayerBitMaskTest } from "../../../src/generation/rules/CellMatcherLayerBitMaskTest.js";
1
+ export const matcher_tag_occupied: CellMatcherLayerBitMaskTest;
2
+ import { CellMatcherLayerBitMaskTest } from "../../../src/generation/rules/CellMatcherLayerBitMaskTest.js";
3
3
  //# sourceMappingURL=matcher_tag_occupied.d.ts.map
@@ -1,3 +1,3 @@
1
- export const matcher_tag_traversable: CellMatcherLayerBitMaskTest;
2
- import { CellMatcherLayerBitMaskTest } from "../../../src/generation/rules/CellMatcherLayerBitMaskTest.js";
1
+ export const matcher_tag_traversable: CellMatcherLayerBitMaskTest;
2
+ import { CellMatcherLayerBitMaskTest } from "../../../src/generation/rules/CellMatcherLayerBitMaskTest.js";
3
3
  //# sourceMappingURL=matcher_tag_traversable.d.ts.map
@@ -1,3 +1,3 @@
1
- export const matcher_tag_unoccupied: CellMatcherNot;
2
- import { CellMatcherNot } from "../../../src/generation/rules/logic/CellMatcherNot.js";
1
+ export const matcher_tag_unoccupied: CellMatcherNot;
2
+ import { CellMatcherNot } from "../../../src/generation/rules/logic/CellMatcherNot.js";
3
3
  //# sourceMappingURL=matcher_tag_unoccupied.d.ts.map
@@ -16,6 +16,14 @@ export class LightContext extends SystemEntityContext {
16
16
  */
17
17
  getTransform(): Transform;
18
18
  __rebuild(): void;
19
+ /**
20
+ * Forward+ point lights have no shadow support; a shadow-casting point
21
+ * light falls through to a real three.js light instead
22
+ * @return {boolean}
23
+ * @private
24
+ */
25
+ private __use_fp_binding;
26
+ __handleCastShadowChanged(): void;
19
27
  __build(): void;
20
28
  applySettings(): void;
21
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"LightContext.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/light/LightContext.js"],"names":[],"mappings":"AAKA;IAEI;;;;OAIG;IACH,kBAAiB;IAEjB;;;OAGG;IACH,kBAEC;IAED;;;OAGG;IACH,0BAEC;IAED,kBAIC;IAED,gBASC;IAED,sBAEC;CAgBJ;oCAjEmC,4CAA4C"}
1
+ {"version":3,"file":"LightContext.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/light/LightContext.js"],"names":[],"mappings":"AAKA;IAEI;;;;OAIG;IACH,kBAAiB;IAEjB;;;OAGG;IACH,kBAEC;IAED;;;OAGG;IACH,0BAEC;IAED,kBAIC;IAED;;;;;OAKG;IACH,yBAMC;IAED,kCAQC;IAED,gBASC;IAED,sBAEC;CAsBJ;oCA/FmC,4CAA4C"}
@@ -34,8 +34,32 @@ export class LightContext extends SystemEntityContext {
34
34
  this.__binding.link(this);
35
35
  }
36
36
 
37
+ /**
38
+ * Forward+ point lights have no shadow support; a shadow-casting point
39
+ * light falls through to a real three.js light instead
40
+ * @return {boolean}
41
+ * @private
42
+ */
43
+ __use_fp_binding() {
44
+ const light = this.getLight();
45
+
46
+ return light.type.getValue() === LightType.POINT
47
+ && this.system.__use_forward_plus
48
+ && !light.castShadow.getValue();
49
+ }
50
+
51
+ __handleCastShadowChanged() {
52
+ if ((this.__binding instanceof FPLightBinding) === this.__use_fp_binding()) {
53
+ // routing is unchanged; a three.js-bound light reacts to castShadow
54
+ // through its own binding, no rebuild needed
55
+ return;
56
+ }
57
+
58
+ this.__rebuild();
59
+ }
60
+
37
61
  __build() {
38
- if (this.getLight().type.getValue() === LightType.POINT && this.system.__use_forward_plus) {
62
+ if (this.__use_fp_binding()) {
39
63
  this.__binding = new FPLightBinding();
40
64
  } else {
41
65
  this.__binding = new ThreeLightBinding();
@@ -53,12 +77,18 @@ export class LightContext extends SystemEntityContext {
53
77
  this.__build();
54
78
  this.__binding.link(this);
55
79
 
56
- this.getLight().type.onChanged.add(this.__rebuild, this);
80
+ const light = this.getLight();
81
+
82
+ light.type.onChanged.add(this.__rebuild, this);
83
+ light.castShadow.onChanged.add(this.__handleCastShadowChanged, this);
57
84
  }
58
85
 
59
86
  unlink() {
60
87
 
61
- this.getLight().type.onChanged.remove(this.__rebuild, this);
88
+ const light = this.getLight();
89
+
90
+ light.type.onChanged.remove(this.__rebuild, this);
91
+ light.castShadow.onChanged.remove(this.__handleCastShadowChanged, this);
62
92
 
63
93
  this.__binding.unlink(this);
64
94
 
@@ -1 +1 @@
1
- {"version":3,"file":"LightSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/light/LightSystem.js"],"names":[],"mappings":"AA6QA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,2DARW,YAAY,SACZ,WAAW,oBACX,MAAM,qCA6EhB;;uBA7WsB,qBAAqB;sBAEtB,YAAY;AASlC;IACI;;;;;OAKG;IACH,2CAsFC;IA1EG,kDAAsC;IAGtC,6DAEC;IAGD,eAAoB;IACpB,WAA2B;IAC3B,aAAwB;IAExB;;;;OAIG;IACH,mBAA0B;IAE1B;;;;OAIG;IACH,wBAA2B;IAE3B,gBAAkB;IAElB;;;;OAIG;IACH,kBAAoC;IAGpC;;;;OAIG;IACH,2BAA8B;IAC9B;;;;OAIG;IACH,iBAAoB;IAGpB;;;;OAIG;IACH,4BAAgD;IAqBpD,mCAEC;IAED;;;;OAIG;IACH,uBAHW,MAAM,SACN,MAAM,GAAC,MAAM,GAAC,OAAO,QAkB/B;IAED;;;;OAIG;IACH,4BAHW,KAAK,UACL,MAAM,QAMhB;IAED,2CAOC;IAED,4CASC;IAGD,4CAOC;IAED;;;;;OAKG;IACH,wCAwCC;IAED;;;;;;OAMG;IACH,sCAwBC;CACJ;sCAjQqC,8CAA8C;0BAC1D,qCAAqC;4CAFnB,uDAAuD"}
1
+ {"version":3,"file":"LightSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/light/LightSystem.js"],"names":[],"mappings":"AAoRA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,2DARW,YAAY,SACZ,WAAW,oBACX,MAAM,qCA6EhB;;uBApXsB,qBAAqB;sBAEtB,YAAY;AASlC;IACI;;;;;OAKG;IACH,2CAsFC;IA1EG,kDAAsC;IAGtC,6DAEC;IAGD,eAAoB;IACpB,WAA2B;IAC3B,aAAwB;IAExB;;;;OAIG;IACH,mBAA0B;IAE1B;;;;OAIG;IACH,wBAA2B;IAE3B,gBAAkB;IAElB;;;;OAIG;IACH,kBAAoC;IAGpC;;;;OAIG;IACH,2BAA8B;IAC9B;;;;OAIG;IACH,iBAAoB;IAGpB;;;;OAIG;IACH,4BAAgD;IAqBpD,mCAEC;IAED;;;;OAIG;IACH,uBAHW,MAAM,SACN,MAAM,GAAC,MAAM,GAAC,OAAO,QAkB/B;IAED;;;;OAIG;IACH,4BAHW,KAAK,UACL,MAAM,QAMhB;IAED,2CAOC;IAED,4CASC;IAGD,4CAOC;IAED;;;;;OAKG;IACH,wCA+CC;IAED;;;;;;OAMG;IACH,sCAwBC;CACJ;sCAxQqC,8CAA8C;0BAC1D,qCAAqC;4CAFnB,uDAAuD"}
@@ -213,12 +213,19 @@ class LightSystem extends AbstractContextSystem {
213
213
 
214
214
  l.castShadow = true;
215
215
 
216
- three_update_shadow_camera_extents(
217
- this.__camera_object,
218
- l,
219
- light.maxShadowDistance.getValue(),
220
- this.__graphics.layers
221
- );
216
+ if (light.type.getValue() === LightType.DIRECTION) {
217
+ // the orthographic view-frustum fit only makes sense for
218
+ // directional lights; applying it to the perspective
219
+ // shadow camera of a point/spot light corrupts its
220
+ // projection (those cameras are driven by
221
+ // LightShadow.updateMatrices instead)
222
+ three_update_shadow_camera_extents(
223
+ this.__camera_object,
224
+ l,
225
+ light.maxShadowDistance.getValue(),
226
+ this.__graphics.layers
227
+ );
228
+ }
222
229
 
223
230
  } else {
224
231
 
@@ -35,6 +35,18 @@ export class ThreeLightBinding extends LightBinding {
35
35
  __shadowmap_link(): void;
36
36
  __shadowmap_unlink(): void;
37
37
  __shadowmap_prepare_view(): void;
38
+ /**
39
+ * A point light shadow renders six cube faces, a single camera frustum
40
+ * would only cull correctly for one of them. Instead, cull by the
41
+ * axis-aligned box bounding the light's sphere of influence: every caster
42
+ * that can shadow any face lies within `distance` of the light. The box is
43
+ * written directly as six inward-facing "frustum" planes and the resulting
44
+ * visible set is shared by all six face renders.
45
+ * @param {CameraView} cameraView
46
+ * @param {THREE.PointLight} light
47
+ * @private
48
+ */
49
+ private __shadowmap_prepare_view_point;
38
50
  __shadowmap_render(): void;
39
51
  applySettings(settings: any): void;
40
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ThreeLightBinding.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.js"],"names":[],"mappings":"AA6FA;;;;GAIG;AACH,6EAFW,MAAM,QAgBhB;AAED;IAGI;;;;OAIG;IACH,iBAAgB;IAEhB;;;;OAIG;IACH,qBAAoB;IAEpB;;;;OAIG;IACH,qBAA6B;IAG7B,qBAYC;IAED,uBAcC;IAED;;;;OAIG;IACH,yBAEC;IAYD,+BAEC;IAUD,yBAuBC;IAED,2BAgBC;IAED,iCA0BC;IAGD,2BA0CC;IA8CD,mCAmBC;CAEJ;6BAtX4B,oBAAoB"}
1
+ {"version":3,"file":"ThreeLightBinding.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.js"],"names":[],"mappings":"AA2JA;;;;GAIG;AACH,6EAFW,MAAM,QAqBhB;AAED;IAGI;;;;OAIG;IACH,iBAAgB;IAEhB;;;;OAIG;IACH,qBAAoB;IAEpB;;;;OAIG;IACH,qBAA6B;IAG7B,qBAYC;IAED,uBAeC;IAED;;;;OAIG;IACH,yBAEC;IAYD,+BAEC;IAUD,yBAuBC;IAED,2BAmCC;IAED,iCA+BC;IAED;;;;;;;;;;OAUG;IACH,uCA8CC;IAGD,2BAkDC;IA8CD,mCAsCC;CAEJ;6BAxiB4B,oBAAoB"}