@woosh/meep-engine 2.33.19 → 2.33.23
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/core/assert.js +3 -1
- package/core/bvh2/traversal/__detailed_box_volume_intersection.js +11 -8
- package/core/collection/HashMap.js +66 -22
- package/core/geom/3d/CircleMath.js +4 -4
- package/core/geom/3d/cone/computeConeBoundingBox.js +4 -4
- package/core/geom/3d/{compute_bounding_cone_of_2_cones.js → cone/compute_bounding_cone_of_2_cones.js} +3 -3
- package/core/geom/3d/{compute_bounding_cone_of_2_cones.spec.js → cone/compute_bounding_cone_of_2_cones.spec.js} +1 -1
- package/core/geom/3d/frustum/array_setFromProjectionMatrix.js +1 -1
- package/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.js +10 -2
- package/core/geom/3d/{encode_unit3_hemioct.js → normal/hemioct/encode_unit3_hemioct.js} +0 -0
- package/core/geom/3d/{unit_hemioct.spec.js → normal/hemioct/unit_hemioct.spec.js} +1 -1
- package/core/geom/3d/normal/lamber_azimuth/transform.js +61 -0
- package/core/geom/3d/normal/spherical/sphere_map_transform.js +77 -0
- package/core/geom/3d/{lerp_planes_to_array.js → plane/lerp_planes_to_array.js} +1 -3
- package/core/geom/3d/plane/plane3_lerp.js +3 -1
- package/core/geom/3d/plane/plane3_slerp.js +4 -1
- package/core/geom/3d/{plane_computeConvex3PlaneIntersection.js → plane/plane_computeConvex3PlaneIntersection.js} +14 -16
- package/core/geom/3d/topology/TopoTriangle.js +1 -1
- package/core/geom/3d/topology/TopoVertex.js +1 -1
- package/core/geom/3d/topology/bounds/computeTraingleClusterNormalBoundingCone.js +2 -2
- package/core/geom/3d/topology/simplify/compute_face_normal_change_dot_product.js +1 -1
- package/core/geom/3d/topology/simplify/quadratic/Quadratic3.js +1 -1
- package/core/geom/3d/triangle/computeTrianglePlaneSide.js +1 -1
- package/core/geom/3d/triangle/computeTriangleRayIntersection.js +1 -1
- package/core/geom/3d/voxel/DenseBitVolume3D.js +87 -0
- package/core/geom/3d/voxel/buildVolumeFromProjectedGeometry.js +23 -0
- package/core/geom/LineSegment.js +3 -1
- package/core/geom/Matrix4.js +2 -1
- package/core/geom/Plane.js +15 -10
- package/core/geom/Quaternion.js +2 -1
- package/core/geom/Vector3.d.ts +2 -0
- package/core/geom/Vector3.js +33 -158
- package/core/geom/Vector3.spec.js +2 -1
- package/core/geom/v3_angle_between.js +31 -0
- package/core/geom/v3_distance.js +16 -0
- package/core/geom/v3_distance_sqr.js +17 -0
- package/core/geom/v3_dot.js +13 -0
- package/core/geom/v3_length.js +5 -0
- package/core/geom/v3_length_sqr.js +10 -0
- package/core/geom/v3_lerp.js +21 -0
- package/core/geom/v3_slerp.js +48 -0
- package/core/primitives/array/computeIntegerArrayHash.js +6 -1
- package/engine/asset/loaders/material/computeImageBitmapEquality.js +11 -0
- package/engine/asset/loaders/material/computeImageBitmapHash.js +22 -28
- package/engine/asset/loaders/material/computeMaterialHash.js +1 -2
- package/engine/asset/loaders/material/computeTextureEquality.js +13 -5
- package/engine/ecs/animation/OneBoneSurfaceAlignmentSolver.js +3 -1
- package/engine/ecs/animation/TwoBoneInverseKinematicsSolver.js +3 -1
- package/engine/ecs/fow/FogOfWar.js +2 -3
- package/engine/ecs/gui/hud/HeadsUpDisplaySystem.js +1 -1
- package/engine/ecs/systems/SteeringSystem.js +2 -1
- package/engine/ecs/terrain/ecs/Terrain.js +6 -0
- package/engine/ecs/terrain/ecs/layers/TerrainLayers.js +5 -0
- package/engine/ecs/terrain/ecs/splat/SplatMapping.js +5 -0
- package/engine/ecs/util/hideEntityGracefully.js +18 -0
- package/engine/graphics/GraphicsEngine.js +1 -0
- package/engine/graphics/camera/testClippingPlaneComputation.js +2 -2
- package/engine/graphics/ecs/camera/CameraClippingPlaneComputer.js +1 -1
- package/engine/graphics/ecs/highlight/renderer/OutlineRenderer.js +0 -53
- package/engine/graphics/ecs/path/testPathDisplaySystem.js +98 -98
- package/engine/graphics/ecs/trail2d/Trail2D.js +17 -4
- package/engine/graphics/ecs/trail2d/Trail2DSystem.d.ts +2 -3
- package/engine/graphics/ecs/trail2d/Trail2DSystem.js +34 -118
- package/engine/graphics/geometry/bvh/buffered/BVHGeometryRaycaster.js +2 -1
- package/engine/graphics/micron/build/clustering/computeFaceCurvatureScore.js +1 -1
- package/engine/graphics/micron/build/clustering/compute_face_connection_weight.js +1 -1
- package/engine/graphics/micron/build/hierarchy/computePatchMergeScore.js +1 -1
- package/engine/graphics/micron/build/hierarchy/patch_combine.js +1 -1
- package/engine/graphics/micron/render/refinement/is_patch_facing_back.js +2 -2
- package/engine/graphics/particles/particular/engine/ParticularEngine.js +4 -2
- package/engine/graphics/particles/particular/engine/emitter/PARTICULAR_PARTICLE_SPECIFICATION.js +20 -0
- package/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +40 -97
- package/engine/graphics/particles/particular/engine/emitter/ParticleLayer.js +12 -2
- package/engine/graphics/particles/particular/engine/emitter/computeEmissionFunction.js +37 -0
- package/engine/graphics/particles/particular/engine/emitter/distance_to_camera.js +25 -0
- package/engine/graphics/particles/particular/engine/shader/ShaderManager.js +7 -25
- package/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +2 -2
- package/engine/graphics/render/forward_plus/LightManager.js +10 -2
- package/engine/graphics/render/forward_plus/computeFrustumCorners.js +15 -33
- package/engine/graphics/render/forward_plus/plugin/MaterialTransformer.js +12 -2
- package/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +1 -1
- package/engine/graphics/render/forward_plus/prototypeLightManager.js +96 -95
- package/engine/graphics/render/forward_plus/queryBVH_Frustum.js +18 -6
- package/engine/graphics/render/layers/RenderLayerUtils.js +8 -5
- package/engine/graphics/render/visibility/hiz/prototypeHiZ.js +1 -1
- package/engine/graphics/texture/atlas/AtlasPatch.js +7 -2
- package/engine/graphics/texture/atlas/TextureAtlas.js +18 -14
- package/engine/graphics/texture/sampler/Sampler2D.js +8 -7
- package/engine/graphics/texture/sampler/scaleSampler2D.js +7 -10
- package/engine/graphics/trail/x/RibbonMaterialX.js +3 -3
- package/engine/graphics/trail/x/RibbonX.js +17 -2
- package/engine/graphics/trail/x/RibbonXPlugin.js +51 -1
- package/engine/graphics/util/projectSphere.js +1 -1
- package/engine/grid/components/GridObstacle.js +2 -9
- package/engine/navigation/ecs/components/Path.js +2 -1
- package/engine/network/convertPathToURL.js +2 -2
- package/engine/reference/v2/Reference.js +6 -0
- package/generation/filtering/numeric/complex/CellFilterAngleToNormal.js +3 -2
- package/generation/markers/GridCellActionPlaceMarker.js +13 -1
- package/generation/markers/MarkerNode.js +6 -0
- package/generation/theme/ThemeEngine.js +4 -1
- package/package.json +3 -3
- package/view/View.js +4 -2
- package/view/minimap/gl/MinimapMarkersGL.js +13 -1
|
@@ -1,47 +1,41 @@
|
|
|
1
1
|
import { min2 } from "../../../../core/math/min2.js";
|
|
2
|
-
import {
|
|
2
|
+
import { sampler_from_bitmap } from "./computeImageBitmapEquality.js";
|
|
3
3
|
|
|
4
|
-
let canvas = null;
|
|
5
|
-
let canvasContext = null;
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
*
|
|
9
|
-
* @
|
|
7
|
+
* @param {ImageBitmap} bitmap
|
|
8
|
+
* @returns {number}
|
|
10
9
|
*/
|
|
11
|
-
function
|
|
10
|
+
export function computeImageBitmapHash(bitmap) {
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const w = min2(bitmap.width, 8);
|
|
13
|
+
const h = min2(bitmap.height, 8);
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
canvas.width = 8;
|
|
15
|
+
const sampler = sampler_from_bitmap(bitmap);
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
const sampler_data = sampler.data;
|
|
18
|
+
const item_size = sampler.itemSize;
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
let hash = 0;
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
for (let y = 0; y < h; y++) {
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
const row_size = y * sampler.width;
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
*
|
|
29
|
-
* @param {ImageBitmap} bitmap
|
|
30
|
-
* @returns {number}
|
|
31
|
-
*/
|
|
32
|
-
export function computeImageBitmapHash(bitmap) {
|
|
33
|
-
const ctx = getCanvasContext();
|
|
26
|
+
for (let x = 0; x < w; x++) {
|
|
34
27
|
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
const texel_index = x + row_size;
|
|
29
|
+
const address = texel_index * item_size;
|
|
37
30
|
|
|
38
|
-
|
|
31
|
+
for (let i = 0; i < item_size; i++) {
|
|
39
32
|
|
|
40
|
-
|
|
33
|
+
const v = sampler_data[address];
|
|
41
34
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
hash = (hash << 5) - hash + v;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
45
39
|
|
|
46
|
-
return
|
|
40
|
+
return hash;
|
|
47
41
|
}
|
|
@@ -59,8 +59,7 @@ export function computeMaterialHash(material) {
|
|
|
59
59
|
computeTextureHash(material.alphaMap),
|
|
60
60
|
computeHashFloat(material.envMapIntensity),
|
|
61
61
|
computeTextureHash(material.envMap)
|
|
62
|
-
)
|
|
63
|
-
;
|
|
62
|
+
);
|
|
64
63
|
} else if (material.isShaderMaterial) {
|
|
65
64
|
hash ^= material.lights ? 0 : 1;
|
|
66
65
|
}
|
|
@@ -51,6 +51,7 @@ export function computeTextureEquality(a, b) {
|
|
|
51
51
|
const bMipmaps = b.mipmaps;
|
|
52
52
|
|
|
53
53
|
const n = aMipmaps.length;
|
|
54
|
+
|
|
54
55
|
if (n !== bMipmaps.length) {
|
|
55
56
|
return false;
|
|
56
57
|
}
|
|
@@ -72,8 +73,8 @@ export function computeTextureEquality(a, b) {
|
|
|
72
73
|
|
|
73
74
|
/**
|
|
74
75
|
*
|
|
75
|
-
* @param {Image|[]} a
|
|
76
|
-
* @param {Image|[]} b
|
|
76
|
+
* @param {Image|[]|{width:number, height:number}} a
|
|
77
|
+
* @param {Image|[]|{width:number, height:number}} b
|
|
77
78
|
* @returns {boolean}
|
|
78
79
|
*/
|
|
79
80
|
export function textureImagesEqual(a, b) {
|
|
@@ -89,6 +90,14 @@ export function textureImagesEqual(a, b) {
|
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
if (
|
|
94
|
+
(typeof a.width === "number" && a.width !== b.width)
|
|
95
|
+
|| (typeof a.height === "number" && a.height !== b.height)
|
|
96
|
+
) {
|
|
97
|
+
// dimensions are present, but are inconsistent
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
|
|
92
101
|
if (a instanceof ImageBitmap && b instanceof ImageBitmap) {
|
|
93
102
|
return computeImageBitmapEquality(a, b);
|
|
94
103
|
}
|
|
@@ -148,11 +157,10 @@ export function textureImagesEqual(a, b) {
|
|
|
148
157
|
}
|
|
149
158
|
}
|
|
150
159
|
|
|
151
|
-
//array images are equivalent
|
|
152
|
-
return true;
|
|
153
160
|
}
|
|
154
161
|
|
|
155
|
-
|
|
162
|
+
// assume equivalent
|
|
163
|
+
return true;
|
|
156
164
|
}
|
|
157
165
|
|
|
158
166
|
|
|
@@ -3,9 +3,11 @@ import { inverseLerp } from "../../../core/math/inverseLerp.js";
|
|
|
3
3
|
import { IKSolver } from "./IKSolver.js";
|
|
4
4
|
import { findSkeletonBoneByType } from "../../graphics/ecs/mesh/SkeletonUtils.js";
|
|
5
5
|
import Quaternion from "../../../core/geom/Quaternion.js";
|
|
6
|
-
import Vector3
|
|
6
|
+
import Vector3 from "../../../core/geom/Vector3.js";
|
|
7
7
|
import { SurfacePoint3 } from "../../../core/geom/3d/SurfacePoint3.js";
|
|
8
8
|
import { v3_computeOffsetVector } from "./IKMath.js";
|
|
9
|
+
import { v3_dot } from "../../../core/geom/v3_dot.js";
|
|
10
|
+
import { v3_length } from "../../../core/geom/v3_length.js";
|
|
9
11
|
|
|
10
12
|
const boneWorldPosition = new Vector3();
|
|
11
13
|
const boneWorldRotation = new Quaternion();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assert } from "../../../core/assert.js";
|
|
2
|
-
import Vector3
|
|
2
|
+
import Vector3 from "../../../core/geom/Vector3.js";
|
|
3
3
|
import { clamp } from "../../../core/math/clamp.js";
|
|
4
4
|
import { inverseLerp } from "../../../core/math/inverseLerp.js";
|
|
5
5
|
import Quaternion from "../../../core/geom/Quaternion.js";
|
|
@@ -7,6 +7,8 @@ import { findSkeletonBoneByType } from "../../graphics/ecs/mesh/SkeletonUtils.js
|
|
|
7
7
|
import { SurfacePoint3 } from "../../../core/geom/3d/SurfacePoint3.js";
|
|
8
8
|
import { IKSolver } from "./IKSolver.js";
|
|
9
9
|
import { v3_computeOffsetVector } from "./IKMath.js";
|
|
10
|
+
import { v3_dot } from "../../../core/geom/v3_dot.js";
|
|
11
|
+
import { v3_length } from "../../../core/geom/v3_length.js";
|
|
10
12
|
|
|
11
13
|
const boneWorldPositionC = new Vector3();
|
|
12
14
|
const boneWorldPositionB = new Vector3();
|
|
@@ -5,7 +5,6 @@ import { Sampler2D } from "../../graphics/texture/sampler/Sampler2D.js";
|
|
|
5
5
|
import { ClampToEdgeWrapping, DataTexture, LinearFilter, RedFormat, UnsignedByteType } from "three";
|
|
6
6
|
import Vector1 from "../../../core/geom/Vector1.js";
|
|
7
7
|
import Vector2 from "../../../core/geom/Vector2.js";
|
|
8
|
-
import Vector3 from "../../../core/geom/Vector3.js";
|
|
9
8
|
import { assert } from "../../../core/assert.js";
|
|
10
9
|
import { computeUnsignedDistanceField } from "../../graphics/texture/sampler/distanceField.js";
|
|
11
10
|
import Vector4 from "../../../core/geom/Vector4.js";
|
|
@@ -357,7 +356,7 @@ export class FogOfWar {
|
|
|
357
356
|
}
|
|
358
357
|
|
|
359
358
|
|
|
360
|
-
this.on.textureChanged.
|
|
359
|
+
this.on.textureChanged.send0();
|
|
361
360
|
|
|
362
361
|
//clear flag
|
|
363
362
|
this.textureNeedsUpdate = false;
|
|
@@ -534,7 +533,7 @@ export class FogOfWar {
|
|
|
534
533
|
const sampleX = samplePosition[0];
|
|
535
534
|
const sampleY = samplePosition[1];
|
|
536
535
|
|
|
537
|
-
return this.distanceSampler.readChannel(sampleX|0, sampleY|0, 0);
|
|
536
|
+
return this.distanceSampler.readChannel(sampleX | 0, sampleY | 0, 0);
|
|
538
537
|
}
|
|
539
538
|
|
|
540
539
|
rebuildDistanceField() {
|
|
@@ -85,7 +85,6 @@ class HeadsUpDisplaySystem extends System {
|
|
|
85
85
|
* @private
|
|
86
86
|
*/
|
|
87
87
|
__apply_entity_transformation(hud, transform, vp, element) {
|
|
88
|
-
const position = transform.position;
|
|
89
88
|
const worldOffset = hud.worldOffset;
|
|
90
89
|
|
|
91
90
|
let worldOffsetX = worldOffset.x;
|
|
@@ -107,6 +106,7 @@ class HeadsUpDisplaySystem extends System {
|
|
|
107
106
|
v4.applyQuaternion(transform.rotation);
|
|
108
107
|
}
|
|
109
108
|
|
|
109
|
+
const position = transform.position;
|
|
110
110
|
|
|
111
111
|
v4.add3(position);
|
|
112
112
|
|
|
@@ -11,8 +11,9 @@ import Motion from '../components/Motion.js';
|
|
|
11
11
|
import { Transform } from '../transform/Transform.js';
|
|
12
12
|
import Steering, { SteeringEvents, SteeringFlags } from '../components/Steering.js';
|
|
13
13
|
import { solveQuadratic } from "../../../core/math/MathUtils.js";
|
|
14
|
-
import Vector3
|
|
14
|
+
import Vector3 from "../../../core/geom/Vector3.js";
|
|
15
15
|
import { alignToVector } from "../terrain/ecs/ClingToTerrainSystem.js";
|
|
16
|
+
import { v3_dot } from "../../../core/geom/v3_dot.js";
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
*
|
|
@@ -461,6 +461,10 @@ class Terrain {
|
|
|
461
461
|
this.__material_reference.release();
|
|
462
462
|
|
|
463
463
|
this.tiles.dispose();
|
|
464
|
+
this.splat.dispose();
|
|
465
|
+
this.layers.dispose();
|
|
466
|
+
|
|
467
|
+
this.heightTexture.dispose();
|
|
464
468
|
|
|
465
469
|
this.clearFlag(TerrainFlags.Linked);
|
|
466
470
|
}
|
|
@@ -1045,6 +1049,8 @@ class Terrain {
|
|
|
1045
1049
|
return texture;
|
|
1046
1050
|
});
|
|
1047
1051
|
|
|
1052
|
+
// TODO ensure cleanup when terrain is unlinked
|
|
1053
|
+
|
|
1048
1054
|
return result;
|
|
1049
1055
|
}
|
|
1050
1056
|
|
|
@@ -15,10 +15,23 @@ import { DelayBehavior } from "../../intelligence/behavior/util/DelayBehavior.js
|
|
|
15
15
|
import { Light } from "../../graphics/ecs/light/Light.js";
|
|
16
16
|
import { TransitionPropertyVectorXBehavior } from "../../../../model/game/story/behaviors/generic/TransitionPropertyVectorXBehavior.js";
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @readonly
|
|
20
|
+
* @type {number}
|
|
21
|
+
*/
|
|
18
22
|
const SHUTDOWN_GRACE_PERIOD = 60;
|
|
19
23
|
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {Map<Class|function, function(T,entity?:EntityBuilder,createEntity?:function,createEntityContext?:*):number>}
|
|
27
|
+
*/
|
|
20
28
|
const component_shutdown = new Map();
|
|
21
29
|
|
|
30
|
+
/**
|
|
31
|
+
* @template T
|
|
32
|
+
* @param {Class<T>} type
|
|
33
|
+
* @param {function(T,entity?:EntityBuilder,createEntity?:function,createEntityContext?:*):number} method
|
|
34
|
+
*/
|
|
22
35
|
function addShutdown(type, method) {
|
|
23
36
|
component_shutdown.set(type, method);
|
|
24
37
|
}
|
|
@@ -152,6 +165,11 @@ addShutdown(SoundEmitter, (soundEmitter, builder, createEntity, createEntityThis
|
|
|
152
165
|
* @return {number} duration in seconds until the entity is completely hidden
|
|
153
166
|
*/
|
|
154
167
|
export function hideEntityGracefully(builder, createEntity, createEntityThisArg) {
|
|
168
|
+
if (!builder.isBuilt) {
|
|
169
|
+
// already destroyed
|
|
170
|
+
return 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
155
173
|
let delay = 0;
|
|
156
174
|
|
|
157
175
|
const components = builder.element;
|
|
@@ -95,11 +95,11 @@ function makeConfig(engine) {
|
|
|
95
95
|
new TopDownCameraControllerSystem(graphics),
|
|
96
96
|
new TopDownCameraLanderSystem(),
|
|
97
97
|
new CameraSystem(graphics.scene, graphics),
|
|
98
|
-
new MeshSystem(
|
|
98
|
+
new MeshSystem(engine),
|
|
99
99
|
new ClingToTerrainSystem(),
|
|
100
100
|
new TerrainSystem(graphics, assetManager),
|
|
101
101
|
new WaterSystem(graphics),
|
|
102
|
-
new Trail2DSystem(
|
|
102
|
+
new Trail2DSystem(engine),
|
|
103
103
|
new Foliage2System(assetManager, graphics),
|
|
104
104
|
new ViewportPositionSystem(graphics.viewport.size),
|
|
105
105
|
new GridPosition2TransformSystem(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isValueBetweenInclusive } from "../../../../core/math/MathUtils.js";
|
|
2
2
|
import { frustumFromCamera } from "./CameraSystem.js";
|
|
3
3
|
import { Frustum as ThreeFrustum } from "three";
|
|
4
|
-
import { v3_dot } from "../../../../core/geom/
|
|
4
|
+
import { v3_dot } from "../../../../core/geom/v3_dot.js";
|
|
5
5
|
|
|
6
6
|
const CLIPPING_EPSILON = 0.001;
|
|
7
7
|
|
|
@@ -18,8 +18,6 @@ import {
|
|
|
18
18
|
Vector2,
|
|
19
19
|
WebGLRenderTarget
|
|
20
20
|
} from "three";
|
|
21
|
-
import { Sampler2D } from "../../../texture/sampler/Sampler2D.js";
|
|
22
|
-
import convertSampler2D2Canvas from "../../../texture/sampler/Sampler2D2Canvas.js";
|
|
23
21
|
import { makeHighlightDecodeShader } from "./HighlightDecodeShader.js";
|
|
24
22
|
import { makeDilationShader } from "./makeDilationShader.js";
|
|
25
23
|
import { ScreenSpaceQuadShader } from "../../../shaders/ScreenSpaceQuadShader.js";
|
|
@@ -500,57 +498,6 @@ export class OutlineRenderer {
|
|
|
500
498
|
renderer.setRenderTarget(null);
|
|
501
499
|
}
|
|
502
500
|
|
|
503
|
-
debugObjectIDs() {
|
|
504
|
-
|
|
505
|
-
const s = Sampler2D.uint8(4, this.__renderTargetObjectId_t0.width, this.__renderTargetObjectId_t0.height);
|
|
506
|
-
|
|
507
|
-
this.renderer.readRenderTargetPixels(this.__renderTargetObjectId_t0, 0, 0, this.__renderTargetObjectId_t0.width, this.__renderTargetObjectId_t0.height, s);
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
const htmlCanvasElement = convertSampler2D2Canvas(s, 1, 0);
|
|
511
|
-
|
|
512
|
-
htmlCanvasElement.style.zIndex = 10000;
|
|
513
|
-
htmlCanvasElement.style.position = "absolute";
|
|
514
|
-
|
|
515
|
-
document.body.appendChild(htmlCanvasElement);
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
/**
|
|
519
|
-
*
|
|
520
|
-
* @param {Object3D} object
|
|
521
|
-
*/
|
|
522
|
-
renderObjectId(object) {
|
|
523
|
-
if (object.isMesh || object.isSkinnedMesh) {
|
|
524
|
-
|
|
525
|
-
const geometry = object.geometry;
|
|
526
|
-
|
|
527
|
-
if (geometry === undefined) {
|
|
528
|
-
return;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
const renderer = this.renderer;
|
|
532
|
-
|
|
533
|
-
if (object.isSkinnedMesh) {
|
|
534
|
-
|
|
535
|
-
renderer.renderBufferDirect(this.camera, null, geometry, material_id_skinned, object, null);
|
|
536
|
-
|
|
537
|
-
} else {
|
|
538
|
-
renderer.renderBufferDirect(this.camera, null, geometry, material_id_unskinned, object, null);
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
const children = object.children;
|
|
544
|
-
|
|
545
|
-
const child_count = children.length;
|
|
546
|
-
|
|
547
|
-
for (let i = 0; i < child_count; i++) {
|
|
548
|
-
const child = children[i];
|
|
549
|
-
|
|
550
|
-
this.renderObjectId(child);
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
|
|
554
501
|
/**
|
|
555
502
|
*
|
|
556
503
|
* @param {Material} material
|
|
@@ -106,11 +106,11 @@ function makeConfig(engine) {
|
|
|
106
106
|
new TopDownCameraControllerSystem(graphics),
|
|
107
107
|
new TopDownCameraLanderSystem(),
|
|
108
108
|
new CameraSystem(graphics.scene, graphics),
|
|
109
|
-
new MeshSystem(
|
|
109
|
+
new MeshSystem(engine),
|
|
110
110
|
new ClingToTerrainSystem(),
|
|
111
111
|
new TerrainSystem(graphics, assetManager),
|
|
112
112
|
new WaterSystem(graphics),
|
|
113
|
-
new Trail2DSystem(
|
|
113
|
+
new Trail2DSystem(engine),
|
|
114
114
|
new Foliage2System(assetManager, graphics),
|
|
115
115
|
new ViewportPositionSystem(graphics.viewport.size),
|
|
116
116
|
new GridPosition2TransformSystem(),
|
|
@@ -179,11 +179,11 @@ function catmullRom(points) {
|
|
|
179
179
|
cv.link();
|
|
180
180
|
|
|
181
181
|
cv.css({
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
182
|
+
position: "absolute",
|
|
183
|
+
left: 0,
|
|
184
|
+
right: 0,
|
|
185
|
+
zIndex: 99999
|
|
186
|
+
});
|
|
187
187
|
|
|
188
188
|
const sample = [];
|
|
189
189
|
|
|
@@ -216,92 +216,92 @@ function sample_style_entity() {
|
|
|
216
216
|
const style = new EntityPathStyle();
|
|
217
217
|
style.spacing = 0.6;
|
|
218
218
|
style.marker_start = EntityPathMarkerDefinition.from({
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
219
|
+
blueprint: EntityBlueprint.from([
|
|
220
|
+
Transform.fromJSON({}),
|
|
221
|
+
Mesh.fromJSON({
|
|
222
|
+
url: "data/models/arrow-symbols/arrow4/model-green.gltf",
|
|
223
|
+
castShadow: true,
|
|
224
|
+
receiveShadow: true
|
|
225
|
+
})
|
|
226
|
+
]),
|
|
227
|
+
transform: Transform.fromJSON({
|
|
228
|
+
scale: {
|
|
229
|
+
x: 0.3,
|
|
230
|
+
y: 0.3,
|
|
231
|
+
z: 0.3
|
|
232
|
+
},
|
|
233
|
+
rotation: {
|
|
234
|
+
x: 0.5,
|
|
235
|
+
y: -0.5,
|
|
236
|
+
z: 0.5,
|
|
237
|
+
w: 0.5
|
|
238
|
+
},
|
|
239
|
+
position: {
|
|
240
|
+
x: 0,
|
|
241
|
+
y: 1,
|
|
242
|
+
z: 0
|
|
243
|
+
}
|
|
244
|
+
})
|
|
245
|
+
});
|
|
246
246
|
style.marker_end = EntityPathMarkerDefinition.from({
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
247
|
+
blueprint: EntityBlueprint.from([
|
|
248
|
+
Transform.fromJSON({}),
|
|
249
|
+
Mesh.fromJSON({
|
|
250
|
+
url: "data/models/arrow-symbols/arrow4/model-red.gltf",
|
|
251
|
+
castShadow: true,
|
|
252
|
+
receiveShadow: true
|
|
253
|
+
})
|
|
254
|
+
]),
|
|
255
|
+
transform: Transform.fromJSON({
|
|
256
|
+
scale: {
|
|
257
|
+
x: 0.3,
|
|
258
|
+
y: 0.3,
|
|
259
|
+
z: 0.3
|
|
260
|
+
},
|
|
261
|
+
rotation: {
|
|
262
|
+
x: 0.5,
|
|
263
|
+
y: -0.5,
|
|
264
|
+
z: 0.5,
|
|
265
|
+
w: 0.5
|
|
266
|
+
},
|
|
267
|
+
position: {
|
|
268
|
+
x: 0,
|
|
269
|
+
y: 1,
|
|
270
|
+
z: 0
|
|
271
|
+
}
|
|
272
|
+
})
|
|
273
|
+
});
|
|
274
274
|
style.marker_main = EntityPathMarkerDefinition.from({
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
275
|
+
blueprint: EntityBlueprint.from([
|
|
276
|
+
Transform.fromJSON({}),
|
|
277
|
+
Mesh.fromJSON({
|
|
278
|
+
url: "data/models/Barel-Roll Droid/handpainted.gltf",
|
|
279
|
+
castShadow: true,
|
|
280
|
+
receiveShadow: true
|
|
281
|
+
}),
|
|
282
|
+
Animation.fromJSON({
|
|
283
|
+
clips: [
|
|
284
|
+
{
|
|
285
|
+
name: "fly",
|
|
286
|
+
repeatCount: Infinity
|
|
287
|
+
}
|
|
288
|
+
]
|
|
289
|
+
}),
|
|
290
|
+
Highlight.fromOne(1, 0, 0, 1)
|
|
291
|
+
]),
|
|
292
|
+
transform: Transform.fromJSON({
|
|
293
|
+
scale: {
|
|
294
|
+
x: 0.2,
|
|
295
|
+
y: 0.2,
|
|
296
|
+
z: 0.2
|
|
297
|
+
},
|
|
298
|
+
position: {
|
|
299
|
+
x: 0,
|
|
300
|
+
y: 1,
|
|
301
|
+
z: 0
|
|
302
|
+
}
|
|
303
|
+
})
|
|
304
|
+
});
|
|
305
305
|
|
|
306
306
|
return style;
|
|
307
307
|
}
|
|
@@ -337,13 +337,13 @@ function main(engine) {
|
|
|
337
337
|
// ], 50));
|
|
338
338
|
|
|
339
339
|
_p.setPositionsFromVectorArray([
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
340
|
+
new Vector3(3, 1, 1),
|
|
341
|
+
new Vector3(3, 1, 3),
|
|
342
|
+
new Vector3(7, 1, 3),
|
|
343
|
+
new Vector3(7, 1, 7),
|
|
344
|
+
new Vector3(3, 1, 7),
|
|
345
|
+
new Vector3(3, 1, 8),
|
|
346
|
+
]);
|
|
347
347
|
|
|
348
348
|
|
|
349
349
|
const trailPathStyle = new RibbonPathStyle();
|