@woosh/meep-engine 2.118.9 → 2.118.11
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 +192 -266
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +192 -266
- package/editor/ecs/component/editors/Sampler2DEditor.js +2 -4
- package/package.json +1 -1
- package/samples/terrain/editor.js +3 -3
- package/src/core/bvh2/binary/2/BinaryUint32BVH.d.ts +1 -19
- package/src/core/bvh2/binary/2/BinaryUint32BVH.d.ts.map +1 -1
- package/src/core/bvh2/binary/2/BinaryUint32BVH.js +10 -78
- package/src/core/bvh2/bvh3/build_triangle_morton_codes.js +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.js +9 -7
- package/src/core/collection/array/isArrayEqualStrict.d.ts.map +1 -1
- package/src/core/collection/array/isArrayEqualStrict.js +2 -2
- package/src/core/collection/array/iterator/ArrayIteratorSequential.d.ts.map +1 -1
- package/src/core/collection/array/iterator/ArrayIteratorSequential.js +3 -4
- package/src/core/collection/queue/Deque.d.ts.map +1 -1
- package/src/core/collection/queue/Deque.js +1 -1
- package/src/core/geom/3d/aabb/AABB3.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/AABB3.js +0 -8
- package/src/core/geom/3d/morton/{Morton.d.ts → v3_morton_encode.d.ts} +1 -1
- package/src/core/geom/3d/morton/v3_morton_encode.d.ts.map +1 -0
- package/src/core/geom/3d/morton/v3_morton_encode_bounded.js +2 -2
- package/src/core/geom/3d/morton/v3_morton_encode_transformed.js +2 -2
- package/src/core/geom/Quaternion.d.ts.map +1 -1
- package/src/core/geom/Quaternion.js +7 -10
- package/src/core/geom/Vector3.d.ts.map +1 -1
- package/src/core/geom/Vector3.js +4 -49
- package/src/core/math/sinc.d.ts +8 -0
- package/src/core/math/sinc.d.ts.map +1 -0
- package/src/core/math/sinc.js +13 -0
- package/src/core/process/worker/WorkerProxy.d.ts +12 -3
- package/src/core/process/worker/WorkerProxy.d.ts.map +1 -1
- package/src/core/process/worker/WorkerProxy.js +10 -1
- package/src/engine/ecs/terrain/BufferedGeometryArraysBuilder.d.ts +2 -17
- package/src/engine/ecs/terrain/BufferedGeometryArraysBuilder.d.ts.map +1 -1
- package/src/engine/ecs/terrain/BufferedGeometryArraysBuilder.js +2 -118
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrain.d.ts +0 -1
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrain.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrain.js +1 -6
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.d.ts +5 -5
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.js +20 -28
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayer.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayer.js +2 -2
- package/src/engine/ecs/terrain/tiles/TerrainTile.d.ts.map +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTile.js +3 -1
- package/src/engine/graphics/geometry/MikkT/MikkTSpace.d.ts +1 -1
- package/src/engine/graphics/geometry/MikkT/MikkTSpace.js +12 -12
- package/src/engine/graphics/geometry/MikkT/STSpace.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/STSpace.js +14 -16
- package/src/engine/graphics/geometry/buffered/build_height_field_geometry.d.ts +17 -0
- package/src/engine/graphics/geometry/buffered/build_height_field_geometry.d.ts.map +1 -0
- package/src/engine/graphics/geometry/buffered/build_height_field_geometry.js +118 -0
- package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.d.ts +2 -2
- package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.d.ts.map +1 -1
- package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.js +1 -1
- package/src/engine/graphics/material/optimization/MaterialOptimizationContext.d.ts.map +1 -1
- package/src/engine/graphics/material/optimization/MaterialOptimizationContext.js +2 -2
- package/src/engine/graphics/render/forward_plus/materials/FPlusDebugMaterial.js +3 -3
- package/src/engine/graphics/texture/sampler/Sampler2D.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/Sampler2D.js +31 -52
- package/src/engine/graphics/texture/sampler/sampler2d_to_texture.d.ts +10 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_texture.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/{Sampler2D2Texture.js → sampler2d_to_texture.js} +5 -5
- package/src/engine/graphics/texture/sampler/{copy_Sampler2D_channel_data.d.ts → sampler2d_transfer_data.d.ts} +2 -2
- package/src/engine/graphics/texture/sampler/sampler2d_transfer_data.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/{copy_Sampler2D_channel_data.js → sampler2d_transfer_data.js} +1 -1
- package/src/engine/graphics/texture/sampler/writeSampler2DDataToDataTexture.js +2 -2
- package/src/engine/graphics/trail/x/simulator/RibbonXFixedPhysicsSimulator.d.ts.map +1 -1
- package/src/engine/graphics/trail/x/simulator/RibbonXFixedPhysicsSimulator.js +0 -3
- package/src/engine/intelligence/behavior/selector/WeightedElement.d.ts +6 -3
- package/src/engine/intelligence/behavior/selector/WeightedElement.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedElement.js +9 -12
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.js +20 -23
- package/src/engine/intelligence/mcts/StateNode.d.ts.map +1 -1
- package/src/engine/intelligence/mcts/StateNode.js +76 -102
- package/src/engine/logging/Logger.d.ts.map +1 -1
- package/src/engine/logging/Logger.js +7 -9
- package/src/engine/logging/LoggerBackend.d.ts.map +1 -1
- package/src/engine/logging/LoggerBackend.js +7 -7
- package/src/core/geom/3d/morton/Morton.d.ts.map +0 -1
- package/src/engine/graphics/geometry/MikkT/m_getNumVerticesOfFace.d.ts +0 -9
- package/src/engine/graphics/geometry/MikkT/m_getNumVerticesOfFace.d.ts.map +0 -1
- package/src/engine/graphics/geometry/MikkT/m_getNumVerticesOfFace.js +0 -11
- package/src/engine/graphics/geometry/MikkT/m_getPosition.d.ts +0 -14
- package/src/engine/graphics/geometry/MikkT/m_getPosition.d.ts.map +0 -1
- package/src/engine/graphics/geometry/MikkT/m_getPosition.js +0 -20
- package/src/engine/graphics/geometry/MikkT/m_setTSpaceBasic.d.ts +0 -21
- package/src/engine/graphics/geometry/MikkT/m_setTSpaceBasic.d.ts.map +0 -1
- package/src/engine/graphics/geometry/MikkT/m_setTSpaceBasic.js +0 -22
- package/src/engine/graphics/texture/sampler/Sampler2D2Texture.d.ts +0 -10
- package/src/engine/graphics/texture/sampler/Sampler2D2Texture.d.ts.map +0 -1
- package/src/engine/graphics/texture/sampler/copy_Sampler2D_channel_data.d.ts.map +0 -1
- /package/src/core/geom/3d/morton/{Morton.js → v3_morton_encode.js} +0 -0
package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry_compute_vertex_normals_indexed.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.js"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,mEAJW,MAAO,MAAM,CAAC,GAAC,YAAY,WAC3B,MAAO,MAAM,CAAC,GAAC,YAAY,WAC3B,MAAO,MAAM,CAAC,GAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"geometry_compute_vertex_normals_indexed.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.js"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,mEAJW,MAAO,MAAM,CAAC,GAAC,YAAY,WAC3B,MAAO,MAAM,CAAC,GAAC,YAAY,WAC3B,MAAO,MAAM,CAAC,GAAC,WAAW,GAAC,WAAW,GAAC,UAAU,QAgC3D"}
|
|
@@ -9,7 +9,7 @@ const scratch_v3 = new Float64Array(3);
|
|
|
9
9
|
* Prior to calling this function, normals need to be set to 0
|
|
10
10
|
* @param {Array.<number>|Float32Array} positions
|
|
11
11
|
* @param {Array.<number>|Float32Array} normals
|
|
12
|
-
* @param {Array.<number>|Uint32Array} indices
|
|
12
|
+
* @param {Array.<number>|Uint32Array|Uint16Array|Uint8Array} indices
|
|
13
13
|
*/
|
|
14
14
|
export function geometry_compute_vertex_normals_indexed(
|
|
15
15
|
positions,
|
|
@@ -1 +1 @@
|
|
|
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;;
|
|
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;;0BAz0BU,oCAAoC;mCAM3B,yBAAyB;4BA3BrD,OAAO"}
|
|
@@ -27,10 +27,10 @@ import { channelCountToThreeTextureFormat } from "../../texture/channelCountToTh
|
|
|
27
27
|
import { computeThreeTextureTypeFromDataType } from "../../texture/computeThreeTextureTypeFromDataType.js";
|
|
28
28
|
import { normalized_internal_format } from "../../texture/normalized_internal_format.js";
|
|
29
29
|
import { convertTexture2Sampler2D } from "../../texture/sampler/convertTexture2Sampler2D.js";
|
|
30
|
-
import { copy_Sampler2D_channel_data } from "../../texture/sampler/copy_Sampler2D_channel_data.js";
|
|
31
30
|
import { Sampler2D } from "../../texture/sampler/Sampler2D.js";
|
|
32
31
|
import { sampler2d_copy_channel_data } from "../../texture/sampler/sampler2d_copy_channel_data.js";
|
|
33
32
|
import { sampler2d_sub_copy_same_item_size } from "../../texture/sampler/sampler2d_sub_copy_same_item_size.js";
|
|
33
|
+
import { sampler2d_transfer_data } from "../../texture/sampler/sampler2d_transfer_data.js";
|
|
34
34
|
import { BUFFER_GEOMETRY_UVS } from "./BUFFER_GEOMETRY_UVS.js";
|
|
35
35
|
import { is_compliant_mesh } from "./is_compliant_mesh.js";
|
|
36
36
|
import { MaterialDescriptor } from "./MaterialDescriptor.js";
|
|
@@ -198,7 +198,7 @@ function extract_texture_data(destination, source, texture_name) {
|
|
|
198
198
|
sampler2d_copy_channel_data(source, 2, destination, 0);
|
|
199
199
|
break;
|
|
200
200
|
default:
|
|
201
|
-
|
|
201
|
+
sampler2d_transfer_data(source, destination);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GLSL3, ShaderMaterial, Vector2, Vector3 } from "three";
|
|
2
|
-
import { Sampler2D } from "../../../texture/sampler/Sampler2D.js";
|
|
3
|
-
import sampler2D2Texture from "../../../texture/sampler/Sampler2D2Texture.js";
|
|
4
2
|
import { ParameterLookupTable } from "../../../particles/particular/engine/parameter/ParameterLookupTable.js";
|
|
3
|
+
import { Sampler2D } from "../../../texture/sampler/Sampler2D.js";
|
|
4
|
+
import sampler2d_to_texture from "../../../texture/sampler/sampler2d_to_texture.js";
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
const v_shader = `
|
|
@@ -155,7 +155,7 @@ export class FPlusDebugMaterial extends ShaderMaterial {
|
|
|
155
155
|
heatmap_sampler.set(i, 0, r);
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
const heatmap_texture =
|
|
158
|
+
const heatmap_texture = sampler2d_to_texture(heatmap_sampler);
|
|
159
159
|
|
|
160
160
|
this.uniforms.t_heatmap_lookup.value = heatmap_texture;
|
|
161
161
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sampler2D.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/Sampler2D.js"],"names":[],"mappings":"AAmBA;;;;GAIG;AACH;
|
|
1
|
+
{"version":3,"file":"Sampler2D.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/Sampler2D.js"],"names":[],"mappings":"AAmBA;;;;GAIG;AACH;IA66BI;;;;;;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;IAthCD;;;;;;;OAOG;IACH,mBANW,UAAU,MAAM,CAAC,GAAC,MAAM,EAAE,GAAC,iBAAiB,GAAC,UAAU,GAAC,WAAW,GAAC,WAAW,GAAC,SAAS,GAAC,UAAU,GAAC,UAAU,GAAC,YAAY,GAAC,YAAY,aACzI,MAAM,UACN,MAAM,WACN,MAAM,EAmDhB;IA7BG;;;OAGG;IACH,OAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,QAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,UAFU,MAAM,CAEQ;IAExB;;;OAGG;IACH,MAFU,MAAM,EAAE,GAAC,iBAAiB,GAAC,UAAU,GAAC,WAAW,GAAC,WAAW,GAAC,SAAS,GAAC,UAAU,GAAC,UAAU,GAAC,YAAY,GAAC,YAAY,CAEjH;IAEhB;;;OAGG;IACH,SAFU,MAAM,CAEA;IAGpB;;;;;OAKG;IACH,sBAJW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,QAQlB;IAED;;;;;;OAMG;IACH,6BALW,MAAM,KACN,MAAM,WACN,MAAM,GACJ,MAAM,CAOlB;IAED;;;;;;;OAOG;IACH,2BALW,MAAM,KACN,MAAM,WACN,MAAM,GACJ,MAAM,CA2DlB;IAED;;;;;OAKG;IACH,mBAJW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,QAQlB;IAED;;;;;;OAMG;IACH,iBALW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,MAAM,QAUhB;IAED;;;;;;OAMG;IACH,0BALW,MAAM,KACN,MAAM,WACN,MAAM,GACJ,MAAM,CAOlB;IAED;;;;;;;OAOG;IACH,wBALW,MAAM,KACN,MAAM,WACN,MAAM,GACJ,MAAM,CAgFlB;IAED;;;;;;OAMG;IACH,oBALW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,GAAC,YAAY,kBACrB,MAAM,QAUhB;IAED;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,kBAClC,MAAM,QAWhB;IAED;;;;;;OAMG;IACH,2BALW,MAAM,KACN,MAAM,WACN,MAAM,GACL,MAAM,CAOjB;IAED;;;;;;OAMG;IACH,yBALW,MAAM,KACN,MAAM,WACN,MAAM,GACJ,MAAM,CAiFlB;IAED;;;;;OAKG;IACH,mBAJW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,QAcpC;IAED;;;;;;OAMG;IACH,eALW,MAAM,KACN,MAAM,WACN,MAAM,GACJ,MAAM,CAalB;IAED;;;;;OAKG;IACH,QAJW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,QAalB;IAED;;;;;OAKG;IACH,SAJW,MAAM,KACN,MAAM,QACN,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,QAapC;IAED;;;;;OAKG;IACH,eAJW,MAAM,KACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;;OAIG;IACH,mBAHW,MAAM,yBAUhB;IAED;;;;;;;;;OASG;IACH,aARW,SAAS,qHAoDnB;IAGD;;;;;;;OAOG;IACH,oEA8BC;IAED;;;;OAIG;IACH,2BAHW,MAAM,SACN,MAAM,QAYhB;IAED;;;;;;;OAOG;IACH,QANW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,SACN,MAAO,MAAM,CAAC,QAqCxB;IAED;;;;;;OAMG;IACH,gBALW,MAAM,KACN,MAAM,WACN,MAAM,SACN,MAAM,QAqBhB;IAED;;;;;OAKG;IACH,OAJW,MAAM,KACN,MAAM,SACN,MAAM,EAAE,GAAC,YAAY,QAe/B;IAED;;;;;;;OAOG;IACH,wBALW,MAAM,WACN,MAAM,UACN,MAAM,sBAyBhB;IAED;;;;;OAKG;IACH,UAJW,MAAM,KACN,MAAM,iBACN,OAAO,QAyDjB;IAED;;;OAGG;IACH,mBAFY,MAAM,CAejB;IAED;;;;OAIG;IACH,cAHW,SAAS,GACR,OAAO,CAiBlB;IAED;;;OAGG;IACH,QAFY,MAAM,CAUjB;IAGD;;OAEG;IACH,SAFa,SAAS,CAerB;IAED;;;;;;MAUC;IAED;;;;;;aAwBC;IAgHL;;;OAGG;IACH,sBAFU,OAAO,CAEc;CAN9B;;kBAUS,MAAM"}
|
|
@@ -3,11 +3,11 @@ import { Base64 } from "../../../../core/binary/base64/Base64.js";
|
|
|
3
3
|
import {
|
|
4
4
|
compute_typed_array_constructor_from_data_type
|
|
5
5
|
} from "../../../../core/binary/type/DataType2TypedArrayConstructorMapping.js";
|
|
6
|
-
import { computeStridedIntegerArrayHash } from "../../../../core/collection/array/computeStridedIntegerArrayHash.js";
|
|
7
6
|
import {
|
|
8
7
|
compute_binary_data_type_from_typed_array
|
|
9
8
|
} from "../../../../core/collection/array/typed/compute_binary_data_type_from_typed_array.js";
|
|
10
9
|
import { is_typed_array_equals } from "../../../../core/collection/array/typed/is_typed_array_equals.js";
|
|
10
|
+
import { sparse_typed_array_hash } from "../../../../core/collection/array/typed/sparse_typed_array_hash.js";
|
|
11
11
|
import {
|
|
12
12
|
typedArrayConstructorByInstance
|
|
13
13
|
} from "../../../../core/collection/array/typed/typedArrayConstructorByInstance.js";
|
|
@@ -52,19 +52,19 @@ export class Sampler2D {
|
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
*
|
|
55
|
-
* @type {
|
|
55
|
+
* @type {number}
|
|
56
56
|
*/
|
|
57
57
|
this.width = width;
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
*
|
|
61
|
-
* @type {
|
|
61
|
+
* @type {number}
|
|
62
62
|
*/
|
|
63
63
|
this.height = height;
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* Number of channels
|
|
67
|
-
* @type {
|
|
67
|
+
* @type {number}
|
|
68
68
|
*/
|
|
69
69
|
this.itemSize = itemSize;
|
|
70
70
|
|
|
@@ -81,18 +81,6 @@ export class Sampler2D {
|
|
|
81
81
|
this.version = 0;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
/**
|
|
85
|
-
*
|
|
86
|
-
* @deprecated
|
|
87
|
-
* @param {number} x
|
|
88
|
-
* @param {number}y
|
|
89
|
-
* @param {Vector1|Vector2|Vector3|Vector4} result
|
|
90
|
-
* @returns {number}
|
|
91
|
-
*/
|
|
92
|
-
get(x, y, result) {
|
|
93
|
-
throw new Error("Deprecated method, use sampleBilinear instead");
|
|
94
|
-
}
|
|
95
|
-
|
|
96
84
|
/**
|
|
97
85
|
*
|
|
98
86
|
* @param {number} u
|
|
@@ -115,8 +103,8 @@ export class Sampler2D {
|
|
|
115
103
|
* @returns {number}
|
|
116
104
|
*/
|
|
117
105
|
sampleChannelCatmullRomUV(u, v, channel) {
|
|
118
|
-
const x = u *
|
|
119
|
-
const y = v *
|
|
106
|
+
const x = u * this.width - 0.5;
|
|
107
|
+
const y = v * this.height - 0.5;
|
|
120
108
|
|
|
121
109
|
return this.sampleChannelCatmullRom(x, y, channel);
|
|
122
110
|
}
|
|
@@ -171,8 +159,8 @@ export class Sampler2D {
|
|
|
171
159
|
const texPos12_x = texPos1_x + offset12_x;
|
|
172
160
|
const texPos12_y = texPos1_y + offset12_y;
|
|
173
161
|
|
|
174
|
-
|
|
175
162
|
let result = 0.0;
|
|
163
|
+
|
|
176
164
|
result += this.sampleChannelBilinear(texPos0_x, texPos0_y, channel) * w0_x * w0_y;
|
|
177
165
|
result += this.sampleChannelBilinear(texPos12_x, texPos0_y, channel) * w12_x * w0_y;
|
|
178
166
|
result += this.sampleChannelBilinear(texPos3_x, texPos0_y, channel) * w3_x * w0_y;
|
|
@@ -234,8 +222,8 @@ export class Sampler2D {
|
|
|
234
222
|
}
|
|
235
223
|
|
|
236
224
|
/**
|
|
237
|
-
*
|
|
238
|
-
* Bicubic-filtered sampling
|
|
225
|
+
*
|
|
226
|
+
* Bicubic-filtered sampling, note values can be negative due to the nature of the cubic curve
|
|
239
227
|
* @param {number} x
|
|
240
228
|
* @param {number} y
|
|
241
229
|
* @param {number} channel
|
|
@@ -471,7 +459,11 @@ export class Sampler2D {
|
|
|
471
459
|
const x = Math.round(u * w - 0.5);
|
|
472
460
|
const y = Math.round(v * h - 0.5);
|
|
473
461
|
|
|
474
|
-
this.read(
|
|
462
|
+
this.read(
|
|
463
|
+
clamp(x, 0, w - 1),
|
|
464
|
+
clamp(y, 0, h - 1),
|
|
465
|
+
result
|
|
466
|
+
);
|
|
475
467
|
}
|
|
476
468
|
|
|
477
469
|
/**
|
|
@@ -532,25 +524,6 @@ export class Sampler2D {
|
|
|
532
524
|
}
|
|
533
525
|
}
|
|
534
526
|
|
|
535
|
-
/**
|
|
536
|
-
*
|
|
537
|
-
* @param {number} u
|
|
538
|
-
* @param {number} v
|
|
539
|
-
* @param {Vector4|Vector3|Vector2} [result]
|
|
540
|
-
* @deprecated
|
|
541
|
-
*/
|
|
542
|
-
sample(u, v, result) {
|
|
543
|
-
console.warn("Deprecated method, use sampleBilinear instead");
|
|
544
|
-
|
|
545
|
-
const temp = [];
|
|
546
|
-
|
|
547
|
-
this.sampleBilinear(u * (this.width - 1), v * (this.height - 1), temp, 0);
|
|
548
|
-
|
|
549
|
-
result.readFromArray(temp);
|
|
550
|
-
|
|
551
|
-
return temp[0];
|
|
552
|
-
}
|
|
553
|
-
|
|
554
527
|
/**
|
|
555
528
|
*
|
|
556
529
|
* @param {number} x
|
|
@@ -691,11 +664,11 @@ export class Sampler2D {
|
|
|
691
664
|
|
|
692
665
|
/**
|
|
693
666
|
*
|
|
694
|
-
* @param {
|
|
695
|
-
* @param {
|
|
696
|
-
* @param {
|
|
697
|
-
* @param {
|
|
698
|
-
* @param {Array.<
|
|
667
|
+
* @param {number} x
|
|
668
|
+
* @param {number} y
|
|
669
|
+
* @param {number} width
|
|
670
|
+
* @param {number} height
|
|
671
|
+
* @param {Array.<number>} value
|
|
699
672
|
*/
|
|
700
673
|
fill(x, y, width, height, value) {
|
|
701
674
|
|
|
@@ -885,10 +858,13 @@ export class Sampler2D {
|
|
|
885
858
|
computeByteSize() {
|
|
886
859
|
let dataSize;
|
|
887
860
|
|
|
888
|
-
|
|
889
|
-
|
|
861
|
+
const data = this.data;
|
|
862
|
+
|
|
863
|
+
if (Array.isArray(data)) {
|
|
864
|
+
// Assume IEEE float 64
|
|
865
|
+
dataSize = 8 * data.length;
|
|
890
866
|
} else {
|
|
891
|
-
dataSize =
|
|
867
|
+
dataSize = data.buffer.byteLength;
|
|
892
868
|
}
|
|
893
869
|
|
|
894
870
|
return dataSize + 280;
|
|
@@ -900,6 +876,11 @@ export class Sampler2D {
|
|
|
900
876
|
* @return {boolean}
|
|
901
877
|
*/
|
|
902
878
|
equals(other) {
|
|
879
|
+
if(this === other){
|
|
880
|
+
// special case
|
|
881
|
+
return true;
|
|
882
|
+
}
|
|
883
|
+
|
|
903
884
|
if (
|
|
904
885
|
this.width !== other.width
|
|
905
886
|
|| this.height !== other.height
|
|
@@ -920,9 +901,7 @@ export class Sampler2D {
|
|
|
920
901
|
|
|
921
902
|
const length = this.data.length;
|
|
922
903
|
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
hash ^= computeStridedIntegerArrayHash(this.data, 0, length, stride);
|
|
904
|
+
hash ^= sparse_typed_array_hash(this.data, 0, length, 509);
|
|
926
905
|
|
|
927
906
|
return hash;
|
|
928
907
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default sampler2d_to_texture;
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param {Sampler2D} sampler
|
|
5
|
+
* @return {DataTexture}
|
|
6
|
+
*/
|
|
7
|
+
declare function sampler2d_to_texture(sampler: Sampler2D): DataTexture;
|
|
8
|
+
import { Sampler2D } from "./Sampler2D.js";
|
|
9
|
+
import { DataTexture } from 'three';
|
|
10
|
+
//# sourceMappingURL=sampler2d_to_texture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampler2d_to_texture.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/sampler2d_to_texture.js"],"names":[],"mappings":";AAMA;;;;GAIG;AACH,+CAHW,SAAS,GACR,WAAW,CAsCtB;0BA7CyB,gBAAgB;4BAFqC,OAAO"}
|
package/src/engine/graphics/texture/sampler/{Sampler2D2Texture.js → sampler2d_to_texture.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ClampToEdgeWrapping, DataTexture, RGBAFormat, UnsignedByteType } from 'three';
|
|
2
2
|
import { assert } from "../../../../core/assert.js";
|
|
3
|
-
import { copy_Sampler2D_channel_data } from "./copy_Sampler2D_channel_data.js";
|
|
4
3
|
import { Sampler2D } from "./Sampler2D.js";
|
|
4
|
+
import { sampler2d_transfer_data } from "./sampler2d_transfer_data.js";
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -9,8 +9,8 @@ import { Sampler2D } from "./Sampler2D.js";
|
|
|
9
9
|
* @param {Sampler2D} sampler
|
|
10
10
|
* @return {DataTexture}
|
|
11
11
|
*/
|
|
12
|
-
function
|
|
13
|
-
assert.
|
|
12
|
+
function sampler2d_to_texture(sampler) {
|
|
13
|
+
assert.defined(sampler, 'sampler');
|
|
14
14
|
|
|
15
15
|
const result = new DataTexture();
|
|
16
16
|
result.format = RGBAFormat;
|
|
@@ -23,7 +23,7 @@ function sampler2D2Texture(sampler) {
|
|
|
23
23
|
|
|
24
24
|
} else {
|
|
25
25
|
const dest = Sampler2D.uint8(4, sampler.width, sampler.height);
|
|
26
|
-
|
|
26
|
+
sampler2d_transfer_data(sampler, dest);
|
|
27
27
|
|
|
28
28
|
data = dest.data;
|
|
29
29
|
}
|
|
@@ -47,4 +47,4 @@ function sampler2D2Texture(sampler) {
|
|
|
47
47
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export default
|
|
50
|
+
export default sampler2d_to_texture;
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* @param {Sampler2D} source
|
|
5
5
|
* @param {Sampler2D} destination
|
|
6
6
|
*/
|
|
7
|
-
export function
|
|
8
|
-
//# sourceMappingURL=
|
|
7
|
+
export function sampler2d_transfer_data(source: Sampler2D, destination: Sampler2D): void;
|
|
8
|
+
//# sourceMappingURL=sampler2d_transfer_data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampler2d_transfer_data.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/sampler2d_transfer_data.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,yFAiEC"}
|
|
@@ -6,7 +6,7 @@ import { saturated_value_by_constructor } from "./saturated_value_by_constructor
|
|
|
6
6
|
* @param {Sampler2D} source
|
|
7
7
|
* @param {Sampler2D} destination
|
|
8
8
|
*/
|
|
9
|
-
export function
|
|
9
|
+
export function sampler2d_transfer_data(source, destination) {
|
|
10
10
|
if (source.width !== destination.width || source.height !== destination.height) {
|
|
11
11
|
throw new Error('Source and destination dimensions do not match');
|
|
12
12
|
}
|
|
@@ -16,11 +16,11 @@ export function writeSample2DDataToDataTexture(sampler, texture) {
|
|
|
16
16
|
}
|
|
17
17
|
} else if (sampler.itemSize === 3) {
|
|
18
18
|
if (texture.format !== RGBFormat) {
|
|
19
|
-
throw new Error('itemSize is
|
|
19
|
+
throw new Error('itemSize is 3 and texture.format is not RGBFormat');
|
|
20
20
|
}
|
|
21
21
|
} else if (sampler.itemSize === 4) {
|
|
22
22
|
if (texture.format !== RGBAFormat) {
|
|
23
|
-
throw new Error('itemSize is
|
|
23
|
+
throw new Error('itemSize is 4 and texture.format is not RGBAFormat');
|
|
24
24
|
}
|
|
25
25
|
} else {
|
|
26
26
|
throw new Error('Unsupported itemSize');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RibbonXFixedPhysicsSimulator.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/trail/x/simulator/RibbonXFixedPhysicsSimulator.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;
|
|
1
|
+
{"version":3,"file":"RibbonXFixedPhysicsSimulator.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/trail/x/simulator/RibbonXFixedPhysicsSimulator.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IAEI;;;;;OAKG;IACH,iCAHW,MAAM,aACN,MAAM,QAkBhB;CACJ"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @template T
|
|
3
|
+
*/
|
|
4
|
+
export class WeightedElement<T> {
|
|
2
5
|
/**
|
|
3
6
|
* @template T
|
|
4
7
|
* @param {T} element
|
|
5
8
|
* @param {number} weight
|
|
6
9
|
* @returns {WeightedElement<T>}
|
|
7
10
|
*/
|
|
8
|
-
static from<T_1>(element: T_1, weight: number):
|
|
11
|
+
static from<T_1>(element: T_1, weight: number): WeightedElement<T_1>;
|
|
9
12
|
/**
|
|
10
13
|
* @template X
|
|
11
14
|
* @param {WeightedElement<X>} object
|
|
12
15
|
* @return {number}
|
|
13
16
|
*/
|
|
14
|
-
static getWeight<X>(object:
|
|
17
|
+
static getWeight<X>(object: WeightedElement<X>): number;
|
|
15
18
|
weight: number;
|
|
16
19
|
/**
|
|
17
20
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WeightedElement.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/selector/WeightedElement.js"],"names":[],"mappings":"AAMA;
|
|
1
|
+
{"version":3,"file":"WeightedElement.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/selector/WeightedElement.js"],"names":[],"mappings":"AAMA;;GAEG;AACH;IAWI;;;;;OAKG;IACH,uCAHW,MAAM,wBAYhB;IAED;;;;OAIG;IACH,iDAFY,MAAM,CAIjB;IAhCD,eAAW;IAEX;;;OAGG;IACH,MAFU,CAAC,CAEC;IA4BZ;;;;OAIG;IACH,cAHW,CAAC,GACA,OAAO,CAKlB;IAED;;;OAGG;IACH,QAFY,MAAM,CAOjB;IAGL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAN1C"}
|
|
@@ -4,22 +4,19 @@ import { invokeObjectEquals } from "../../../../core/model/object/invokeObjectEq
|
|
|
4
4
|
import { invokeObjectHash } from "../../../../core/model/object/invokeObjectHash.js";
|
|
5
5
|
import { computeHashFloat } from "../../../../core/primitives/numbers/computeHashFloat.js";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @template T
|
|
9
|
+
*/
|
|
7
10
|
export class WeightedElement {
|
|
8
11
|
|
|
9
|
-
/**
|
|
10
|
-
* @template T
|
|
11
|
-
*/
|
|
12
|
-
constructor() {
|
|
13
|
-
|
|
14
|
-
this.weight = 1;
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
* @type {T}
|
|
19
|
-
*/
|
|
20
|
-
this.data = null;
|
|
13
|
+
weight = 1;
|
|
21
14
|
|
|
22
|
-
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @type {T}
|
|
18
|
+
*/
|
|
19
|
+
data = null;
|
|
23
20
|
|
|
24
21
|
/**
|
|
25
22
|
* @template T
|
|
@@ -38,7 +38,7 @@ export class WeightedRandomBehavior extends Behavior<any> {
|
|
|
38
38
|
*
|
|
39
39
|
* @param {WeightedElement<Behavior>} e
|
|
40
40
|
*/
|
|
41
|
-
addElement(e: any): void;
|
|
41
|
+
addElement(e: WeightedElement<Behavior<any>>): void;
|
|
42
42
|
__select(): void;
|
|
43
43
|
initialize(context: any): void;
|
|
44
44
|
tick(timeDelta: any): import("../BehaviorStatus.js").BehaviorStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WeightedRandomBehavior.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/selector/WeightedRandomBehavior.js"],"names":[],"mappings":"AAMA;
|
|
1
|
+
{"version":3,"file":"WeightedRandomBehavior.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/selector/WeightedRandomBehavior.js"],"names":[],"mappings":"AAMA;IA0DI;;;;OAIG;IACH,sBAHW,8BAAyB,EAAE,GACzB,sBAAsB,CAQlC;;IAnED;;;;OAIG;IACH,mBAAgB;IAEhB;;;;OAIG;IACH,iBAA+B;IAE/B;;;;OAIG;IACH,mBAAuB;IAEvB;;;OAGG;IACH,iBAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,sBAFW,8BAAyB,EAAE,QAMrC;IAED;;;OAGG;IACH,cAFW,8BAAyB,QAanC;IAeD,iBAQC;IAED,+BAMC;IAUD,oEAEC;CACJ;yBAvGwB,gBAAgB;gCACT,sBAAsB"}
|
|
@@ -1,34 +1,31 @@
|
|
|
1
|
+
import { assert } from "../../../../core/assert.js";
|
|
2
|
+
import { weightedRandomFromArray } from "../../../../core/collection/array/weightedRandomFromArray.js";
|
|
1
3
|
import { seededRandom } from "../../../../core/math/random/seededRandom.js";
|
|
2
4
|
import { Behavior } from "../Behavior.js";
|
|
3
|
-
import { weightedRandomFromArray } from "../../../../core/collection/array/weightedRandomFromArray.js";
|
|
4
5
|
import { WeightedElement } from "./WeightedElement.js";
|
|
5
|
-
import { assert } from "../../../../core/assert.js";
|
|
6
6
|
|
|
7
7
|
export class WeightedRandomBehavior extends Behavior {
|
|
8
|
-
constructor() {
|
|
9
|
-
super();
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @type {WeightedElement<Behavior>[]} elements
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
14
|
+
__elements = [];
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @type {function(): number}
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
21
|
+
__random = seededRandom(91512);
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @type {Behavior|undefined}
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
__selected = undefined;
|
|
32
29
|
|
|
33
30
|
/**
|
|
34
31
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateNode.d.ts","sourceRoot":"","sources":["../../../../../src/engine/intelligence/mcts/StateNode.js"],"names":[],"mappings":"wBAKU,MAAM;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"StateNode.d.ts","sourceRoot":"","sources":["../../../../../src/engine/intelligence/mcts/StateNode.js"],"names":[],"mappings":"wBAKU,MAAM;;;;;;;;;AAyDhB;;GAEG;AACH;IAEI;;;OAGG;IACH,OAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,MAFU,MAAM,CAEP;IAET;;;OAGG;IACH,QAFU,MAAM,CAEL;IAGX;;;OAGG;IACH,UAFU,MAAM,CAEH;IAEb;;;OAGG;IACH,gBAFU,MAAM,CAEG;IAEnB;;;OAGG;IACH,QAFU,IAAI,sBAAU,CAEV;IAEd;;;OAGG;IACH,OAFU,IAAI,GAAC,eAAU,CAEZ;IAEb;;;OAGG;IACH,MAFU,SAAS,CAEQ;IAG3B,+BASC;IAED;;OAEG;IACH,gCAuCC;IAED;;;;;OAKG;IACH,sEAFa,MAAM,CAyBlB;IAGD;;;;;OAKG;IACH,sBAJW,MAAM,QACN,MAAM,UACN,MAAM,QAchB;IAGD;;;OAGG;IACH,cAFa,OAAO,CAInB;IAED;;;OAGG;IACH,cAFa,OAAO,CAInB;IAED;;;OAGG;IACH,iBAFa,eAAU,CAmCtB;IAED;;;OAGG;IACH,4DA4BC;CACJ;yBAxTwB,eAAe"}
|