@woosh/meep-engine 2.111.6 → 2.111.8
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/build/bundle-worker-terrain.js +1 -1
- package/build/meep.cjs +45 -43
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +45 -43
- package/package.json +1 -1
- package/src/core/collection/array/typed/compute_binary_data_type_from_typed_array.d.ts +8 -0
- package/src/core/collection/array/typed/compute_binary_data_type_from_typed_array.d.ts.map +1 -0
- package/src/core/collection/array/typed/compute_binary_data_type_from_typed_array.js +39 -0
- package/src/core/collection/array/typed/isTypedArray.d.ts +4 -3
- package/src/core/collection/array/typed/isTypedArray.d.ts.map +1 -1
- package/src/core/collection/array/typed/isTypedArray.js +4 -5
- package/src/core/collection/array/typed/typedArrayToDataType.d.ts +3 -5
- package/src/core/collection/array/typed/typedArrayToDataType.d.ts.map +1 -1
- package/src/core/collection/array/typed/typedArrayToDataType.js +3 -31
- package/src/core/collection/array/typed/uint_array_for_count.d.ts +3 -3
- package/src/core/collection/array/typed/uint_array_for_count.d.ts.map +1 -1
- package/src/core/collection/array/typed/uint_array_for_count.js +7 -7
- package/src/core/geom/3d/topology/expandConnectivityByLocality.d.ts.map +1 -1
- package/src/core/geom/3d/topology/expandConnectivityByLocality.js +3 -2
- package/src/core/geom/3d/topology/isEdgeConnectedToOutline.d.ts.map +1 -1
- package/src/core/geom/3d/topology/isEdgeConnectedToOutline.js +2 -1
- package/src/core/geom/3d/topology/isVertexConnectedToOutline.d.ts.map +1 -1
- package/src/core/geom/3d/topology/isVertexConnectedToOutline.js +3 -1
- package/src/core/geom/3d/topology/query/query_edge_other_vertex.d.ts.map +1 -1
- package/src/core/geom/3d/topology/query/query_edge_other_vertex.js +3 -0
- package/src/core/geom/3d/topology/util/mesh_flood_fill.d.ts +1 -2
- package/src/core/geom/3d/topology/util/mesh_flood_fill.d.ts.map +1 -1
- package/src/core/geom/3d/topology/util/mesh_flood_fill.js +0 -2
- package/src/engine/ecs/terrain/tiles/TileBuildWorker.js +2 -2
- package/src/engine/graphics/geometry/AttributeSpec.d.ts.map +1 -1
- package/src/engine/graphics/geometry/AttributeSpec.js +52 -33
- package/src/engine/graphics/geometry/VertexDataSpec.d.ts.map +1 -1
- package/src/engine/graphics/geometry/VertexDataSpec.js +13 -6
- package/src/engine/graphics/geometry/computeBoundingSphereFromVertexData.d.ts +2 -2
- package/src/engine/graphics/geometry/computeBoundingSphereFromVertexData.d.ts.map +1 -1
- package/src/engine/graphics/geometry/computeBoundingSphereFromVertexData.js +4 -4
- package/src/engine/graphics/geometry/optimization/geometry_optimize_uv_tension.d.ts +10 -0
- package/src/engine/graphics/geometry/optimization/geometry_optimize_uv_tension.d.ts.map +1 -0
- package/src/engine/{ecs/terrain/util/tensionOptimizeUV.js → graphics/geometry/optimization/geometry_optimize_uv_tension.js} +14 -7
- package/src/engine/graphics/geometry/optimization/merge/merge_geometry_hierarchy.d.ts +1 -2
- package/src/engine/graphics/geometry/optimization/merge/merge_geometry_hierarchy.d.ts.map +1 -1
- package/src/engine/graphics/geometry/optimization/merge/merge_geometry_hierarchy.js +1 -2
- package/src/engine/graphics/geometry/skining/computeSkinnedMeshVertices.d.ts +1 -1
- package/src/engine/graphics/geometry/skining/computeSkinnedMeshVertices.js +1 -1
- package/src/engine/graphics/material/optimization/MaterialOptimizationContext.d.ts.map +1 -1
- package/src/engine/graphics/material/optimization/MaterialOptimizationContext.js +4 -2
- package/src/engine/graphics/texture/sampler/Sampler2D.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/Sampler2D.js +4 -2
- package/src/engine/graphics/texture/sampler/sampler2d_compute_texel_value_conversion_scale_to_uint8.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/sampler2d_compute_texel_value_conversion_scale_to_uint8.js +6 -4
- package/src/engine/ecs/terrain/util/tensionOptimizeUV.d.ts +0 -10
- package/src/engine/ecs/terrain/util/tensionOptimizeUV.d.ts.map +0 -1
- package/src/engine/graphics/geometry/BufferGeometryWrap.js +0 -23
- package/src/engine/graphics/geometry/clipping/ClippedGeometry.d.ts +0 -55
- package/src/engine/graphics/geometry/clipping/ClippedGeometry.d.ts.map +0 -1
- package/src/engine/graphics/geometry/clipping/ClippedGeometry.js +0 -144
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
7
|
-
* @param {Float32Array}
|
|
7
|
+
* @param {Float32Array} positions
|
|
8
8
|
* @param {Vector4|Vector4Like} result
|
|
9
9
|
*/
|
|
10
|
-
export function computeBoundingSphereFromVertexData(
|
|
10
|
+
export function computeBoundingSphereFromVertexData(positions: Float32Array, result: Vector4 | Vector4Like): void;
|
|
11
11
|
/**
|
|
12
12
|
* {{set:function(x:number,y:number,z:number,w:number):void}}
|
|
13
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeBoundingSphereFromVertexData.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/geometry/computeBoundingSphereFromVertexData.js"],"names":[],"mappings":"AAGA;;;GAGG;AAEH;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"computeBoundingSphereFromVertexData.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/geometry/computeBoundingSphereFromVertexData.js"],"names":[],"mappings":"AAGA;;;GAGG;AAEH;;;;GAIG;AACH,+DAHW,YAAY,UACZ,UAAQ,WAAW,QAiB7B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PointSet } from "../../../core/geom/packing/miniball/PointSet.js";
|
|
2
1
|
import { Miniball } from "../../../core/geom/packing/miniball/Miniball.js";
|
|
2
|
+
import { PointSet } from "../../../core/geom/packing/miniball/PointSet.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @typedef Vector4Like {{set:function(x:number,y:number,z:number,w:number):void}}
|
|
@@ -8,12 +8,12 @@ import { Miniball } from "../../../core/geom/packing/miniball/Miniball.js";
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
|
-
* @param {Float32Array}
|
|
11
|
+
* @param {Float32Array} positions
|
|
12
12
|
* @param {Vector4|Vector4Like} result
|
|
13
13
|
*/
|
|
14
|
-
export function computeBoundingSphereFromVertexData(
|
|
14
|
+
export function computeBoundingSphereFromVertexData(positions, result) {
|
|
15
15
|
|
|
16
|
-
const pointSet = new PointSet(
|
|
16
|
+
const pointSet = new PointSet(positions.length / 3, 3, positions);
|
|
17
17
|
const miniball = new Miniball(pointSet);
|
|
18
18
|
|
|
19
19
|
const aCenter = miniball.center();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Move UVs to reduce stretching
|
|
3
|
+
*
|
|
4
|
+
* @param {Float32Array} positions
|
|
5
|
+
* @param {Float32Array} uvs
|
|
6
|
+
* @param {Uint16Array} faces
|
|
7
|
+
* @param {number} [steps] Number of optimization passes to perform
|
|
8
|
+
*/
|
|
9
|
+
export function geometry_optimize_uv_tension(positions: Float32Array, uvs: Float32Array, faces: Uint16Array, steps?: number): void;
|
|
10
|
+
//# sourceMappingURL=geometry_optimize_uv_tension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry_optimize_uv_tension.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/geometry/optimization/geometry_optimize_uv_tension.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,wDALW,YAAY,OACZ,YAAY,SACZ,WAAW,UACX,MAAM,QAwEhB"}
|
|
@@ -1,22 +1,29 @@
|
|
|
1
|
+
import { query_edge_is_boundary } from "../../../../core/geom/3d/topology/query/query_edge_is_boundary.js";
|
|
2
|
+
import { query_edge_other_vertex } from "../../../../core/geom/3d/topology/query/query_edge_other_vertex.js";
|
|
1
3
|
import { TopoMesh } from "../../../../core/geom/3d/topology/struct/TopoMesh.js";
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* Move UVs to reduce stretching
|
|
5
7
|
*
|
|
6
|
-
* @param {Float32Array}
|
|
8
|
+
* @param {Float32Array} positions
|
|
7
9
|
* @param {Float32Array} uvs
|
|
8
10
|
* @param {Uint16Array} faces
|
|
9
|
-
* @param {number} steps Number of optimization passes to perform
|
|
11
|
+
* @param {number} [steps] Number of optimization passes to perform
|
|
10
12
|
*/
|
|
11
|
-
export function
|
|
13
|
+
export function geometry_optimize_uv_tension(
|
|
14
|
+
positions,
|
|
15
|
+
uvs,
|
|
16
|
+
faces,
|
|
17
|
+
steps = 3
|
|
18
|
+
) {
|
|
12
19
|
|
|
13
20
|
// Build topology from the data, we need to know which faces are connected to each vertex
|
|
14
21
|
const topo = new TopoMesh();
|
|
15
22
|
|
|
16
|
-
topo.build(
|
|
23
|
+
topo.build(positions, faces);
|
|
17
24
|
topo.computeEdgeSquaredLengths();
|
|
18
25
|
|
|
19
|
-
const nVertices =
|
|
26
|
+
const nVertices = positions.length / 3;
|
|
20
27
|
|
|
21
28
|
for (let i = 0; i < steps; i++) {
|
|
22
29
|
|
|
@@ -44,12 +51,12 @@ export function tensionOptimizeUV(vertices, uvs, faces, steps) {
|
|
|
44
51
|
for (let k = 0; k < nAttachedEdges; k++) {
|
|
45
52
|
const attachedEdge = attachedEdges[k];
|
|
46
53
|
|
|
47
|
-
if (attachedEdge
|
|
54
|
+
if (query_edge_is_boundary(attachedEdge)) {
|
|
48
55
|
//edge vertex, no adjustment possible
|
|
49
56
|
continue loop_vertices;
|
|
50
57
|
}
|
|
51
58
|
|
|
52
|
-
const otherVertex = attachedEdge
|
|
59
|
+
const otherVertex = query_edge_other_vertex(attachedEdge, topoVertex);
|
|
53
60
|
|
|
54
61
|
const otherUvAddress = otherVertex.index * 2;
|
|
55
62
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
3
|
* @param {THREE.Object3D} input
|
|
4
|
-
* @param context
|
|
5
4
|
* @returns {THREE.Object3D}
|
|
6
5
|
*/
|
|
7
|
-
export function merge_geometry_hierarchy(input: THREE.Object3D
|
|
6
|
+
export function merge_geometry_hierarchy(input: THREE.Object3D): THREE.Object3D;
|
|
8
7
|
//# sourceMappingURL=merge_geometry_hierarchy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge_geometry_hierarchy.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/geometry/optimization/merge/merge_geometry_hierarchy.js"],"names":[],"mappings":"AAwPA
|
|
1
|
+
{"version":3,"file":"merge_geometry_hierarchy.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/geometry/optimization/merge/merge_geometry_hierarchy.js"],"names":[],"mappings":"AAwPA;;;;GAIG;AACH,gDAHW,MAAM,QAAQ,GACZ,MAAM,QAAQ,CA0E1B"}
|
|
@@ -249,10 +249,9 @@ function apply_transform_to_another_three_object(source, destination) {
|
|
|
249
249
|
/**
|
|
250
250
|
*
|
|
251
251
|
* @param {THREE.Object3D} input
|
|
252
|
-
* @param context
|
|
253
252
|
* @returns {THREE.Object3D}
|
|
254
253
|
*/
|
|
255
|
-
export function merge_geometry_hierarchy(input
|
|
254
|
+
export function merge_geometry_hierarchy(input) {
|
|
256
255
|
// material cache
|
|
257
256
|
const material_cache = new StaticMaterialCache();
|
|
258
257
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* NOTE: the method is completely
|
|
2
|
+
* NOTE: the method is completely inlined for better performance. 0 function calls within the skinning loop
|
|
3
3
|
* @param {Float32Array} destination Skinned vertex positions
|
|
4
4
|
* @param {SkinnedMesh} mesh
|
|
5
5
|
* @param {number} [destination_offset=0]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Matrix4 as ThreeMatrix4 } from "three";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* NOTE: the method is completely
|
|
4
|
+
* NOTE: the method is completely inlined for better performance. 0 function calls within the skinning loop
|
|
5
5
|
* @param {Float32Array} destination Skinned vertex positions
|
|
6
6
|
* @param {SkinnedMesh} mesh
|
|
7
7
|
* @param {number} [destination_offset=0]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialOptimizationContext.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/material/optimization/MaterialOptimizationContext.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MaterialOptimizationContext.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/material/optimization/MaterialOptimizationContext.js"],"names":[],"mappings":"AAkXA;IAEQ;;;OAGG;IACH,UAFU,MAAM,OAAO,EAAE,CAEP;IAElB;;;OAGG;IACH,QAFU,MAAM,IAAI,EAAE,CAEN;IAGhB;;;OAGG;IACH,SAFU,IAAI,MAAM,EAAC,SAAS,CAAC,CAEP;IAExB;;;OAGG;IACH,YAFU,SAAS,CAEC;IAGxB;;;OAGG;IACH,sBAFW,kBAAkB,EAAE,QAkE9B;IAED;;;OAGG;IACH,gCAFW,kBAAkB,EAAE,QAmE9B;IAED;;;OAGG;IACH,kCAFW,kBAAkB,QA4E5B;IAED;;;OAGG;IACH,cAFW,MAAM,IAAI,QAUpB;IAED;;;OAGG;IACH,iCAMC;IAED;;OAEG;IACH,eAwIC;IAED;;;OAGG;IACH,6BAFY,IAAI,MAAM,EAAE,iBAAiB,CAAC,CAyBzC;IAED;;;;OAIG;IACH,0CAHW,MAAM,cAAc,OACpB,kBAAkB,QA+C5B;CACJ;;0BAIS,MAAM;;0BAx0BU,oCAAoC;mCAK3B,yBAAyB;4BA3BrD,OAAO"}
|
|
@@ -12,7 +12,9 @@ import {
|
|
|
12
12
|
compute_typed_array_constructor_from_data_type
|
|
13
13
|
} from "../../../../core/binary/type/DataType2TypedArrayConstructorMapping.js";
|
|
14
14
|
import { array_push_if_unique } from "../../../../core/collection/array/array_push_if_unique.js";
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
compute_binary_data_type_from_typed_array
|
|
17
|
+
} from "../../../../core/collection/array/typed/compute_binary_data_type_from_typed_array.js";
|
|
16
18
|
import { collectIteratorValueToArray } from "../../../../core/collection/collectIteratorValueToArray.js";
|
|
17
19
|
import { HashMap } from "../../../../core/collection/map/HashMap.js";
|
|
18
20
|
import AABB2 from "../../../../core/geom/AABB2.js";
|
|
@@ -791,7 +793,7 @@ export class MaterialOptimizationContext {
|
|
|
791
793
|
//build new textures
|
|
792
794
|
for (const [name, sampler] of this.atlases) {
|
|
793
795
|
|
|
794
|
-
const sampler_data_type =
|
|
796
|
+
const sampler_data_type = compute_binary_data_type_from_typed_array(sampler.data);
|
|
795
797
|
|
|
796
798
|
const format = channelCountToThreeTextureFormat(sampler.itemSize);
|
|
797
799
|
const type = computeThreeTextureTypeFromDataType(sampler_data_type);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sampler2D.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/Sampler2D.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sampler2D.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/Sampler2D.js"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH;IAk8BI;;;;;;OAMG;IACH,6DAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,sDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,uDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,uDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,qDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,sDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,sDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,wDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,wDAFY,SAAS,CAKpB;IA3iCD;;;;;;;OAOG;IACH,mBANW,UAAU,MAAM,CAAC,GAAC,MAAM,EAAE,GAAC,iBAAiB,GAAC,UAAU,GAAC,WAAW,GAAC,WAAW,GA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;;;MAUC;IAED;;;;;;aAwBC;IAgHL;;;OAGG;IACH,sBAFU,OAAO,CAEc;CAN9B;;kBAUS,MAAM"}
|
|
@@ -3,8 +3,10 @@ import { Base64 } from "../../../../core/binary/Base64.js";
|
|
|
3
3
|
import {
|
|
4
4
|
compute_typed_array_constructor_from_data_type
|
|
5
5
|
} from "../../../../core/binary/type/DataType2TypedArrayConstructorMapping.js";
|
|
6
|
+
import {
|
|
7
|
+
compute_binary_data_type_from_typed_array
|
|
8
|
+
} from "../../../../core/collection/array/typed/compute_binary_data_type_from_typed_array.js";
|
|
6
9
|
import { is_typed_array_equals } from "../../../../core/collection/array/typed/is_typed_array_equals.js";
|
|
7
|
-
import { typedArrayToDataType } from "../../../../core/collection/array/typed/typedArrayToDataType.js";
|
|
8
10
|
import { clamp } from "../../../../core/math/clamp.js";
|
|
9
11
|
import { lerp } from "../../../../core/math/lerp.js";
|
|
10
12
|
import { max2 } from "../../../../core/math/max2.js";
|
|
@@ -949,7 +951,7 @@ export class Sampler2D {
|
|
|
949
951
|
height: this.height,
|
|
950
952
|
width: this.width,
|
|
951
953
|
itemSize: this.itemSize,
|
|
952
|
-
type:
|
|
954
|
+
type: compute_binary_data_type_from_typed_array(this.data),
|
|
953
955
|
data: encoded
|
|
954
956
|
}
|
|
955
957
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sampler2d_compute_texel_value_conversion_scale_to_uint8.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/sampler2d_compute_texel_value_conversion_scale_to_uint8.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sampler2d_compute_texel_value_conversion_scale_to_uint8.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/sampler2d_compute_texel_value_conversion_scale_to_uint8.js"],"names":[],"mappings":"AAUA;;;;GAIG;AACH;YAFsB,MAAM;WAAS,MAAM;EAqC1C"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { BinaryDataType } from "../../../../core/binary/type/BinaryDataType.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
compute_binary_data_type_from_typed_array
|
|
4
|
+
} from "../../../../core/collection/array/typed/compute_binary_data_type_from_typed_array.js";
|
|
4
5
|
import { isTypedArray } from "../../../../core/collection/array/typed/isTypedArray.js";
|
|
5
|
-
import {
|
|
6
|
+
import { max2 } from "../../../../core/math/max2.js";
|
|
7
|
+
import { min2 } from "../../../../core/math/min2.js";
|
|
6
8
|
import { sampler2d_channel_compute_max } from "./sampler2d_channel_compute_max.js";
|
|
7
9
|
import { sampler2d_channel_compute_min } from "./sampler2d_channel_compute_min.js";
|
|
8
10
|
|
|
@@ -16,7 +18,7 @@ export function sampler2d_compute_texel_value_conversion_scale_to_uint8(sampler)
|
|
|
16
18
|
let dataType;
|
|
17
19
|
|
|
18
20
|
if (isTypedArray(sampler.data)) {
|
|
19
|
-
dataType =
|
|
21
|
+
dataType = compute_binary_data_type_from_typed_array(sampler.data);
|
|
20
22
|
} else {
|
|
21
23
|
// plain numeric array
|
|
22
24
|
dataType = BinaryDataType.Float32;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Move UVs to reduce stretching
|
|
3
|
-
*
|
|
4
|
-
* @param {Float32Array} vertices
|
|
5
|
-
* @param {Float32Array} uvs
|
|
6
|
-
* @param {Uint16Array} faces
|
|
7
|
-
* @param {number} steps Number of optimization passes to perform
|
|
8
|
-
*/
|
|
9
|
-
export function tensionOptimizeUV(vertices: Float32Array, uvs: Float32Array, faces: Uint16Array, steps: number): void;
|
|
10
|
-
//# sourceMappingURL=tensionOptimizeUV.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tensionOptimizeUV.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/terrain/util/tensionOptimizeUV.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,4CALW,YAAY,OACZ,YAAY,SACZ,WAAW,SACX,MAAM,QAmEhB"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
const BufferGeometryWrap = function (bufferGeometry) {
|
|
3
|
-
this.source = bufferGeometry;
|
|
4
|
-
};
|
|
5
|
-
BufferGeometryWrap.prototype.bindVertex = function (index, v3, writeBack) {
|
|
6
|
-
const vertices = this.source.attributes.vertices;
|
|
7
|
-
const vArray = vertices.array;
|
|
8
|
-
const offset = (index * 3);
|
|
9
|
-
v3.set(vArray[offset], vArray[offset + 1], vArray[offset + 2]);
|
|
10
|
-
//
|
|
11
|
-
if (writeBack) {
|
|
12
|
-
v3.onChanged.add(function () {
|
|
13
|
-
vArray[offset] = v3.x;
|
|
14
|
-
vArray[offset + 1] = v3.y;
|
|
15
|
-
vArray[offset + 2] = v3.z;
|
|
16
|
-
vertices.needsUpdate = true;
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
BufferGeometryWrap.prototype.bindFace = function (index, face, writeBack) {
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
export default BufferGeometryWrap;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export class ClippedGeometry {
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @type {THREE.BufferGeometry}
|
|
5
|
-
*/
|
|
6
|
-
output: THREE.BufferGeometry;
|
|
7
|
-
/**
|
|
8
|
-
* @type {THREE.BufferGeometry}
|
|
9
|
-
*/
|
|
10
|
-
input: THREE.BufferGeometry;
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @type {Plane[]}
|
|
14
|
-
*/
|
|
15
|
-
planes: Plane[];
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @type {Uint32Array}
|
|
19
|
-
* @private
|
|
20
|
-
*/
|
|
21
|
-
private __input_buffer_indices;
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @type {Float32Array}
|
|
25
|
-
* @private
|
|
26
|
-
*/
|
|
27
|
-
private __input_buffer_positions;
|
|
28
|
-
/**
|
|
29
|
-
*
|
|
30
|
-
* @type {number}
|
|
31
|
-
* @private
|
|
32
|
-
*/
|
|
33
|
-
private __output_vertex_cursor;
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
* @type {number}
|
|
37
|
-
* @private
|
|
38
|
-
*/
|
|
39
|
-
private __output_index_cursor;
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* @param {number} input_index
|
|
43
|
-
* @private
|
|
44
|
-
*/
|
|
45
|
-
private __output_copy_face;
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
* @param {number} input_index
|
|
49
|
-
* @param {Plane} plane
|
|
50
|
-
* @private
|
|
51
|
-
*/
|
|
52
|
-
private __clip_face;
|
|
53
|
-
compute(): void;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=ClippedGeometry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClippedGeometry.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/geometry/clipping/ClippedGeometry.js"],"names":[],"mappings":"AAIA;IAGQ;;;OAGG;IACH,QAFU,MAAM,cAAc,CAEZ;IAElB;;OAEG;IACH,OAFU,MAAM,cAAc,CAEb;IAEjB;;;OAGG;IACH,QAFU,OAAO,CAED;IAEhB;;;;OAIG;IACH,+BAAkC;IAElC;;;;OAIG;IACH,iCAAoC;IAEpC;;;;OAIG;IACH,+BAA+B;IAE/B;;;;OAIG;IACH,8BAA8B;IAGlC;;;;OAIG;IACH,2BAEC;IAED;;;;;OAKG;IACH,oBA8DC;IAED,gBAUC;CACJ"}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { v3_distance_above_plane } from "../../../../core/geom/vec3/v3_distance_above_plane.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// TODO incomplete
|
|
5
|
-
export class ClippedGeometry {
|
|
6
|
-
constructor() {
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @type {THREE.BufferGeometry}
|
|
11
|
-
*/
|
|
12
|
-
this.output = null;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @type {THREE.BufferGeometry}
|
|
16
|
-
*/
|
|
17
|
-
this.input = null;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @type {Plane[]}
|
|
22
|
-
*/
|
|
23
|
-
this.planes = [];
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @type {Uint32Array}
|
|
28
|
-
* @private
|
|
29
|
-
*/
|
|
30
|
-
this.__input_buffer_indices = null;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @type {Float32Array}
|
|
35
|
-
* @private
|
|
36
|
-
*/
|
|
37
|
-
this.__input_buffer_positions = null;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
* @type {number}
|
|
42
|
-
* @private
|
|
43
|
-
*/
|
|
44
|
-
this.__output_vertex_cursor = 0
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
* @type {number}
|
|
49
|
-
* @private
|
|
50
|
-
*/
|
|
51
|
-
this.__output_index_cursor = 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
* @param {number} input_index
|
|
57
|
-
* @private
|
|
58
|
-
*/
|
|
59
|
-
__output_copy_face(input_index) {
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
*
|
|
65
|
-
* @param {number} input_index
|
|
66
|
-
* @param {Plane} plane
|
|
67
|
-
* @private
|
|
68
|
-
*/
|
|
69
|
-
__clip_face(input_index, plane) {
|
|
70
|
-
const input_indices = this.__input_buffer_indices;
|
|
71
|
-
const input_vertices = this.__input_buffer_positions;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
// read vertices
|
|
75
|
-
const index3 = input_index * 3;
|
|
76
|
-
|
|
77
|
-
const a = input_indices[index3];
|
|
78
|
-
const b = input_indices[index3 + 1];
|
|
79
|
-
const c = input_indices[index3 + 2];
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
// read positions
|
|
83
|
-
const a3 = a * 3;
|
|
84
|
-
|
|
85
|
-
const a_x = input_vertices[a3];
|
|
86
|
-
const a_y = input_vertices[a3 + 1];
|
|
87
|
-
const a_z = input_vertices[a3 + 2];
|
|
88
|
-
|
|
89
|
-
const b3 = b * 3;
|
|
90
|
-
|
|
91
|
-
const b_x = input_vertices[b3];
|
|
92
|
-
const b_y = input_vertices[b3 + 1];
|
|
93
|
-
const b_z = input_vertices[b3 + 2];
|
|
94
|
-
|
|
95
|
-
const c3 = c * 3;
|
|
96
|
-
|
|
97
|
-
const c_x = input_vertices[c3];
|
|
98
|
-
const c_y = input_vertices[c3 + 1];
|
|
99
|
-
const c_z = input_vertices[c3 + 2];
|
|
100
|
-
|
|
101
|
-
// compute distance to plane for each vertex
|
|
102
|
-
const normal = plane.normal;
|
|
103
|
-
|
|
104
|
-
const normal_x = normal.x;
|
|
105
|
-
const normal_y = normal.y;
|
|
106
|
-
const normal_z = normal.z;
|
|
107
|
-
|
|
108
|
-
const plane_constant = plane.constant;
|
|
109
|
-
|
|
110
|
-
const a_distance = v3_distance_above_plane(a_x, a_y, a_z, normal_x, normal_y, normal_z, plane_constant);
|
|
111
|
-
const b_distance = v3_distance_above_plane(b_x, b_y, b_z, normal_x, normal_y, normal_z, plane_constant);
|
|
112
|
-
const c_distance = v3_distance_above_plane(c_x, c_y, c_z, normal_x, normal_y, normal_z, plane_constant);
|
|
113
|
-
|
|
114
|
-
const a_out = a_distance <= 0;
|
|
115
|
-
const b_out = b_distance <= 0;
|
|
116
|
-
const c_out = c_distance <= 0;
|
|
117
|
-
|
|
118
|
-
// count vertices that are out
|
|
119
|
-
const out_count = (a_out ? 1 : 0) + (b_out ? 1 : 0) + (c_out ? 1 : 0);
|
|
120
|
-
|
|
121
|
-
switch (out_count) {
|
|
122
|
-
case 0:
|
|
123
|
-
// all points are above the plane
|
|
124
|
-
this.__output_copy_face(input_index);
|
|
125
|
-
case 3:
|
|
126
|
-
// all points are below
|
|
127
|
-
// fallthrough
|
|
128
|
-
default:
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
compute() {
|
|
134
|
-
const planes = this.planes;
|
|
135
|
-
const plane_count = planes.length;
|
|
136
|
-
|
|
137
|
-
for (let i = 0; i < plane_count; i++) {
|
|
138
|
-
const plane = planes[i];
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
}
|