@woosh/meep-engine 2.56.1 → 2.58.0
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/editor/Editor.js +4 -4
- package/editor/ecs/component/editors/ColorEditor.js +1 -1
- package/editor/ecs/component/editors/ImagePathEditor.js +2 -2
- package/editor/ecs/component/editors/{LargeStrongEditor.js → LargeStringEditor.js} +1 -1
- package/editor/process/symbolic/buildThreeJSHelperEntity.js +3 -3
- package/editor/process/symbolic/makeGridPositionSymbolDisplay.js +3 -3
- package/editor/process/symbolic/makePositionedIconDisplaySymbol.js +3 -3
- package/editor/tools/GridPaintTool.js +3 -3
- package/editor/tools/TopDownCameraControlTool.js +1 -1
- package/editor/tools/TransformTool.js +1 -1
- package/editor/tools/engine/Tool.js +9 -23
- package/editor/tools/engine/ToolEngine.js +5 -7
- package/editor/tools/paint/TerrainHeightPaintTool.js +2 -2
- package/editor/tools/paint/TerrainPaintTool.js +2 -2
- package/editor/tools/paint/TerrainTexturePaintTool.js +2 -2
- package/editor/tools/v2/prototypeTransformControls.js +3 -3
- package/editor/view/ecs/ComponentControlView.js +2 -1
- package/package.json +1 -1
- package/samples/generation/main.js +2 -2
- package/samples/terrain/from_image.js +2 -2
- package/samples/terrain/from_image_2.js +4 -4
- package/src/core/binary/byteArrayToString.js +28 -0
- package/src/core/binary/downloadAsFile.js +28 -0
- package/src/core/binary/downloadUrlAsFile.js +14 -0
- package/src/core/binary/jsonToStringToByteArray.js +27 -0
- package/src/core/binary/stringToByteArray.js +24 -0
- package/src/core/bvh2/BinaryNode.spec.js +2 -1
- package/src/core/bvh2/bvh3/query/compute_tight_near_far_clipping_planes.js +1 -1
- package/src/core/bvh2/traversal/ThreeClippingPlaneComputingBVHVisitor.js +1 -1
- package/src/core/bvh2/traversal/__process_point_if_within_planes.js +1 -1
- package/src/core/cache/LoadingCache.js +3 -2
- package/src/core/collection/array/arraySetSortingDiff.spec.js +12 -12
- package/src/core/collection/array/weightedRandomFromArray.js +2 -2
- package/src/core/color/Color.js +6 -6
- package/src/core/color/Color.spec.js +27 -1
- package/src/core/color/YCbCr/YCbCr.spec.js +16 -0
- package/src/core/color/{YCbCr_to_rgb_uint24.js → YCbCr/YCbCr_to_rgb_uint24.js} +6 -6
- package/src/core/color/YCbCr/rgb_to_YCbCr_uint24.js +16 -0
- package/src/core/color/{hex2rgb.js → hex/hex2rgb.js} +1 -1
- package/src/core/color/{rgb2hex.js → hex/rgb2hex.js} +1 -1
- package/src/core/color/{hsv2rgb.js → hsv/hsv2rgb.js} +3 -3
- package/src/core/color/hsv/rgb2hsv.js +49 -0
- package/src/core/color/{kelvin_to_rgb.js → kelvin/kelvin_to_rgb.js} +1 -1
- package/src/core/color/{kelvin_to_rgb.spec.js → kelvin/kelvin_to_rgb.spec.js} +2 -2
- package/src/core/color/{prototype_kelvin_to_rgb.js → kelvin/prototype_kelvin_to_rgb.js} +5 -5
- package/src/core/color/{rgb_to_kelvin.spec.js → kelvin/rgb_to_kelvin.spec.js} +1 -1
- package/src/core/color/{parseColor.js → parse_color.js} +5 -5
- package/src/core/color/parse_color.spec.js +18 -0
- package/src/core/color/rgb2uint24.js +3 -3
- package/src/core/color/sRGB/sRGB.spec.js +16 -0
- package/src/core/color/xyz/XYZ.spec.js +16 -0
- package/src/core/color/xyz/rgb_to_xyz.js +15 -0
- package/src/core/color/xyz/xyz_to_rgb.js +14 -0
- package/src/core/events/signal/Signal.js +5 -0
- package/src/core/events/signal/{signalAggregateByTimeWindow.js → signal_aggregate_by_time_window.js} +1 -1
- package/src/core/events/signal/{SignalUtils.js → signal_filter.js} +1 -2
- package/src/core/fsm/simple/SimpleStateMachine.spec.js +34 -2
- package/src/core/geom/2d/spline_bezier2_2d.js +26 -0
- package/src/core/geom/2d/spline_bezier2_2d.spec.js +16 -0
- package/src/core/geom/3d/SurfacePoint3.js +1 -1
- package/src/core/geom/3d/aabb/aabb3_compute_plane_side.js +1 -1
- package/src/core/geom/3d/aabb/aabb3_detailed_volume_intersection.js +1 -1
- package/src/core/geom/3d/aabb/aabb3_transformed_compute_plane_side.js +1 -1
- package/src/core/geom/3d/compute_circle_bounding_box.js +1 -1
- package/src/core/geom/3d/cone/computeConeBoundingBox.js +1 -1
- package/src/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.js +1 -1
- package/src/core/geom/3d/line/line3_computeSegmentPointDistance_sqr.js +1 -1
- package/src/core/geom/3d/line/line3_compute_nearest_point_to_point.js +1 -1
- package/src/core/geom/3d/matrix/m4_multiply.js +2 -2
- package/src/core/geom/3d/matrix/m4_multiply.spec.js +11 -0
- package/src/core/geom/3d/matrix/m4_multiply_alphatensor.spec.js +11 -0
- package/src/core/geom/3d/morton/split_by_2.js +1 -1
- package/src/core/geom/3d/normal/hemioct/unit_hemioct.spec.js +1 -1
- package/src/core/geom/3d/normal/spherical/sphere_map_transform.js +1 -1
- package/src/core/geom/3d/plane/is_point_within_planes.js +1 -1
- package/src/core/geom/3d/plane/lerp_planes_to_array.js +1 -1
- package/src/core/geom/3d/plane/plane3_compute_convex_3_plane_intersection.js +1 -1
- package/src/core/geom/3d/plane/plane3_compute_line_segment_intersection.js +1 -1
- package/src/core/geom/3d/plane/plane3_compute_ray_intersection.js +1 -1
- package/src/core/geom/3d/plane/plane3_lerp.js +2 -2
- package/src/core/geom/3d/plane/plane3_projectPoint.js +1 -1
- package/src/core/geom/3d/plane/plane3_slerp.js +3 -3
- package/src/core/geom/3d/ray/ray_computeNearestPointToPoint.js +1 -1
- package/src/core/geom/3d/ray/ray_distance_to_point.js +1 -1
- package/src/core/geom/3d/shape/UnionShape3D.js +3 -3
- package/src/core/geom/3d/shape/UnitCubeShape3D.js +1 -1
- package/src/core/geom/3d/shape/UnitSphereShape3D.js +1 -1
- package/src/core/geom/3d/shape/util/shape_to_visual_entity.js +10 -10
- package/src/core/geom/3d/sphere/sphere_intersects_ray.js +1 -1
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +6 -0
- package/src/core/geom/3d/tetrahedra/compute_bounding_simplex_3d.js +1 -1
- package/src/core/geom/3d/tetrahedra/compute_bounding_simplex_3d.spec.js +1 -1
- package/src/core/geom/3d/tetrahedra/compute_circumsphere.js +1 -1
- package/src/core/geom/3d/tetrahedra/delaunay/compute_delaunay_tetrahedral_mesh.js +1 -0
- package/src/core/geom/3d/tetrahedra/delaunay/compute_delaunay_tetrahedral_mesh.spec.js +10 -2
- package/src/core/geom/3d/tetrahedra/prototypeTetrahedraBuilder.js +2 -2
- package/src/core/geom/3d/topology/bounds/computeTriangleClusterNormalBoundingCone.js +1 -1
- package/src/core/geom/3d/topology/samples/sampleFloodFill.js +4 -4
- package/src/core/geom/3d/topology/simplify/compute_face_normal_change_dot_product.js +1 -1
- package/src/core/geom/3d/topology/simplify/quadratic/Quadratic3.js +1 -1
- package/src/core/geom/3d/topology/simplify/tm_edge_collapse_is_degenerate_flip.js +2 -2
- package/src/core/geom/3d/topology/struct/TopoVertex.js +1 -1
- package/src/core/geom/3d/topology/util/compute_face_connection_weight.js +2 -2
- package/src/core/geom/3d/triangle/computeTrianglePlaneSide.js +1 -1
- package/src/core/geom/3d/triangle/computeTriangleRayIntersection.js +1 -1
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentricEdge.js +1 -1
- package/src/core/geom/3d/v3_compute_triangle_normal.js +1 -1
- package/src/core/geom/Quaternion.js +1 -1
- package/src/core/geom/Vector3.js +7 -7
- package/src/core/geom/Vector3.spec.js +68 -1
- package/src/core/geom/mat2/m2_add.js +17 -0
- package/src/core/geom/mat2/m2_determinant.js +8 -0
- package/src/core/geom/mat2/m2_multiply.js +17 -0
- package/src/core/geom/mat2/m2_multiply_scalar.js +18 -0
- package/src/core/geom/mat2/m2_multiply_transposed.js +18 -0
- package/src/core/geom/mat2/m2_sub_transposed.js +17 -0
- package/src/{view → core/geom/mat3}/m3_cm_compose_transform.js +0 -29
- package/src/core/geom/mat3/m3_cm_extract_rotation.js +8 -0
- package/src/core/geom/mat3/m3_cm_from_translation.js +19 -0
- package/src/{view/multiplyMatrices3.js → core/geom/mat3/m3_multiply.js} +2 -2
- package/src/{view → core/geom/mat3}/m3_rm_compose_transform.js +0 -9
- package/src/core/geom/mat3/m3_rm_extract_scale.js +7 -0
- package/src/core/geom/{3d/vector/allocate_v3.js → vec3/v3_allocate.js} +1 -1
- package/src/core/geom/{v3_angle_between.js → vec3/v3_angle_between.js} +1 -1
- package/src/core/geom/vec3/v3_dot_array_array.js +20 -0
- package/src/core/geom/{v3_lerp.js → vec3/v3_lerp.js} +1 -1
- package/src/core/graph/SquareMatrix.js +26 -3
- package/src/core/graph/SquareMatrix.spec.js +52 -2
- package/src/core/math/clamp01.js +1 -0
- package/src/core/math/fract.js +3 -1
- package/src/core/math/inverseLerp.js +7 -5
- package/src/core/math/lerp.js +5 -5
- package/src/core/math/physics/spring/computeHookeForce.js +9 -0
- package/src/core/math/remap.js +19 -0
- package/src/core/math/remap.spec.js +15 -0
- package/src/core/math/smoothStep.spec.js +16 -0
- package/src/core/math/spline/spline_bezier2.js +13 -0
- package/src/core/math/spline/spline_bezier2.spec.js +13 -0
- package/src/core/model/object/compareValues.js +2 -2
- package/src/core/model/object/read_property.js +10 -2
- package/src/core/model/object/write_property.js +3 -23
- package/src/core/model/object/write_property.spec.js +26 -0
- package/src/core/primitives/numbers/number_pretty_print.spec.js +19 -0
- package/src/core/process/action/AsynchronousDelayAction.js +2 -2
- package/src/core/process/executor/profile/ConcurrentExecutorProfiler.js +1 -1
- package/src/engine/EngineHarness.js +7 -7
- package/src/engine/EntityCreator.js +5 -5
- package/src/engine/__module.js +1 -1
- package/src/engine/achievements/AchievementManager.js +2 -2
- package/src/engine/animation/AnimationUtils.js +4 -4
- package/src/engine/animation/behavior/animateProperty.js +2 -2
- package/src/engine/animation/curve/draw/build_plot_entity_from_array.js +3 -3
- package/src/engine/animation/playAnimationTrack.js +3 -3
- package/src/engine/animation/playTrackRealTime.js +3 -3
- package/src/engine/animation/removeEntityWithMeshParticlesEffect.js +2 -2
- package/src/engine/control/ControlContext.js +7 -7
- package/src/engine/ecs/{EntityBuilder.d.ts → Entity.d.ts} +5 -5
- package/src/engine/ecs/{EntityBuilder.js → Entity.js} +29 -29
- package/src/engine/ecs/{EntityBuilder.spec.js → Entity.spec.js} +17 -17
- package/src/engine/ecs/EntityBlueprint.d.ts +2 -2
- package/src/engine/ecs/EntityBlueprint.js +3 -3
- package/src/engine/ecs/EntityBlueprint.spec.js +2 -2
- package/src/engine/ecs/{EntityBuilderFlags.js → EntityFlags.js} +1 -1
- package/src/engine/ecs/EntityObserver.spec.js +8 -8
- package/src/engine/ecs/dynamic_actions/DynamicActorSystem.js +5 -5
- package/src/engine/ecs/foliage/ecs/InstancedMeshUtils.js +3 -3
- package/src/engine/ecs/gui/menu/radial/RadialContextMenu.d.ts +2 -2
- package/src/engine/ecs/gui/menu/radial/RadialContextMenu.js +5 -5
- package/src/engine/ecs/ik/OneBoneSurfaceAlignmentSolver.js +2 -2
- package/src/engine/ecs/ik/TwoBoneInverseKinematicsSolver.js +2 -2
- package/src/engine/ecs/parent/EntityNode.d.ts +3 -3
- package/src/engine/ecs/parent/EntityNode.js +5 -5
- package/src/engine/ecs/parent/testHuDPerf.js +2 -2
- package/src/engine/ecs/speaker/VoiceSystem.js +5 -5
- package/src/engine/ecs/systems/SteeringSystem.js +1 -1
- package/src/engine/ecs/terrain/ecs/splat/SplatMapOptimizerDebugger.js +1 -1
- package/src/engine/ecs/tooltip/testTooltipComponentSystem.js +3 -3
- package/src/engine/graphics/camera/makeOrbitalCameraController.js +3 -3
- package/src/engine/graphics/camera/testClippingPlaneComputation.js +3 -3
- package/src/engine/graphics/debug/createDebugLabel.js +3 -3
- package/src/engine/graphics/ecs/camera/Camera.js +1 -1
- package/src/engine/graphics/ecs/camera/CameraClippingPlaneComputer.js +1 -1
- package/src/engine/graphics/ecs/camera/filter/setup_filtered_camera_controller.js +3 -3
- package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.js +3 -11
- package/src/engine/graphics/ecs/decal/v2/prototypeDecalEditor.js +3 -3
- package/src/engine/graphics/ecs/decal/v2/prototypeDecalSystem.js +14 -14
- package/src/engine/graphics/ecs/highlight/Highlight.js +20 -102
- package/src/engine/graphics/ecs/mesh/Mesh.js +12 -18
- package/src/engine/graphics/ecs/mesh/MeshSystem.js +41 -26
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +1 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/prototypeSGMesh.js +3 -3
- package/src/engine/graphics/ecs/mesh-v2/sample/prototypeShadedGeometry.js +5 -5
- package/src/engine/graphics/ecs/mesh-v2/sample/prototype_sg_raycast.js +6 -6
- package/src/engine/graphics/ecs/path/ribbon/RibbonPathBuilder.js +3 -3
- package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +3 -3
- package/src/engine/graphics/ecs/path/tube/build/TubePathBuilder.js +4 -4
- package/src/engine/graphics/ecs/path/tube/build/makeTubeGeometry.js +1 -1
- package/src/engine/graphics/ecs/path/tube/build/make_cap.js +3 -3
- package/src/engine/graphics/ecs/path/tube/build/make_ring_vertices.js +1 -1
- package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +3 -3
- package/src/engine/graphics/ecs/sprite/SpriteSystemPE.js +2 -2
- package/src/engine/graphics/ecs/sprite/prototypeSpriteSystem.js +2 -2
- package/src/engine/graphics/geometry/MikkT/InitTriInfo.js +5 -6
- package/src/engine/graphics/geometry/MikkT/MikkTSpace.js +3 -3
- package/src/engine/graphics/geometry/MikkT/NormalizeSafe.js +1 -2
- package/src/engine/graphics/geometry/MikkT/STSpace.js +3 -3
- package/src/engine/graphics/geometry/MikkT/v3_scale_dot_sub_normalize.js +2 -2
- package/src/engine/graphics/geometry/bvh/buffered/BVHGeometryRaycaster.js +1 -1
- package/src/engine/graphics/geometry/clipping/ClippedGeometry.js +1 -1
- package/src/engine/graphics/geometry/optimization/merge/prototypeGeometryMerge.js +4 -4
- package/src/engine/graphics/impostors/octahedral/prototypeBaker.js +7 -7
- package/src/engine/graphics/particles/node-based/editor/ParticleSpecificationEditorView.js +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +102 -95
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleLayer.spec.js +25 -0
- package/src/engine/graphics/particles/particular/engine/emitter/ParticlePool.js +0 -35
- package/src/engine/graphics/particles/particular/engine/emitter/ParticlePool.spec.js +39 -2
- package/src/engine/graphics/particles/particular/engine/renderers/billboard/prototypeBillboardRenderer.js +2 -2
- package/src/engine/graphics/particles/particular/engine/shader/ShaderManager.js +22 -6
- package/src/engine/graphics/particles/particular/engine/utils/volume/ParticleVolume.d.ts +2 -2
- package/src/engine/graphics/particles/particular/engine/utils/volume/ParticleVolume.js +3 -3
- package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +10 -10
- package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +2 -2
- package/src/engine/graphics/render/buffer/simple-fx/taa/prototypeTAA.js +2 -2
- package/src/engine/graphics/render/forward_plus/LightManager.js +1 -1
- package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +13 -13
- package/src/engine/graphics/render/forward_plus/prototype/prototypeLightManager.js +3 -3
- package/src/engine/graphics/render/forward_plus/query/detailed_sphere_frustum_intersection_test.js +1 -1
- package/src/engine/graphics/render/layers/RenderLayerUtils.js +1 -1
- package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +8 -7
- package/src/engine/graphics/sh3/LightProbeVolume.js +3 -3
- package/src/engine/graphics/sh3/path_tracer/PathTracer.js +2 -2
- package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +2 -2
- package/src/engine/graphics/sh3/path_tracer/random_in_hemisphere.js +1 -1
- package/src/engine/graphics/sh3/path_tracer/ray_hit_apply_transform.js +1 -1
- package/src/engine/graphics/sh3/path_tracer/ray_reflect.js +1 -1
- package/src/engine/graphics/sh3/prototypeSH3Probe.js +3 -3
- package/src/engine/graphics/sh3/sky/hosek/data.js +3744 -0
- package/src/engine/graphics/sh3/sky/hosek/sky_hosek_compute_irradiance_by_direction.js +10 -3786
- package/src/engine/graphics/sh3/visualise_probe.js +3 -3
- package/src/engine/graphics/shadows/testShadowMapRendering.js +3 -3
- package/src/engine/graphics/texture/atlas/AbstractTextureAtlas.js +1 -1
- package/src/engine/graphics/texture/atlas/AtlasPatch.js +0 -1
- package/src/engine/graphics/texture/atlas/AtlasPatchFlag.js +8 -1
- package/src/engine/graphics/texture/atlas/CachingTextureAtlas.js +25 -0
- package/src/engine/graphics/texture/atlas/CachingTextureAtlas.spec.js +54 -0
- package/src/engine/graphics/texture/atlas/ManagedTextureAtlas.js +101 -160
- package/src/engine/graphics/texture/atlas/TextureAtlas.js +18 -1
- package/src/engine/graphics/texture/sampler/downloadSamplerAsPNG.js +1 -1
- package/src/engine/graphics/texture/sampler/sampler2d_ensure_uint8_RGBA.js +22 -0
- package/src/engine/graphics/texture/sprite/prototypeSpriteCutoutGeometry.js +2 -2
- package/src/engine/graphics/util/projectSphere.js +1 -1
- package/src/engine/input/ecs/controllers/KeyboardCameraController.js +2 -2
- package/src/engine/input/ecs/util/TopDownCameraControllerHelper.js +2 -2
- package/src/engine/intelligence/behavior/composite/ParallelBehavior.spec.js +13 -12
- package/src/engine/navigation/ecs/components/Path.js +1 -1
- package/src/engine/physics/fluid/prototype.js +3 -3
- package/src/engine/physics/mls-mpm/MLS_MPM.js +11 -106
- package/src/engine/reference/v2/Reference.js +6 -2
- package/src/engine/save/storage/JsonStringCodec.js +1 -1
- package/src/engine/save/storage/LocalStorage.js +2 -1
- package/src/engine/sound/ecs/emitter/SoundEmitter.js +7 -7
- package/src/engine/sound/ecs/emitter/SoundTrack.js +6 -6
- package/src/engine/ui/GUIEngine.js +4 -4
- package/src/engine/ui/notification/NotificationManager.js +3 -3
- package/src/generation/filtering/numeric/complex/CellFilterAngleToNormal.js +1 -1
- package/src/generation/grid/generation/road/GridTaskGenerateRoads.js +2 -4
- package/src/generation/markers/debug/visualizeMarkers.js +2 -2
- package/src/generation/markers/prototypeGridCellActionPlaceMarker.js +2 -2
- package/src/generation/placement/action/random/weighted/CellActionSelectWeightedRandom.js +2 -2
- package/src/generation/theme/ThemeEngine.js +2 -2
- package/src/generation/theme/ThemeEngine.spec.js +7 -0
- package/src/view/View.js +21 -13
- package/src/view/elements/ColorPickerView.js +2 -2
- package/src/view/minimap/gl/MarkerGL.js +20 -18
- package/src/view/minimap/gl/MinimapMarkersGL.js +2 -1
- package/editor/tools/FoliagePaintTool.js +0 -168
- package/editor/tools/engine/ToolStateMachine.js +0 -53
- package/src/core/NumberFormat.js +0 -4
- package/src/core/binary/ByteArrayTools.js +0 -137
- package/src/core/binary/NaiveBitSet.js +0 -69
- package/src/core/binary/objects/StandardTypeBuilder.js +0 -126
- package/src/core/binary/serde/JsonSerializer.js +0 -113
- package/src/core/color/rgb2hsv.js +0 -47
- package/src/core/color/rgb_to_YCbCr_uint24.js +0 -16
- package/src/core/fsm/StateMachine.js +0 -440
- package/src/core/fsm/Transition.js +0 -65
- package/src/core/geom/Bezier.js +0 -24
- package/src/core/geom/Bezier.spec.js +0 -16
- package/src/core/math/spline/quadraticCurve.js +0 -11
- package/src/core/math/spline/quadraticCurve.spec.js +0 -13
- package/src/core/primitives/numbers/compareNumbers.js +0 -9
- package/src/engine/graphics/ecs/decal/Decal.js +0 -10
- package/src/engine/graphics/ecs/decal/DecalSystem.js +0 -99
- package/src/engine/graphics/ecs/decal/threejs/DecalGeometry.js +0 -298
- package/src/engine/graphics/ecs/trail/Trail.js +0 -83
- package/src/engine/graphics/ecs/trail/TrailMaterial.js +0 -67
- package/src/engine/graphics/ecs/trail/TrailMaterial2.js +0 -73
- package/src/engine/graphics/ecs/trail/TrailSystem.js +0 -162
- package/src/engine/graphics/ecs/water2/NodeWaterShader1.js +0 -213
- package/src/engine/graphics/ecs/water2/shader/JBWaterShader.js +0 -315
- package/src/engine/graphics/geometry/MikkT/Length.js +0 -10
- package/src/engine/graphics/texture/ImageLoader.js +0 -33
- package/src/engine/graphics/three/DDSLoader.js +0 -286
- package/src/engine/graphics/three/Water2.js +0 -343
- package/src/engine/physics/spring/computeHookeForce.js +0 -9
- package/src/engine/reference/v1/ReferenceManager.js +0 -124
- /package/src/core/color/{hex2rgb.spec.js → hex/hex2rgb.spec.js} +0 -0
- /package/src/core/color/{rgb2hex.spec.js → hex/rgb2hex.spec.js} +0 -0
- /package/src/core/color/{hsv2rgb.spec.js → hsv/hsv2rgb.spec.js} +0 -0
- /package/src/core/color/{rgb_to_kelvin.js → kelvin/rgb_to_kelvin.js} +0 -0
- /package/src/core/color/{linear_to_sRGB.js → sRGB/linear_to_sRGB.js} +0 -0
- /package/src/core/color/{sRGB_to_linear.js → sRGB/sRGB_to_linear.js} +0 -0
- /package/src/core/geom/{m3_determinant.js → mat3/m3_determinant.js} +0 -0
- /package/src/core/geom/{v3_distance.js → vec3/v3_distance.js} +0 -0
- /package/src/core/geom/{v3_distance_above_plane.js → vec3/v3_distance_above_plane.js} +0 -0
- /package/src/core/geom/{v3_distance_above_plane.spec.js → vec3/v3_distance_above_plane.spec.js} +0 -0
- /package/src/core/geom/{v3_distance_sqr.d.ts → vec3/v3_distance_sqr.d.ts} +0 -0
- /package/src/core/geom/{v3_distance_sqr.js → vec3/v3_distance_sqr.js} +0 -0
- /package/src/core/geom/{v3_dot.js → vec3/v3_dot.js} +0 -0
- /package/src/core/geom/{v3_length.js → vec3/v3_length.js} +0 -0
- /package/src/core/geom/{v3_length_sqr.js → vec3/v3_length_sqr.js} +0 -0
- /package/src/core/geom/{v3_slerp.js → vec3/v3_slerp.js} +0 -0
|
@@ -5,7 +5,7 @@ import { EngineConfiguration } from "../../EngineConfiguration.js";
|
|
|
5
5
|
import { AttachmentSystem } from "../attachment/AttachmentSystem.js";
|
|
6
6
|
import { GameAssetType } from "../../asset/GameAssetType.js";
|
|
7
7
|
import { Sampler2D } from "../../graphics/texture/sampler/Sampler2D.js";
|
|
8
|
-
import
|
|
8
|
+
import Entity from "../Entity.js";
|
|
9
9
|
import HeadsUpDisplay from "../gui/hud/HeadsUpDisplay.js";
|
|
10
10
|
import ViewportPosition from "../gui/position/ViewportPosition.js";
|
|
11
11
|
import GUIElement from "../gui/GUIElement.js";
|
|
@@ -95,7 +95,7 @@ async function main(engine) {
|
|
|
95
95
|
v * grid_size + 1
|
|
96
96
|
);
|
|
97
97
|
|
|
98
|
-
new
|
|
98
|
+
new Entity()
|
|
99
99
|
.add(transform)
|
|
100
100
|
.add(new HeadsUpDisplay())
|
|
101
101
|
.add(new ViewportPosition())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { max2 } from "../../../core/math/max2.js";
|
|
2
2
|
import { Voice } from "./Voice.js";
|
|
3
|
-
import
|
|
3
|
+
import Entity from "../Entity.js";
|
|
4
4
|
import GUIElement from "../gui/GUIElement.js";
|
|
5
5
|
import { SerializationMetadata } from "../components/SerializationMetadata.js";
|
|
6
6
|
import HeadsUpDisplay from "../gui/hud/HeadsUpDisplay.js";
|
|
@@ -31,7 +31,7 @@ import { globalMetrics } from "../../metrics/GlobalMetrics.js";
|
|
|
31
31
|
import { MetricsCategory } from "../../metrics/MetricsCategory.js";
|
|
32
32
|
import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessSpecification.js";
|
|
33
33
|
import { ResourceAccessKind } from "../../../core/model/ResourceAccessKind.js";
|
|
34
|
-
import {
|
|
34
|
+
import { EntityFlags } from "../EntityFlags.js";
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Delay before the user notices the text and begins to read
|
|
@@ -105,7 +105,7 @@ class Context extends SystemEntityContext {
|
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
107
|
*
|
|
108
|
-
* @type {
|
|
108
|
+
* @type {Entity}
|
|
109
109
|
*/
|
|
110
110
|
this.active_executor = null;
|
|
111
111
|
}
|
|
@@ -354,7 +354,7 @@ export class VoiceSystem extends AbstractContextSystem {
|
|
|
354
354
|
|
|
355
355
|
const ctx = this.__getEntityContext(entity);
|
|
356
356
|
|
|
357
|
-
if (ctx.active_executor !== null && ctx.active_executor.getFlag(
|
|
357
|
+
if (ctx.active_executor !== null && ctx.active_executor.getFlag(EntityFlags.Built)) {
|
|
358
358
|
// terminate currently speech bubble
|
|
359
359
|
ctx.active_executor.destroy();
|
|
360
360
|
}
|
|
@@ -415,7 +415,7 @@ export class VoiceSystem extends AbstractContextSystem {
|
|
|
415
415
|
|
|
416
416
|
this.__setBubbleSize(line_pure_text, view);
|
|
417
417
|
|
|
418
|
-
const entityBuilder = new
|
|
418
|
+
const entityBuilder = new Entity()
|
|
419
419
|
.add(GUIElement.fromView(view))
|
|
420
420
|
.add(ViewportPosition.fromJSON({ anchor: new Vector2(0.5, 1) }))
|
|
421
421
|
.add(HeadsUpDisplay.fromJSON({}))
|
|
@@ -12,7 +12,7 @@ import { Transform } from '../transform/Transform.js';
|
|
|
12
12
|
import Steering, { SteeringEvents, SteeringFlags } from '../components/Steering.js';
|
|
13
13
|
import Vector3 from "../../../core/geom/Vector3.js";
|
|
14
14
|
import { alignToVector } from "../terrain/ecs/cling/ClingToTerrainSystem.js";
|
|
15
|
-
import { v3_dot } from "../../../core/geom/v3_dot.js";
|
|
15
|
+
import { v3_dot } from "../../../core/geom/vec3/v3_dot.js";
|
|
16
16
|
import { solveQuadratic } from "../../../core/math/solveQuadratic.js";
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -11,7 +11,7 @@ import Vector2 from "../../../../../core/geom/Vector2.js";
|
|
|
11
11
|
import Vector4 from "../../../../../core/geom/Vector4.js";
|
|
12
12
|
import { MersenneTwister } from "../../../../../core/math/random/MersenneTwister.js";
|
|
13
13
|
import { arrayPickBestElement } from "../../../../../core/collection/array/arrayPickBestElement.js";
|
|
14
|
-
import { hsv2rgb } from "../../../../../core/color/hsv2rgb.js";
|
|
14
|
+
import { hsv2rgb } from "../../../../../core/color/hsv/hsv2rgb.js";
|
|
15
15
|
|
|
16
16
|
function removeAllChildren(node) {
|
|
17
17
|
const children = node.children;
|
|
@@ -4,7 +4,7 @@ import { QuestDescriptionDatabase } from "../../../../../model/game/ecs/componen
|
|
|
4
4
|
import { MeshSystem } from "../../graphics/ecs/mesh/MeshSystem.js";
|
|
5
5
|
import { makeEngineOptionsModel } from "../../../../../model/game/options/makeEngineOptionsModel.js";
|
|
6
6
|
import Vector3 from "../../../core/geom/Vector3.js";
|
|
7
|
-
import
|
|
7
|
+
import Entity from "../Entity.js";
|
|
8
8
|
import { Transform } from "../transform/Transform.js";
|
|
9
9
|
import Mesh from "../../graphics/ecs/mesh/Mesh.js";
|
|
10
10
|
import { TooltipComponent } from "./TooltipComponent.js";
|
|
@@ -87,7 +87,7 @@ function main(engine) {
|
|
|
87
87
|
|
|
88
88
|
const ecd = engine.entityManager.dataset;
|
|
89
89
|
|
|
90
|
-
new
|
|
90
|
+
new Entity()
|
|
91
91
|
.add(Transform.fromJSON({
|
|
92
92
|
position: new Vector3(12.17416, 0.09969, 11.06082)
|
|
93
93
|
}))
|
|
@@ -101,7 +101,7 @@ function main(engine) {
|
|
|
101
101
|
}))
|
|
102
102
|
.build(ecd);
|
|
103
103
|
|
|
104
|
-
new
|
|
104
|
+
new Entity()
|
|
105
105
|
.add(Transform.fromJSON({
|
|
106
106
|
position: new Vector3(10.5, 0.09969, 9.06082)
|
|
107
107
|
}))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import TopDownCameraController, { rotate_from_view } from "../ecs/camera/topdown/TopDownCameraController.js";
|
|
2
2
|
import InputController from "../../input/ecs/components/InputController.js";
|
|
3
3
|
import { decodeMouseEventButtons } from "../../input/devices/PointerDevice.js";
|
|
4
|
-
import
|
|
4
|
+
import Entity from "../../ecs/Entity.js";
|
|
5
5
|
import { Camera } from "../ecs/camera/Camera.js";
|
|
6
6
|
import { clamp } from "../../../core/math/clamp.js";
|
|
7
7
|
|
|
@@ -11,7 +11,7 @@ import { clamp } from "../../../core/math/clamp.js";
|
|
|
11
11
|
* @param {EntityComponentDataset} ecd
|
|
12
12
|
* @param {HTMLElement} dom_element
|
|
13
13
|
* @param {number} [sensitivity]
|
|
14
|
-
* @return {
|
|
14
|
+
* @return {Entity}
|
|
15
15
|
*/
|
|
16
16
|
export function makeOrbitalCameraController({
|
|
17
17
|
camera_entity,
|
|
@@ -101,7 +101,7 @@ export function makeOrbitalCameraController({
|
|
|
101
101
|
}
|
|
102
102
|
]);
|
|
103
103
|
|
|
104
|
-
const eb = new
|
|
104
|
+
const eb = new Entity();
|
|
105
105
|
eb.add(inputController);
|
|
106
106
|
|
|
107
107
|
return eb;
|
|
@@ -43,7 +43,7 @@ import { makeEngineOptionsModel } from "../../../../../model/game/options/makeEn
|
|
|
43
43
|
import { enableEditor } from "../../../../editor/enableEditor.js";
|
|
44
44
|
import Vector3 from "../../../core/geom/Vector3.js";
|
|
45
45
|
import { CanvasView } from "../../../view/elements/CanvasView.js";
|
|
46
|
-
import
|
|
46
|
+
import Entity from "../../ecs/Entity.js";
|
|
47
47
|
import GUIElement from "../../ecs/gui/GUIElement.js";
|
|
48
48
|
import ViewportPosition from "../../ecs/gui/position/ViewportPosition.js";
|
|
49
49
|
import Vector2 from "../../../core/geom/Vector2.js";
|
|
@@ -389,7 +389,7 @@ function main(engine) {
|
|
|
389
389
|
engine.graphics.renderer.setClearColor('rgba(99,99,99,1)');
|
|
390
390
|
|
|
391
391
|
|
|
392
|
-
new
|
|
392
|
+
new Entity()
|
|
393
393
|
.add(Transform.fromJSON({
|
|
394
394
|
position: {
|
|
395
395
|
x: 100,
|
|
@@ -411,7 +411,7 @@ function main(engine) {
|
|
|
411
411
|
|
|
412
412
|
const canvasView = makeCameraClippingDebug(engine);
|
|
413
413
|
|
|
414
|
-
new
|
|
414
|
+
new Entity()
|
|
415
415
|
.add(ViewportPosition.fromJSON({
|
|
416
416
|
offset: new Vector2(10, 10)
|
|
417
417
|
}))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Vector3 from "../../../core/geom/Vector3.js";
|
|
2
2
|
import { Transform } from "../../ecs/transform/Transform.js";
|
|
3
|
-
import
|
|
3
|
+
import Entity from "../../ecs/Entity.js";
|
|
4
4
|
import HeadsUpDisplay from "../../ecs/gui/hud/HeadsUpDisplay.js";
|
|
5
5
|
import ViewportPosition from "../../ecs/gui/position/ViewportPosition.js";
|
|
6
6
|
import GUIElement from "../../ecs/gui/GUIElement.js";
|
|
@@ -10,7 +10,7 @@ import LabelView from "../../../view/common/LabelView.js";
|
|
|
10
10
|
*
|
|
11
11
|
* @param {string} text
|
|
12
12
|
* @param {Vector3} [position]
|
|
13
|
-
* @returns {
|
|
13
|
+
* @returns {Entity}
|
|
14
14
|
*/
|
|
15
15
|
export function createDebugLabel(text, position = Vector3.zero) {
|
|
16
16
|
|
|
@@ -26,7 +26,7 @@ export function createDebugLabel(text, position = Vector3.zero) {
|
|
|
26
26
|
|
|
27
27
|
t.position.copy(position);
|
|
28
28
|
|
|
29
|
-
const eb = new
|
|
29
|
+
const eb = new Entity()
|
|
30
30
|
.add(new HeadsUpDisplay())
|
|
31
31
|
.add(new ViewportPosition())
|
|
32
32
|
.add(GUIElement.fromView(v))
|
|
@@ -12,7 +12,7 @@ import { unprojectPoint } from "./unprojectPoint.js";
|
|
|
12
12
|
import Vector3 from "../../../../core/geom/Vector3.js";
|
|
13
13
|
import { frustum_from_camera } from "./frustum_from_camera.js";
|
|
14
14
|
import { invertQuaternionOrientation } from "./InvertQuaternionOrientation.js";
|
|
15
|
-
import { v3_distance_above_plane } from "../../../../core/geom/v3_distance_above_plane.js";
|
|
15
|
+
import { v3_distance_above_plane } from "../../../../core/geom/vec3/v3_distance_above_plane.js";
|
|
16
16
|
import { ProjectionType } from "./ProjectionType.js";
|
|
17
17
|
import { plane3_compute_ray_intersection } from "../../../../core/geom/3d/plane/plane3_compute_ray_intersection.js";
|
|
18
18
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Frustum as ThreeFrustum } from "three";
|
|
2
|
-
import { v3_dot } from "../../../../core/geom/v3_dot.js";
|
|
2
|
+
import { v3_dot } from "../../../../core/geom/vec3/v3_dot.js";
|
|
3
3
|
import { isValueBetweenInclusive } from "../../../../core/math/interval/isValueBetweenInclusive.js";
|
|
4
4
|
import { frustum_from_camera } from "./frustum_from_camera.js";
|
|
5
5
|
import { is_valid_distance_value } from "./is_valid_distance_value.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assert } from "../../../../../core/assert.js";
|
|
2
2
|
import TopDownCameraController from "../topdown/TopDownCameraController.js";
|
|
3
|
-
import
|
|
3
|
+
import Entity from "../../../../ecs/Entity.js";
|
|
4
4
|
import { BehaviorComponent } from "../../../../intelligence/behavior/ecs/BehaviorComponent.js";
|
|
5
5
|
import { RepeatBehavior } from "../../../../intelligence/behavior/decorator/RepeatBehavior.js";
|
|
6
6
|
import { ActionBehavior } from "../../../../intelligence/behavior/primitive/ActionBehavior.js";
|
|
@@ -14,7 +14,7 @@ import { lerp } from "../../../../../core/math/lerp.js";
|
|
|
14
14
|
* @param {EntityComponentDataset} ecd
|
|
15
15
|
* @param {number} [responsiveness] higher value results in sharper movement when following
|
|
16
16
|
* @param {number} [inertia]
|
|
17
|
-
* @returns {{controller:TopDownCameraController, entity:
|
|
17
|
+
* @returns {{controller:TopDownCameraController, entity:Entity}}
|
|
18
18
|
*/
|
|
19
19
|
export function setup_filtered_camera_controller({
|
|
20
20
|
target,
|
|
@@ -33,7 +33,7 @@ export function setup_filtered_camera_controller({
|
|
|
33
33
|
const remembered_value = new TopDownCameraController();
|
|
34
34
|
remembered_value.copy(result);
|
|
35
35
|
|
|
36
|
-
const entityBuilder = new
|
|
36
|
+
const entityBuilder = new Entity();
|
|
37
37
|
|
|
38
38
|
entityBuilder
|
|
39
39
|
.add(BehaviorComponent.fromOne(
|
|
@@ -10,7 +10,6 @@ import { Sampler2D } from "../../../texture/sampler/Sampler2D.js";
|
|
|
10
10
|
import { GameAssetType } from "../../../../asset/GameAssetType.js";
|
|
11
11
|
import { assert } from "../../../../../core/assert.js";
|
|
12
12
|
import { AsyncLoadingCache } from "../../../../../core/collection/map/AsyncLoadingCache.js";
|
|
13
|
-
import { sampler2d_to_uint8_RGBA } from "../../../texture/sampler/sampler2d_to_uint8_RGBA.js";
|
|
14
13
|
import { returnTrue } from "../../../../../core/function/Functions.js";
|
|
15
14
|
import {
|
|
16
15
|
ExplicitBinaryBoundingVolumeHierarchy
|
|
@@ -29,6 +28,7 @@ import {
|
|
|
29
28
|
import {
|
|
30
29
|
aabb3_transformed_compute_plane_side
|
|
31
30
|
} from "../../../../../core/geom/3d/aabb/aabb3_transformed_compute_plane_side.js";
|
|
31
|
+
import { sampler2d_ensure_uint8_RGBA } from "../../../texture/sampler/sampler2d_ensure_uint8_RGBA.js";
|
|
32
32
|
|
|
33
33
|
const placeholder_texture = Sampler2D.uint8(4, 1, 1);
|
|
34
34
|
placeholder_texture.data.fill(255);
|
|
@@ -249,15 +249,7 @@ export class FPDecalSystem extends AbstractContextSystem {
|
|
|
249
249
|
return this.__assets.promise(key, GameAssetType.Image).then(asset => {
|
|
250
250
|
const asset_sampler = asset.create();
|
|
251
251
|
|
|
252
|
-
|
|
253
|
-
return asset_sampler;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
const resampled = Sampler2D.uint8(4, asset_sampler.width, asset_sampler.height);
|
|
257
|
-
|
|
258
|
-
sampler2d_to_uint8_RGBA(resampled, asset_sampler);
|
|
259
|
-
|
|
260
|
-
return resampled;
|
|
252
|
+
return sampler2d_ensure_uint8_RGBA(asset_sampler);
|
|
261
253
|
});
|
|
262
254
|
});
|
|
263
255
|
|
|
@@ -389,7 +381,7 @@ export class FPDecalSystem extends AbstractContextSystem {
|
|
|
389
381
|
|
|
390
382
|
const bvh = this.bvh;
|
|
391
383
|
|
|
392
|
-
const hit_count = bvh_query_leaves_ray(bvh,bvh.root, leaves, 0,
|
|
384
|
+
const hit_count = bvh_query_leaves_ray(bvh, bvh.root, leaves, 0,
|
|
393
385
|
origin_x, origin_y, origin_z,
|
|
394
386
|
direction_x, direction_y, direction_z
|
|
395
387
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EngineHarness } from "../../../../EngineHarness.js";
|
|
2
|
-
import
|
|
2
|
+
import Entity from "../../../../ecs/Entity.js";
|
|
3
3
|
import { SGMesh } from "../../mesh-v2/aggregate/SGMesh.js";
|
|
4
4
|
import { Transform } from "../../../../ecs/transform/Transform.js";
|
|
5
5
|
import { GLTFAssetLoader } from "../../../../asset/loaders/GLTFAssetLoader.js";
|
|
@@ -102,7 +102,7 @@ async function main(engine) {
|
|
|
102
102
|
|
|
103
103
|
const ecd = engine.entityManager.dataset;
|
|
104
104
|
|
|
105
|
-
new
|
|
105
|
+
new Entity()
|
|
106
106
|
.add(SGMesh.fromURL("moicon/gnutti_not_optimized/model.gltf"))
|
|
107
107
|
.add(Transform.fromJSON({
|
|
108
108
|
position: { x: 10, y: 3, z: 10 },
|
|
@@ -113,7 +113,7 @@ async function main(engine) {
|
|
|
113
113
|
|
|
114
114
|
const selected_decal_uri = new ObservedString('');
|
|
115
115
|
|
|
116
|
-
new
|
|
116
|
+
new Entity()
|
|
117
117
|
.add(GUIElement.fromView(makeDecalSelector({ engine, selected: selected_decal_uri })))
|
|
118
118
|
.build(ecd);
|
|
119
119
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EngineHarness } from "../../../../EngineHarness.js";
|
|
2
2
|
import { FPDecalSystem } from "./FPDecalSystem.js";
|
|
3
|
-
import
|
|
3
|
+
import Entity from "../../../../ecs/Entity.js";
|
|
4
4
|
import { Decal } from "./Decal.js";
|
|
5
5
|
import { Transform } from "../../../../ecs/transform/Transform.js";
|
|
6
6
|
import { randomFloatBetween } from "../../../../../core/math/random/randomFloatBetween.js";
|
|
@@ -31,7 +31,7 @@ import { GizmoRenderingPlugin } from "../../../render/gizmo/GizmoRenderingPlugin
|
|
|
31
31
|
import { Gizmo } from "../../../render/gizmo/Gizmo.js";
|
|
32
32
|
import { ForwardPlusRenderingPlugin } from "../../../render/forward_plus/plugin/ForwardPlusRenderingPlugin.js";
|
|
33
33
|
import { TaskLoadingScreen } from "../../../../../view/task/TaskLoadingScreen.js";
|
|
34
|
-
import {
|
|
34
|
+
import { EntityFlags } from "../../../../ecs/EntityFlags.js";
|
|
35
35
|
|
|
36
36
|
const decal_urls = `data/textures/icons/FantasyIconsMegaPack/MagicItems/MagicItems_png/transparent/x64/staff_13_t.png
|
|
37
37
|
data/textures/icons/FantasyIconsMegaPack/MagicItems/MagicItems_png/transparent/x64/artifact_01_t.png
|
|
@@ -244,9 +244,9 @@ function grid(ecd, offset_x, offset_y, x, y, size_x, size_y, spacing, textures)
|
|
|
244
244
|
|
|
245
245
|
decal.uri = randomFromArray(random, textures);
|
|
246
246
|
|
|
247
|
-
const entity = new
|
|
247
|
+
const entity = new Entity();
|
|
248
248
|
|
|
249
|
-
entity.clearFlag(
|
|
249
|
+
entity.clearFlag(EntityFlags.WatchDestruction);
|
|
250
250
|
|
|
251
251
|
const transform = new Transform();
|
|
252
252
|
transform.position.set(
|
|
@@ -300,9 +300,9 @@ function makeNormalTestGridDecal(ecd, root_transform = new Transform()) {
|
|
|
300
300
|
// decal.uri = decal_urls[1];
|
|
301
301
|
decal.uri = 'moicon/ISO 7010 - Safety Signs (3)/ISO 7010 - Safety Signs/Emergency/400px/E001 – Emergency exit (left hand).png';
|
|
302
302
|
|
|
303
|
-
const entity = new
|
|
303
|
+
const entity = new Entity();
|
|
304
304
|
|
|
305
|
-
entity.clearFlag(
|
|
305
|
+
entity.clearFlag(EntityFlags.WatchDestruction);
|
|
306
306
|
|
|
307
307
|
const transform = new Transform();
|
|
308
308
|
transform.position.set(
|
|
@@ -336,7 +336,7 @@ function makeNormalTestGridDecal(ecd, root_transform = new Transform()) {
|
|
|
336
336
|
});
|
|
337
337
|
arrow_transform.multiplyTransforms(transform, arrow_transform);
|
|
338
338
|
|
|
339
|
-
new
|
|
339
|
+
new Entity()
|
|
340
340
|
.add(ShadedGeometry.from(makeSolidArrowGeometry(), new MeshStandardMaterial({
|
|
341
341
|
side: DoubleSide
|
|
342
342
|
}), DrawMode.Triangles))
|
|
@@ -347,16 +347,16 @@ function makeNormalTestGridDecal(ecd, root_transform = new Transform()) {
|
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
/**
|
|
350
|
-
* @returns {
|
|
350
|
+
* @returns {Entity}
|
|
351
351
|
*/
|
|
352
352
|
function makeNormalTestDecal() {
|
|
353
353
|
const decal = new Decal();
|
|
354
354
|
|
|
355
355
|
decal.uri = decal_urls[1];
|
|
356
356
|
|
|
357
|
-
const entity = new
|
|
357
|
+
const entity = new Entity();
|
|
358
358
|
|
|
359
|
-
entity.clearFlag(
|
|
359
|
+
entity.clearFlag(EntityFlags.WatchDestruction);
|
|
360
360
|
|
|
361
361
|
const transform = new Transform();
|
|
362
362
|
transform.position.set(
|
|
@@ -395,7 +395,7 @@ function sample_grid(ecd) {
|
|
|
395
395
|
});
|
|
396
396
|
makeNormalTestGridDecal(ecd, t_forward_grid);
|
|
397
397
|
|
|
398
|
-
new
|
|
398
|
+
new Entity()
|
|
399
399
|
.add(SGMesh.fromURL('data/models/snaps/cube_white.gltf'))
|
|
400
400
|
.add(Transform.fromJSON({
|
|
401
401
|
position: new Vector3(14, 1, 4.8),
|
|
@@ -459,7 +459,7 @@ async function main(engine) {
|
|
|
459
459
|
terrainSize: new Vector2(TERRAIN_SIZE, TERRAIN_SIZE)
|
|
460
460
|
});
|
|
461
461
|
|
|
462
|
-
new
|
|
462
|
+
new Entity()
|
|
463
463
|
.add(SGMesh.fromURL("moicon/gnutti_not_optimized/model.gltf"))
|
|
464
464
|
.add(Transform.fromJSON({
|
|
465
465
|
position: { x: 10, y: 3, z: 10 },
|
|
@@ -481,9 +481,9 @@ async function main(engine) {
|
|
|
481
481
|
|
|
482
482
|
decal.uri = randomFromArray(random, decal_urls);
|
|
483
483
|
|
|
484
|
-
const entity = new
|
|
484
|
+
const entity = new Entity();
|
|
485
485
|
|
|
486
|
-
entity.clearFlag(
|
|
486
|
+
entity.clearFlag(EntityFlags.WatchDestruction);
|
|
487
487
|
|
|
488
488
|
const transform = new Transform();
|
|
489
489
|
transform.position.set(
|
|
@@ -5,111 +5,12 @@ import List from "../../../../core/collection/list/List.js";
|
|
|
5
5
|
import { HighlightDefinition } from "./HighlightDefinition.js";
|
|
6
6
|
|
|
7
7
|
class Highlight {
|
|
8
|
-
constructor() {
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
* @type {List<HighlightDefinition>}
|
|
12
|
-
*/
|
|
13
|
-
this.elements = new List();
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated
|
|
18
|
-
* @param {number} v
|
|
19
|
-
*/
|
|
20
|
-
set r(v) {
|
|
21
|
-
console.warn('deprecated, use .elements instead');
|
|
22
|
-
|
|
23
|
-
const first = this.elements.get(0);
|
|
24
|
-
|
|
25
|
-
first.color.setRGB(v, first.color.g, first.color.b);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated
|
|
30
|
-
* @returns {number}
|
|
31
|
-
*/
|
|
32
|
-
get r() {
|
|
33
|
-
console.warn('deprecated, use .elements instead');
|
|
34
|
-
|
|
35
|
-
const first = this.elements.get(0);
|
|
36
|
-
const color = first.color;
|
|
37
|
-
|
|
38
|
-
return color.r;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @deprecated
|
|
43
|
-
* @param {number} v
|
|
44
|
-
*/
|
|
45
|
-
set g(v) {
|
|
46
|
-
console.warn('deprecated, use .elements instead');
|
|
47
|
-
|
|
48
|
-
const first = this.elements.get(0);
|
|
49
|
-
|
|
50
|
-
first.color.setRGB(first.color.r, v, first.color.b);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @deprecated
|
|
55
|
-
* @returns {number}
|
|
56
|
-
*/
|
|
57
|
-
get g() {
|
|
58
|
-
console.warn('deprecated, use .elements instead');
|
|
59
|
-
|
|
60
|
-
const first = this.elements.get(0);
|
|
61
|
-
const color = first.color;
|
|
62
|
-
|
|
63
|
-
return color.g;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* @deprecated
|
|
68
|
-
* @param {number} v
|
|
69
|
-
*/
|
|
70
|
-
set b(v) {
|
|
71
|
-
console.warn('deprecated, use .elements instead');
|
|
72
|
-
|
|
73
|
-
const first = this.elements.get(0);
|
|
74
|
-
|
|
75
|
-
first.color.setRGB(first.color.r, first.color.g, v);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @deprecated
|
|
80
|
-
* @returns {number}
|
|
81
|
-
*/
|
|
82
|
-
get b() {
|
|
83
|
-
console.warn('deprecated, use .elements instead');
|
|
84
|
-
|
|
85
|
-
const first = this.elements.get(0);
|
|
86
|
-
const color = first.color;
|
|
87
|
-
|
|
88
|
-
return color.b;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* @deprecated
|
|
93
|
-
* @param {number} v
|
|
94
|
-
*/
|
|
95
|
-
set a(v) {
|
|
96
|
-
console.warn('deprecated, use .elements instead');
|
|
97
|
-
|
|
98
|
-
const first = this.elements.get(0);
|
|
99
|
-
|
|
100
|
-
first.opacity = v;
|
|
101
|
-
}
|
|
102
8
|
|
|
103
9
|
/**
|
|
104
|
-
*
|
|
105
|
-
* @
|
|
10
|
+
*
|
|
11
|
+
* @type {List<HighlightDefinition>}
|
|
106
12
|
*/
|
|
107
|
-
|
|
108
|
-
console.warn('deprecated, use .elements instead');
|
|
109
|
-
|
|
110
|
-
const first = this.elements.get(0);
|
|
111
|
-
return first.opacity;
|
|
112
|
-
}
|
|
13
|
+
elements = new List();
|
|
113
14
|
|
|
114
15
|
/**
|
|
115
16
|
*
|
|
@@ -140,6 +41,23 @@ class Highlight {
|
|
|
140
41
|
return el;
|
|
141
42
|
}
|
|
142
43
|
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @param {Highlight} other
|
|
47
|
+
* @return {boolean}
|
|
48
|
+
*/
|
|
49
|
+
equals(other) {
|
|
50
|
+
return this.elements.equals(other.elements);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @return {number}
|
|
56
|
+
*/
|
|
57
|
+
hash() {
|
|
58
|
+
return this.elements.hash();
|
|
59
|
+
}
|
|
60
|
+
|
|
143
61
|
toJSON() {
|
|
144
62
|
return {
|
|
145
63
|
elements: this.elements.toJSON()
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* Created by Alex Goldring on 25.02.2015.
|
|
3
3
|
*/
|
|
4
4
|
import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
|
|
5
|
-
import { LeafNode } from "../../../../core/bvh2/LeafNode.js";
|
|
6
5
|
import { getSkeletonBoneByType } from "./SkeletonUtils.js";
|
|
7
6
|
import { assert } from "../../../../core/assert.js";
|
|
8
7
|
import { computeStringHash } from "../../../../core/primitives/strings/computeStringHash.js";
|
|
9
8
|
import { Transform } from "../../../ecs/transform/Transform.js";
|
|
10
|
-
import { updateNodeByTransformAndBBB } from "./updateNodeByTransformAndBBB.js";
|
|
11
9
|
import { applyTransformToThreeObject } from "./applyTransformToThreeObject.js";
|
|
12
10
|
import { computeHashIntegerArray } from "../../../../core/collection/array/computeHashIntegerArray.js";
|
|
13
11
|
import { computeHashFloat } from "../../../../core/primitives/numbers/computeHashFloat.js";
|
|
12
|
+
import { EBBVHLeafProxy } from "../../../../core/bvh2/bvh3/EBBVHLeafProxy.js";
|
|
13
|
+
import { aabb3_matrix4_project } from "../../../../core/geom/3d/aabb/aabb3_matrix4_project.js";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
*
|
|
@@ -69,18 +69,18 @@ class Mesh {
|
|
|
69
69
|
*/
|
|
70
70
|
this.opacity = 1;
|
|
71
71
|
|
|
72
|
-
/**
|
|
73
|
-
* Managed by MeshSystem, do not change
|
|
74
|
-
* @type {LeafNode}
|
|
75
|
-
*/
|
|
76
|
-
this.bvh = new LeafNode(this, 0, 0, 0, 0, 0, 0);
|
|
77
|
-
|
|
78
72
|
/**
|
|
79
73
|
* Initialized to size 1x1x1
|
|
80
74
|
* @type {AABB3}
|
|
81
75
|
*/
|
|
82
76
|
this.boundingBox = new AABB3(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
|
|
83
77
|
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* @type {EBBVHLeafProxy}
|
|
81
|
+
*/
|
|
82
|
+
this.__bvh_leaf = new EBBVHLeafProxy();
|
|
83
|
+
|
|
84
84
|
/**
|
|
85
85
|
* @private
|
|
86
86
|
* @type {number}
|
|
@@ -126,7 +126,9 @@ class Mesh {
|
|
|
126
126
|
applyTransformToThreeObject(m, _t);
|
|
127
127
|
|
|
128
128
|
//set bvh
|
|
129
|
-
|
|
129
|
+
aabb3_matrix4_project(this.__bvh_leaf.bounds, this.boundingBox, _t.matrix);
|
|
130
|
+
|
|
131
|
+
this.__bvh_leaf.write_bounds();
|
|
130
132
|
|
|
131
133
|
// override
|
|
132
134
|
if (this.override_mesh !== null) {
|
|
@@ -139,7 +141,7 @@ class Mesh {
|
|
|
139
141
|
* @param {AABB3} destination
|
|
140
142
|
*/
|
|
141
143
|
getBoundingBox(destination) {
|
|
142
|
-
destination.
|
|
144
|
+
destination.readFromArray(this.__bvh_leaf.bounds);
|
|
143
145
|
}
|
|
144
146
|
|
|
145
147
|
/**
|
|
@@ -150,14 +152,6 @@ class Mesh {
|
|
|
150
152
|
destination.copy(this.boundingBox);
|
|
151
153
|
}
|
|
152
154
|
|
|
153
|
-
set center(v) {
|
|
154
|
-
throw new Error("Mesh.center is deprecated");
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
get center() {
|
|
158
|
-
throw new Error("Mesh.center is deprecated");
|
|
159
|
-
}
|
|
160
|
-
|
|
161
155
|
/**
|
|
162
156
|
*
|
|
163
157
|
* @return {boolean}
|