@woosh/meep-engine 2.119.52 → 2.119.54
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/package.json +1 -1
- package/src/core/geom/Vector3.d.ts +2 -0
- package/src/engine/EngineHarness.d.ts +11 -5
- package/src/engine/EngineHarness.d.ts.map +1 -1
- package/src/engine/EngineHarness.js +2 -2
- package/src/engine/graphics/ecs/highlight/system/ShadedGeometryHighlightSystem.d.ts +1 -1
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.d.ts +153 -26
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts +1 -1
package/package.json
CHANGED
|
@@ -39,13 +39,13 @@ export class EngineHarness {
|
|
|
39
39
|
/**
|
|
40
40
|
* @param {Object} params
|
|
41
41
|
* @param {Engine} params.engine
|
|
42
|
-
* @param {
|
|
42
|
+
* @param {{x:number,y:number,z:number}} [params.focus]
|
|
43
43
|
* @param [params.heightMap]
|
|
44
44
|
* @param [params.heightRange]
|
|
45
45
|
* @param {number} [params.pitch]
|
|
46
46
|
* @param {number} [params.yaw]
|
|
47
47
|
* @param {number} [params.distance]
|
|
48
|
-
* @param {
|
|
48
|
+
* @param {{x:number, y:number}} [params.terrainSize]
|
|
49
49
|
* @param {number} [params.terrainResolution]
|
|
50
50
|
* @param {boolean} [params.enableWater]
|
|
51
51
|
* @param {boolean} [params.enableTerrain]
|
|
@@ -59,13 +59,20 @@ export class EngineHarness {
|
|
|
59
59
|
*/
|
|
60
60
|
static buildBasics({ engine, focus, heightMap, heightRange, pitch, yaw, distance, terrainSize, terrainResolution, enableWater, enableTerrain, enableLights, cameraFieldOfView, cameraFarDistance, cameraController, cameraAutoClip, shadowmapResolution, showFps }: {
|
|
61
61
|
engine: Engine;
|
|
62
|
-
focus?:
|
|
62
|
+
focus?: {
|
|
63
|
+
x: number;
|
|
64
|
+
y: number;
|
|
65
|
+
z: number;
|
|
66
|
+
};
|
|
63
67
|
heightMap?: any;
|
|
64
68
|
heightRange?: any;
|
|
65
69
|
pitch?: number;
|
|
66
70
|
yaw?: number;
|
|
67
71
|
distance?: number;
|
|
68
|
-
terrainSize?:
|
|
72
|
+
terrainSize?: {
|
|
73
|
+
x: number;
|
|
74
|
+
y: number;
|
|
75
|
+
};
|
|
69
76
|
terrainResolution?: number;
|
|
70
77
|
enableWater?: boolean;
|
|
71
78
|
enableTerrain?: boolean;
|
|
@@ -159,7 +166,6 @@ import Engine from "./Engine.js";
|
|
|
159
166
|
import { EngineConfiguration } from "./EngineConfiguration.js";
|
|
160
167
|
import Vector3 from "../core/geom/Vector3.js";
|
|
161
168
|
import Entity from "./ecs/Entity.js";
|
|
162
|
-
import Vector2 from "../core/geom/Vector2.js";
|
|
163
169
|
import { Color } from "../core/color/Color.js";
|
|
164
170
|
import Terrain from "./ecs/terrain/ecs/Terrain.js";
|
|
165
171
|
//# sourceMappingURL=EngineHarness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EngineHarness.d.ts","sourceRoot":"","sources":["../../../src/engine/EngineHarness.js"],"names":[],"mappings":"AA6DA;IAmBI;;;;OAIG;IACH,8CAHmB,mBAAmB,UAAQ,MAAM,WACxC,QAAQ,MAAM,CAAC,CAM1B;IAED;;;OAGG;IACH,6BAFW,MAAM,QAYhB;IAmED;;;;;;;;;;;;;OAaG;IACH;QAZyB,MAAM,EAApB,MAAM;QACyB,GAAG;QAClB,MAAM,GAAtB,OAAO;QACQ,QAAQ,GAAvB,MAAM;QACS,KAAK,GAApB,MAAM;QACS,GAAG,GAAlB,MAAM;QACU,QAAQ,GAAxB,OAAO;QACQ,WAAW,GAA1B,MAAM;QACS,WAAW,GAA1B,MAAM;QACS,WAAW,GAA1B,MAAM;QACJ,MAAM,CA+DlB;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH;QAnB0B,MAAM,EAArB,MAAM;
|
|
1
|
+
{"version":3,"file":"EngineHarness.d.ts","sourceRoot":"","sources":["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A3B,MAAM;QACU,YAAY,GAA5B,OAAO;QACO,OAAO,GAArB,KAAK;QACU,gBAAgB,GAA/B,MAAM;sBAqDhB;IAED;;;;;;;OAOG;IACH;QAN0B,YAAY,GAA3B,MAAM;QACQ,MAAM,EAApB,MAAM;QACS,WAAW,GAA1B,MAAM;QACyB,GAAG;QAChC,MAAM,CA2ClB;IAGD;;;;;;;;;;;OAWG;IACH,mGAVW,MAAM,GAQJ,OAAO,CAuDnB;IA3cG;;;OAGG;IACH,QAFU,MAAM,CAEiC;IAMjD;;;OAGG;IACH,YAFU,eAAQ,IAAI,CAET;IA8BjB;;;;;OAKG;IACH;iCAJmB,mBAAmB,UAAQ,MAAM;8BACzC,OAAO;QACL,QAAQ,MAAM,CAAC,CA2D3B;CAiWJ;;IAID;;;OAGG;IACH,uCAMC;;mBA1gBkB,aAAa;oCACI,0BAA0B;oBAX1C,yBAAyB;mBAK1B,iBAAiB;sBATd,wBAAwB;oBAW1B,8BAA8B"}
|
|
@@ -250,13 +250,13 @@ export class EngineHarness {
|
|
|
250
250
|
/**
|
|
251
251
|
* @param {Object} params
|
|
252
252
|
* @param {Engine} params.engine
|
|
253
|
-
* @param {
|
|
253
|
+
* @param {{x:number,y:number,z:number}} [params.focus]
|
|
254
254
|
* @param [params.heightMap]
|
|
255
255
|
* @param [params.heightRange]
|
|
256
256
|
* @param {number} [params.pitch]
|
|
257
257
|
* @param {number} [params.yaw]
|
|
258
258
|
* @param {number} [params.distance]
|
|
259
|
-
* @param {
|
|
259
|
+
* @param {{x:number, y:number}} [params.terrainSize]
|
|
260
260
|
* @param {number} [params.terrainResolution]
|
|
261
261
|
* @param {boolean} [params.enableWater]
|
|
262
262
|
* @param {boolean} [params.enableTerrain]
|
|
@@ -1,26 +1,153 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export class ShadedGeometry {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Represents a primitive 3d object, a combination of a material and geometry
|
|
3
|
+
* This is roughly equivalent to single draw call, note that his is not a hierarchical data structure, if you want that - you will need to combine multiple entities, each with a `ShadedGeometry` component
|
|
4
|
+
*/
|
|
5
|
+
export class ShadedGeometry {
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param {THREE.BufferGeometry} geometry
|
|
9
|
+
* @param {THREE.Material} material
|
|
10
|
+
* @param {DrawMode} [draw_mode]
|
|
11
|
+
* @return {ShadedGeometry}
|
|
12
|
+
*/
|
|
13
|
+
static from(geometry: THREE.BufferGeometry, material: THREE.Material, draw_mode?: DrawMode): ShadedGeometry;
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @type {THREE.BufferGeometry|null}
|
|
17
|
+
*/
|
|
18
|
+
geometry: THREE.BufferGeometry | null;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {THREE.Material|null}
|
|
22
|
+
*/
|
|
23
|
+
material: THREE.Material | null;
|
|
24
|
+
/**
|
|
25
|
+
* Optional extra material used for shadowmaps
|
|
26
|
+
* @type {THREE.Material|null}
|
|
27
|
+
*/
|
|
28
|
+
depth_material: THREE.Material | null;
|
|
29
|
+
__bvh_leaf: BvhClient;
|
|
30
|
+
/**
|
|
31
|
+
* Transient, assigned in the system
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
35
|
+
private __entity;
|
|
36
|
+
/**
|
|
37
|
+
* Transient, cached for convenience. Associated transform component from the same entity
|
|
38
|
+
* @type {Transform|null}
|
|
39
|
+
* @private
|
|
40
|
+
*/
|
|
41
|
+
private __c_transform;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {DrawMode|number}
|
|
45
|
+
*/
|
|
46
|
+
mode: DrawMode | number;
|
|
47
|
+
/**
|
|
48
|
+
* Transient property signifying how to render object, such as using INSTANCED draw
|
|
49
|
+
* @type {number}
|
|
50
|
+
*/
|
|
51
|
+
draw_method: number;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {number}
|
|
55
|
+
*/
|
|
56
|
+
flags: number;
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated
|
|
59
|
+
* @private
|
|
60
|
+
*/
|
|
61
|
+
private get __cached_object();
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @param {number|ShadedGeometryFlags} flag
|
|
65
|
+
* @returns {void}
|
|
66
|
+
*/
|
|
67
|
+
setFlag(flag: number | ShadedGeometryFlags): void;
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @param {number|ShadedGeometryFlags} flag
|
|
71
|
+
* @returns {void}
|
|
72
|
+
*/
|
|
73
|
+
clearFlag(flag: number | ShadedGeometryFlags): void;
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
* @param {number|ShadedGeometryFlags} flag
|
|
77
|
+
* @param {boolean} value
|
|
78
|
+
*/
|
|
79
|
+
writeFlag(flag: number | ShadedGeometryFlags, value: boolean): void;
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
* @param {number|ShadedGeometryFlags} flag
|
|
83
|
+
* @returns {boolean}
|
|
84
|
+
*/
|
|
85
|
+
getFlag(flag: number | ShadedGeometryFlags): boolean;
|
|
86
|
+
/**
|
|
87
|
+
*
|
|
88
|
+
* @return {number}
|
|
89
|
+
*/
|
|
90
|
+
hash(): number;
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
* @param {ShadedGeometry} other
|
|
94
|
+
* @returns {boolean}
|
|
95
|
+
*/
|
|
96
|
+
equals(other: ShadedGeometry): boolean;
|
|
97
|
+
/**
|
|
98
|
+
*
|
|
99
|
+
* @param {ShadedGeometry} other
|
|
100
|
+
*/
|
|
101
|
+
copy(other: ShadedGeometry): void;
|
|
102
|
+
/**
|
|
103
|
+
*
|
|
104
|
+
* @returns {ShadedGeometry}
|
|
105
|
+
*/
|
|
106
|
+
clone(): ShadedGeometry;
|
|
107
|
+
/**
|
|
108
|
+
* Current cached entity that this component is attached to
|
|
109
|
+
* @return {number}
|
|
110
|
+
*/
|
|
111
|
+
get entity(): number;
|
|
112
|
+
/**
|
|
113
|
+
* Global transform matrix
|
|
114
|
+
* 4x4 matrix
|
|
115
|
+
* @return {null|number[]}
|
|
116
|
+
*/
|
|
117
|
+
get transform(): number[];
|
|
118
|
+
/**
|
|
119
|
+
* @deprecated
|
|
120
|
+
*/
|
|
121
|
+
get bvh(): void;
|
|
122
|
+
/**
|
|
123
|
+
*
|
|
124
|
+
* @param {AABB3} destination
|
|
125
|
+
*/
|
|
126
|
+
getBoundingBox(destination: AABB3): void;
|
|
127
|
+
/**
|
|
128
|
+
*
|
|
129
|
+
* @param {THREE.BufferGeometry} geometry
|
|
130
|
+
* @param {THREE.Material} material
|
|
131
|
+
* @param {DrawMode} [draw_mode]
|
|
132
|
+
*/
|
|
133
|
+
from(geometry: THREE.BufferGeometry, material: THREE.Material, draw_mode?: DrawMode): void;
|
|
134
|
+
updateTransform(): void;
|
|
135
|
+
update_bounds(): void;
|
|
136
|
+
/**
|
|
137
|
+
*
|
|
138
|
+
* @param {SurfacePoint3} contact if found, contact is written here
|
|
139
|
+
* @param {ArrayLike<number>|number[]|Float32Array} ray 6-tuple: [origin_x, origin_y, origin_z, direction_x, direction_y, direction_z]
|
|
140
|
+
* @param {ArrayLike<number>|number[]|Float32Array} transform_matrix4 transform applied to the geometry
|
|
141
|
+
* @returns {boolean}
|
|
142
|
+
*/
|
|
143
|
+
query_raycast_nearest(contact: SurfacePoint3, ray: ArrayLike<number> | number[] | Float32Array, transform_matrix4: ArrayLike<number> | number[] | Float32Array): boolean;
|
|
144
|
+
}
|
|
145
|
+
export namespace ShadedGeometry {
|
|
146
|
+
let typeName: string;
|
|
147
|
+
let serializable: boolean;
|
|
148
|
+
}
|
|
149
|
+
import { BvhClient } from "../../../../core/bvh2/bvh3/BvhClient.js";
|
|
150
|
+
import { DrawMode } from "./DrawMode.js";
|
|
151
|
+
import { ShadedGeometryFlags } from "./ShadedGeometryFlags.js";
|
|
152
|
+
import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
|
|
153
|
+
//# sourceMappingURL=ShadedGeometry.d.ts.map
|
|
@@ -2,7 +2,7 @@ import {BVH} from "../../../../core/bvh2/bvh3/BVH";
|
|
|
2
2
|
import {SurfacePoint3} from "../../../../core/geom/3d/SurfacePoint3";
|
|
3
3
|
import {System} from "../../../ecs/System";
|
|
4
4
|
import Engine from "../../../Engine";
|
|
5
|
-
import {ShadedGeometry} from "./ShadedGeometry";
|
|
5
|
+
import {ShadedGeometry} from "./ShadedGeometry.js";
|
|
6
6
|
|
|
7
7
|
export class ShadedGeometrySystem extends System<ShadedGeometry> {
|
|
8
8
|
constructor(engine: Engine)
|