@woosh/meep-engine 2.119.52 → 2.119.53
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
CHANGED
|
@@ -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)
|