@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
|
@@ -21,6 +21,12 @@ import { MeshEvents } from "./MeshEvents.js";
|
|
|
21
21
|
import { assert } from "../../../../core/assert.js";
|
|
22
22
|
import { ResourceAccessSpecification } from "../../../../core/model/ResourceAccessSpecification.js";
|
|
23
23
|
import { ResourceAccessKind } from "../../../../core/model/ResourceAccessKind.js";
|
|
24
|
+
import {
|
|
25
|
+
ExplicitBinaryBoundingVolumeHierarchy
|
|
26
|
+
} from "../../../../core/bvh2/bvh3/ExplicitBinaryBoundingVolumeHierarchy.js";
|
|
27
|
+
import {
|
|
28
|
+
bvh_query_user_data_overlaps_frustum
|
|
29
|
+
} from "../../../../core/bvh2/bvh3/query/bvh_query_user_data_overlaps_frustum.js";
|
|
24
30
|
|
|
25
31
|
const placeholderGeometry = new BoxBufferGeometry(1, 1, 1);
|
|
26
32
|
|
|
@@ -30,6 +36,8 @@ const placeholderTexture = checkerTexture.create();
|
|
|
30
36
|
|
|
31
37
|
const placeholderMaterial = new MeshLambertMaterial({ map: placeholderTexture });
|
|
32
38
|
|
|
39
|
+
const scratch_array = [];
|
|
40
|
+
|
|
33
41
|
export class MeshSystem extends System {
|
|
34
42
|
/**
|
|
35
43
|
*
|
|
@@ -89,9 +97,10 @@ export class MeshSystem extends System {
|
|
|
89
97
|
|
|
90
98
|
/**
|
|
91
99
|
*
|
|
92
|
-
* @type {
|
|
100
|
+
* @type {ExplicitBinaryBoundingVolumeHierarchy}
|
|
101
|
+
* @private
|
|
93
102
|
*/
|
|
94
|
-
this.
|
|
103
|
+
this.__bvh_binary = new ExplicitBinaryBoundingVolumeHierarchy();
|
|
95
104
|
}
|
|
96
105
|
|
|
97
106
|
/**
|
|
@@ -152,29 +161,37 @@ export class MeshSystem extends System {
|
|
|
152
161
|
const graphics = this.graphics;
|
|
153
162
|
this.renderLayer = graphics.layers.create("mesh-system");
|
|
154
163
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
if (component.override_mesh !== null) {
|
|
162
|
-
// use override mesh
|
|
163
|
-
return component.override_mesh;
|
|
164
|
-
} else {
|
|
165
|
-
// use standard mesh
|
|
166
|
-
return component.mesh;
|
|
164
|
+
this.renderLayer.buildVisibleSet = (destination, destination_offset, view) => {
|
|
165
|
+
|
|
166
|
+
const ecd = entityManager.dataset;
|
|
167
|
+
|
|
168
|
+
if (ecd === null) {
|
|
169
|
+
return 0;
|
|
167
170
|
}
|
|
168
|
-
};
|
|
169
171
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
172
|
+
const view_frustum = view.frustum;
|
|
173
|
+
|
|
174
|
+
const hit_count = bvh_query_user_data_overlaps_frustum(scratch_array, 0, this.__bvh_binary, view_frustum);
|
|
175
|
+
|
|
176
|
+
let added = 0;
|
|
177
|
+
|
|
178
|
+
for (let i = 0; i < hit_count; i++) {
|
|
179
|
+
const entity = scratch_array[i];
|
|
180
|
+
|
|
181
|
+
const component = ecd.getComponent(entity, Mesh);
|
|
182
|
+
|
|
183
|
+
const object3D = component.mesh;
|
|
176
184
|
|
|
177
|
-
|
|
185
|
+
if (object3D === null) {
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
destination[destination_offset + added] = object3D;
|
|
190
|
+
added++;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return added;
|
|
194
|
+
};
|
|
178
195
|
|
|
179
196
|
const visibleSet = this.renderLayer.visibleSet;
|
|
180
197
|
|
|
@@ -272,8 +289,6 @@ export class MeshSystem extends System {
|
|
|
272
289
|
*/
|
|
273
290
|
link(model, transform, entity) {
|
|
274
291
|
//remember entity for fast lookup
|
|
275
|
-
model.bvh.entity = entity;
|
|
276
|
-
|
|
277
292
|
this.process(entity, model);
|
|
278
293
|
|
|
279
294
|
function apply_transform() {
|
|
@@ -305,7 +320,7 @@ export class MeshSystem extends System {
|
|
|
305
320
|
|
|
306
321
|
apply_transform();
|
|
307
322
|
|
|
308
|
-
|
|
323
|
+
model.__bvh_leaf.link(this.__bvh_binary, entity);
|
|
309
324
|
}
|
|
310
325
|
|
|
311
326
|
/**
|
|
@@ -343,7 +358,7 @@ export class MeshSystem extends System {
|
|
|
343
358
|
}
|
|
344
359
|
}
|
|
345
360
|
|
|
346
|
-
model.
|
|
361
|
+
model.__bvh_leaf.unlink();
|
|
347
362
|
|
|
348
363
|
// cleanup resources
|
|
349
364
|
model.dispose();
|
|
@@ -2,7 +2,7 @@ import { ShadedGeometry } from "./ShadedGeometry.js";
|
|
|
2
2
|
import { Transform } from "../../../ecs/transform/Transform.js";
|
|
3
3
|
import { System } from "../../../ecs/System.js";
|
|
4
4
|
import { SurfacePoint3 } from "../../../../core/geom/3d/SurfacePoint3.js";
|
|
5
|
-
import { v3_distance_sqr } from "../../../../core/geom/v3_distance_sqr.js";
|
|
5
|
+
import { v3_distance_sqr } from "../../../../core/geom/vec3/v3_distance_sqr.js";
|
|
6
6
|
import { mat4 } from "gl-matrix";
|
|
7
7
|
import { returnTrue } from "../../../../core/function/Functions.js";
|
|
8
8
|
import { ShadedGeometryRendererContext } from "./render/ShadedGeometryRendererContext.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EngineHarness } from "../../../../EngineHarness.js";
|
|
2
2
|
import { ShadedGeometrySystem } from "../ShadedGeometrySystem.js";
|
|
3
3
|
import { SGMeshSystem } from "./SGMeshSystem.js";
|
|
4
|
-
import
|
|
4
|
+
import Entity from "../../../../ecs/Entity.js";
|
|
5
5
|
import { Transform } from "../../../../ecs/transform/Transform.js";
|
|
6
6
|
import { SGMesh } from "./SGMesh.js";
|
|
7
7
|
import { GameAssetType } from "../../../../asset/GameAssetType.js";
|
|
@@ -105,7 +105,7 @@ function make_grid(ecd, engine) {
|
|
|
105
105
|
|
|
106
106
|
const mesh = SGMesh.fromURL("data/models/RTS_Buildings_Humans/18/Building_R_18_out/Building_R_18.gltf");
|
|
107
107
|
// const mesh = SGMesh.fromURL("data/models/samples/transform-hierarchy.glb");
|
|
108
|
-
new
|
|
108
|
+
new Entity()
|
|
109
109
|
.add(mesh)
|
|
110
110
|
.add(transform)
|
|
111
111
|
.add(BehaviorComponent.fromOne(
|
|
@@ -144,7 +144,7 @@ function main(engine) {
|
|
|
144
144
|
const mesh = SGMesh.fromURL("moicon/2022_04_20__Micron_from_Philippe/model.gltf");
|
|
145
145
|
// const mesh = Mesh.fromURL("moicon/ztest_object_many_pieces/model.gltf");
|
|
146
146
|
|
|
147
|
-
new
|
|
147
|
+
new Entity()
|
|
148
148
|
.add(Transform.fromJSON({
|
|
149
149
|
position: new Vector3(10, 0, 10)
|
|
150
150
|
}))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EngineHarness } from "../../../../EngineHarness.js";
|
|
2
2
|
import { ShadedGeometrySystem } from "../ShadedGeometrySystem.js";
|
|
3
|
-
import
|
|
3
|
+
import Entity from "../../../../ecs/Entity.js";
|
|
4
4
|
import { Transform } from "../../../../ecs/transform/Transform.js";
|
|
5
5
|
import { ShadedGeometry } from "../ShadedGeometry.js";
|
|
6
6
|
import { BoxBufferGeometry, MeshStandardMaterial, OctahedronGeometry } from "three";
|
|
@@ -9,7 +9,6 @@ import { seededRandom } from "../../../../../core/math/random/seededRandom.js";
|
|
|
9
9
|
import ViewportPosition from "../../../../ecs/gui/position/ViewportPosition.js";
|
|
10
10
|
import GUIElement from "../../../../ecs/gui/GUIElement.js";
|
|
11
11
|
import ButtonView from "../../../../../view/elements/button/ButtonView.js";
|
|
12
|
-
import { downloadAsFile } from "../../../../../core/binary/ByteArrayTools.js";
|
|
13
12
|
import { convert_bvh_to_dot_format_string } from "../../../../../core/bvh2/visual/convert_bvh_to_dot_format_string.js";
|
|
14
13
|
import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
|
|
15
14
|
import GUIElementSystem from "../../../../ecs/gui/GUIElementSystem.js";
|
|
@@ -21,6 +20,7 @@ import { BehaviorComponent } from "../../../../intelligence/behavior/ecs/Behavio
|
|
|
21
20
|
import { OrbitingBehavior } from "../../../../../../../model/game/util/behavior/OrbitingBehavior.js";
|
|
22
21
|
import { BehaviorSystem } from "../../../../intelligence/behavior/ecs/BehaviorSystem.js";
|
|
23
22
|
import Vector2 from "../../../../../core/geom/Vector2.js";
|
|
23
|
+
import {downloadAsFile} from "../../../../../core/binary/downloadAsFile.js";
|
|
24
24
|
|
|
25
25
|
const eh = new EngineHarness();
|
|
26
26
|
|
|
@@ -37,7 +37,7 @@ function makeMovingShadedGeometry() {
|
|
|
37
37
|
|
|
38
38
|
sg.draw_method = DRAW_METHOD_INSTANCED;
|
|
39
39
|
|
|
40
|
-
return new
|
|
40
|
+
return new Entity()
|
|
41
41
|
.add(new Transform())
|
|
42
42
|
.add(sg)
|
|
43
43
|
.add(BehaviorComponent.fromOne(b));
|
|
@@ -100,7 +100,7 @@ async function main(engine) {
|
|
|
100
100
|
// sg.draw_method = random() > 0.5 ? DRAW_METHOD_INSTANCED : 2;
|
|
101
101
|
sg.clearFlag(ShadedGeometryFlags.CastShadow | ShadedGeometryFlags.ReceiveShadow);
|
|
102
102
|
|
|
103
|
-
new
|
|
103
|
+
new Entity()
|
|
104
104
|
.add(Transform.fromJSON({
|
|
105
105
|
position: {
|
|
106
106
|
x: randomFloatBetween(random, 0, TERRAIN_SIZE),
|
|
@@ -143,7 +143,7 @@ function debug_button(engine, action, name = "Button", ecd = entityManager.datas
|
|
|
143
143
|
entityManager.addSystem(new GUIElementSystem(engine.gui.view, engine));
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
new
|
|
146
|
+
new Entity()
|
|
147
147
|
.add(ViewportPosition.fromJSON({}))
|
|
148
148
|
.add(GUIElement.fromView(new ButtonView({
|
|
149
149
|
action,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EngineHarness } from "../../../../EngineHarness.js";
|
|
2
2
|
import { ShadedGeometrySystem } from "../ShadedGeometrySystem.js";
|
|
3
|
-
import
|
|
3
|
+
import Entity from "../../../../ecs/Entity.js";
|
|
4
4
|
import { Transform } from "../../../../ecs/transform/Transform.js";
|
|
5
5
|
import { ShadedGeometry } from "../ShadedGeometry.js";
|
|
6
6
|
import {
|
|
@@ -15,7 +15,6 @@ import { seededRandom } from "../../../../../core/math/random/seededRandom.js";
|
|
|
15
15
|
import ViewportPosition from "../../../../ecs/gui/position/ViewportPosition.js";
|
|
16
16
|
import GUIElement from "../../../../ecs/gui/GUIElement.js";
|
|
17
17
|
import ButtonView from "../../../../../view/elements/button/ButtonView.js";
|
|
18
|
-
import { downloadAsFile } from "../../../../../core/binary/ByteArrayTools.js";
|
|
19
18
|
import { convert_bvh_to_dot_format_string } from "../../../../../core/bvh2/visual/convert_bvh_to_dot_format_string.js";
|
|
20
19
|
import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
|
|
21
20
|
import GUIElementSystem from "../../../../ecs/gui/GUIElementSystem.js";
|
|
@@ -33,6 +32,7 @@ import { MicronRenderContext } from "../../../micron/render/v1/MicronRenderConte
|
|
|
33
32
|
import { randomIntegerBetween } from "../../../../../core/math/random/randomIntegerBetween.js";
|
|
34
33
|
import Vector2 from "../../../../../core/geom/Vector2.js";
|
|
35
34
|
import { SurfacePoint3 } from "../../../../../core/geom/3d/SurfacePoint3.js";
|
|
35
|
+
import {downloadAsFile} from "../../../../../core/binary/downloadAsFile.js";
|
|
36
36
|
|
|
37
37
|
const eh = new EngineHarness();
|
|
38
38
|
|
|
@@ -49,7 +49,7 @@ function makeMovingShadedGeometry() {
|
|
|
49
49
|
|
|
50
50
|
sg.draw_method = DRAW_METHOD_INSTANCED;
|
|
51
51
|
|
|
52
|
-
return new
|
|
52
|
+
return new Entity()
|
|
53
53
|
.add(new Transform())
|
|
54
54
|
.add(sg)
|
|
55
55
|
.add(BehaviorComponent.fromOne(b));
|
|
@@ -118,7 +118,7 @@ async function main(engine) {
|
|
|
118
118
|
// sg.draw_method = random() > 0.01 ? DRAW_METHOD_INSTANCED : DRAW_METHOD_PLAIN;
|
|
119
119
|
sg.clearFlag(ShadedGeometryFlags.CastShadow | ShadedGeometryFlags.ReceiveShadow);
|
|
120
120
|
|
|
121
|
-
new
|
|
121
|
+
new Entity()
|
|
122
122
|
.add(Transform.fromJSON({
|
|
123
123
|
position: {
|
|
124
124
|
x: randomFloatBetween(random, 0, 20),
|
|
@@ -140,7 +140,7 @@ async function main(engine) {
|
|
|
140
140
|
|
|
141
141
|
}, 'save dot file');
|
|
142
142
|
|
|
143
|
-
const raycast_marker = new
|
|
143
|
+
const raycast_marker = new Entity()
|
|
144
144
|
.add(ShadedGeometry.from(new SphereBufferGeometry(1), new MeshBasicMaterial({
|
|
145
145
|
color: 0xFF0000
|
|
146
146
|
})))
|
|
@@ -196,7 +196,7 @@ function debug_button(engine, action, name = "Button", ecd = entityManager.datas
|
|
|
196
196
|
entityManager.addSystem(new GUIElementSystem(engine.gui.view, engine));
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
new
|
|
199
|
+
new Entity()
|
|
200
200
|
.add(ViewportPosition.fromJSON({}))
|
|
201
201
|
.add(GUIElement.fromView(new ButtonView({
|
|
202
202
|
action,
|
|
@@ -7,7 +7,7 @@ import Vector3 from "../../../../../core/geom/Vector3.js";
|
|
|
7
7
|
import Renderable from "../../../../ecs/renderable/Renderable.js";
|
|
8
8
|
import { RenderableFlags } from "../../../../ecs/renderable/RenderableFlags.js";
|
|
9
9
|
import { Transform } from "../../../../ecs/transform/Transform.js";
|
|
10
|
-
import
|
|
10
|
+
import Entity from "../../../../ecs/Entity.js";
|
|
11
11
|
import ThreeFactory from "../../../three/ThreeFactory.js";
|
|
12
12
|
import { EventType } from "../../../../ecs/EntityManager.js";
|
|
13
13
|
|
|
@@ -58,7 +58,7 @@ export class RibbonPathBuilder {
|
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
*
|
|
61
|
-
* @param {
|
|
61
|
+
* @param {Entity[]} destination
|
|
62
62
|
*/
|
|
63
63
|
build(destination) {
|
|
64
64
|
|
|
@@ -120,7 +120,7 @@ export class RibbonPathBuilder {
|
|
|
120
120
|
|
|
121
121
|
ribbon.computeBoundingBox(renderable.boundingBox);
|
|
122
122
|
|
|
123
|
-
const entityBuilder = new
|
|
123
|
+
const entityBuilder = new Entity()
|
|
124
124
|
.add(renderable)
|
|
125
125
|
.add(new Transform());
|
|
126
126
|
|
|
@@ -42,7 +42,7 @@ import { InverseKinematicsSystem } from "../../../ecs/ik/InverseKinematicsSystem
|
|
|
42
42
|
import { PathDisplaySystem } from "./PathDisplaySystem.js";
|
|
43
43
|
import { PathDisplay } from "./PathDisplay.js";
|
|
44
44
|
import { PathDisplayType } from "./PathDisplayType.js";
|
|
45
|
-
import
|
|
45
|
+
import Entity from "../../../ecs/Entity.js";
|
|
46
46
|
import { enableEditor } from "../../../../../editor/enableEditor.js";
|
|
47
47
|
import { GameAssetType } from "../../../asset/GameAssetType.js";
|
|
48
48
|
import { GLTFAssetLoader } from "../../../asset/loaders/GLTFAssetLoader.js";
|
|
@@ -385,7 +385,7 @@ function sample_style_tube() {
|
|
|
385
385
|
* @param {number[]} points
|
|
386
386
|
* @param {InterpolationType} [interp]
|
|
387
387
|
* @param {Vector3} [offset]
|
|
388
|
-
* @returns {
|
|
388
|
+
* @returns {Entity}
|
|
389
389
|
*/
|
|
390
390
|
function makePath({
|
|
391
391
|
points,
|
|
@@ -416,7 +416,7 @@ function makePath({
|
|
|
416
416
|
)
|
|
417
417
|
);
|
|
418
418
|
|
|
419
|
-
return new
|
|
419
|
+
return new Entity()
|
|
420
420
|
.add(_p)
|
|
421
421
|
.add(pathDisplay)
|
|
422
422
|
.add(Highlight.fromOne(0, 1, 1, 1));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BufferGeometry, MeshBasicMaterial, MeshMatcapMaterial, MeshStandardMaterial } from "three";
|
|
2
2
|
import { InterpolationType } from "../../../../../navigation/ecs/components/InterpolationType.js";
|
|
3
|
-
import
|
|
3
|
+
import Entity from "../../../../../ecs/Entity.js";
|
|
4
4
|
import { Transform } from "../../../../../ecs/transform/Transform.js";
|
|
5
5
|
import { TubeMaterialType } from "../TubeMaterialType.js";
|
|
6
6
|
import { GameAssetType } from "../../../../../asset/GameAssetType.js";
|
|
@@ -8,10 +8,10 @@ import { build_geometry_linear } from "./build_geometry_linear.js";
|
|
|
8
8
|
import { build_geometry_catmullrom } from "./build_geometry_catmullrom.js";
|
|
9
9
|
import { ShadedGeometry } from "../../../mesh-v2/ShadedGeometry.js";
|
|
10
10
|
import { ShadedGeometryFlags } from "../../../mesh-v2/ShadedGeometryFlags.js";
|
|
11
|
-
import { m3_rm_compose_transform } from "../../../../../../view/m3_rm_compose_transform.js";
|
|
12
11
|
import { fix_shape_normal_order } from "./fix_shape_normal_order.js";
|
|
13
12
|
import { compute_smooth_profile_normals } from "./compute_smooth_profile_normals.js";
|
|
14
13
|
import { assert } from "../../../../../../core/assert.js";
|
|
14
|
+
import { m3_rm_compose_transform } from "../../../../../../core/geom/mat3/m3_rm_compose_transform.js";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
@@ -127,7 +127,7 @@ export class TubePathBuilder {
|
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
*
|
|
130
|
-
* @param {
|
|
130
|
+
* @param {Entity[]} destination
|
|
131
131
|
*/
|
|
132
132
|
build(destination) {
|
|
133
133
|
const style = this.style;
|
|
@@ -185,7 +185,7 @@ export class TubePathBuilder {
|
|
|
185
185
|
segment_start, segment_end
|
|
186
186
|
);
|
|
187
187
|
|
|
188
|
-
const entityBuilder = new
|
|
188
|
+
const entityBuilder = new Entity();
|
|
189
189
|
|
|
190
190
|
entityBuilder.add(new Transform());
|
|
191
191
|
|
|
@@ -5,7 +5,7 @@ import { make_ring_vertices } from "./make_ring_vertices.js";
|
|
|
5
5
|
import { assert } from "../../../../../../core/assert.js";
|
|
6
6
|
import { make_ring_faces } from "./make_ring_faces.js";
|
|
7
7
|
import { append_compute_cap_geometry_size, make_cap } from "./make_cap.js";
|
|
8
|
-
import { v3_angle_cos_between } from "../../../../../../core/geom/v3_angle_between.js";
|
|
8
|
+
import { v3_angle_cos_between } from "../../../../../../core/geom/vec3/v3_angle_between.js";
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
const v4_array = new Float32Array(4);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Vector3 } from "three";
|
|
2
2
|
import { max2 } from "../../../../../../core/math/max2.js";
|
|
3
|
-
import { m3_rm_compose_transform } from "../../../../../../view/m3_rm_compose_transform.js";
|
|
4
|
-
import { m3_multiply } from "../../../../../../view/multiplyMatrices3.js";
|
|
5
3
|
import { make_ring_vertices } from "./make_ring_vertices.js";
|
|
6
4
|
import { make_ring_faces } from "./make_ring_faces.js";
|
|
7
5
|
import { v2_distance } from "../../../../../../core/geom/Vector2.js";
|
|
8
6
|
import { CapType } from "../CapType.js";
|
|
7
|
+
import { m3_rm_compose_transform } from "../../../../../../core/geom/mat3/m3_rm_compose_transform.js";
|
|
8
|
+
import { m3_multiply } from "../../../../../../core/geom/mat3/m3_multiply.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
*
|
|
@@ -116,7 +116,7 @@ function make_cap_round(
|
|
|
116
116
|
|
|
117
117
|
// build shape transform matrix that scales original shape down
|
|
118
118
|
m3_rm_compose_transform(m3, 0, 0, sin_b, sin_b, 0, 0, 0);
|
|
119
|
-
m3_multiply(m3,
|
|
119
|
+
m3_multiply(m3, m3, shape_transform);
|
|
120
120
|
|
|
121
121
|
const _d = radius;
|
|
122
122
|
|
|
@@ -67,7 +67,7 @@ import { RibbonPathStyle } from "../ribbon/RibbonPathStyle.js";
|
|
|
67
67
|
import { PathDisplay } from "../PathDisplay.js";
|
|
68
68
|
import { PathDisplaySpec } from "../PathDisplaySpec.js";
|
|
69
69
|
import { PathDisplayType } from "../PathDisplayType.js";
|
|
70
|
-
import
|
|
70
|
+
import Entity from "../../../../ecs/Entity.js";
|
|
71
71
|
import { BehaviorComponent } from "../../../../intelligence/behavior/ecs/BehaviorComponent.js";
|
|
72
72
|
import { pingpong } from "../../../../../core/math/pingpong.js";
|
|
73
73
|
import { PathEvents } from "../../../../navigation/ecs/components/PathEvents.js";
|
|
@@ -366,7 +366,7 @@ function main(engine) {
|
|
|
366
366
|
);
|
|
367
367
|
|
|
368
368
|
|
|
369
|
-
const path_entity = new
|
|
369
|
+
const path_entity = new Entity();
|
|
370
370
|
|
|
371
371
|
const ecd = engine.entityManager.dataset;
|
|
372
372
|
path_entity
|
|
@@ -375,7 +375,7 @@ function main(engine) {
|
|
|
375
375
|
.build(ecd);
|
|
376
376
|
|
|
377
377
|
let time = 0;
|
|
378
|
-
new
|
|
378
|
+
new Entity()
|
|
379
379
|
.add(BehaviorComponent.looping_function((delta) => {
|
|
380
380
|
time += delta*0.01;
|
|
381
381
|
tube_style.path_mask[1] = pingpong(time, 1);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ParticleEmitter } from "../../particles/particular/engine/emitter/ParticleEmitter.js";
|
|
2
2
|
import { ParticleLayer } from "../../particles/particular/engine/emitter/ParticleLayer.js";
|
|
3
|
-
import
|
|
3
|
+
import Entity from "../../../ecs/Entity.js";
|
|
4
4
|
import { Transform } from "../../../ecs/transform/Transform.js";
|
|
5
5
|
import { SerializationMetadata } from "../../../ecs/components/SerializationMetadata.js";
|
|
6
6
|
import { AbstractContextSystem } from "../../../ecs/system/AbstractContextSystem.js";
|
|
@@ -27,7 +27,7 @@ class Context extends SystemEntityContext {
|
|
|
27
27
|
|
|
28
28
|
this.__emitter.addLayer(this.__layer);
|
|
29
29
|
|
|
30
|
-
this.__emitter_entity = new
|
|
30
|
+
this.__emitter_entity = new Entity()
|
|
31
31
|
.add(this.__emitter)
|
|
32
32
|
.add(new Transform())
|
|
33
33
|
.add(SerializationMetadata.Transient);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EngineHarness } from "../../../EngineHarness.js";
|
|
2
2
|
import { SpriteSystemPE } from "./SpriteSystemPE.js";
|
|
3
3
|
import { ParticleEmitterSystem } from "../../particles/ecs/ParticleEmitterSystem.js";
|
|
4
|
-
import
|
|
4
|
+
import Entity from "../../../ecs/Entity.js";
|
|
5
5
|
import { Transform } from "../../../ecs/transform/Transform.js";
|
|
6
6
|
import { Sprite } from "./Sprite.js";
|
|
7
7
|
import { GizmoRenderingPlugin } from "../../render/gizmo/GizmoRenderingPlugin.js";
|
|
@@ -1545,7 +1545,7 @@ async function main(engine) {
|
|
|
1545
1545
|
|
|
1546
1546
|
sprites_used.add(sprite.url);
|
|
1547
1547
|
|
|
1548
|
-
new
|
|
1548
|
+
new Entity()
|
|
1549
1549
|
.add(Transform.fromJSON({
|
|
1550
1550
|
position: { x: 5 + 2 * i, y: 2, z: 5 + 2 * j }
|
|
1551
1551
|
}))
|
|
@@ -5,7 +5,6 @@ import { GetTexCoord } from "./GetTexCoord.js";
|
|
|
5
5
|
import { ORIENT_PRESERVING } from "./constants/ORIENT_PRESERVING.js";
|
|
6
6
|
import { NotZero } from "./NotZero.js";
|
|
7
7
|
import { fabsf } from "../../../../core/math/fabsf.js";
|
|
8
|
-
import { Length } from "./Length.js";
|
|
9
8
|
import { MARK_DEGENERATE } from "./constants/MARK_DEGENERATE.js";
|
|
10
9
|
import { CalcTexArea } from "./CalcTexArea.js";
|
|
11
10
|
import { BuildNeighborsFast } from "./BuildNeighborsFast.js";
|
|
@@ -70,9 +69,9 @@ export function InitTriInfo(pTriInfos, piTriListIn, pContext, iNrTrianglesIn) {
|
|
|
70
69
|
// initial values
|
|
71
70
|
const f3 = f * 3;
|
|
72
71
|
|
|
73
|
-
GetPosition(v1,0, pContext, piTriListIn[f3 + 0]);
|
|
74
|
-
GetPosition(v2,0, pContext, piTriListIn[f3 + 1]);
|
|
75
|
-
GetPosition(v3,0, pContext, piTriListIn[f3 + 2]);
|
|
72
|
+
GetPosition(v1, 0, pContext, piTriListIn[f3 + 0]);
|
|
73
|
+
GetPosition(v2, 0, pContext, piTriListIn[f3 + 1]);
|
|
74
|
+
GetPosition(v3, 0, pContext, piTriListIn[f3 + 2]);
|
|
76
75
|
|
|
77
76
|
GetTexCoord(t1, pContext, piTriListIn[f3 + 0]);
|
|
78
77
|
GetTexCoord(t2, pContext, piTriListIn[f3 + 1]);
|
|
@@ -105,8 +104,8 @@ export function InitTriInfo(pTriInfos, piTriListIn, pContext, iNrTrianglesIn) {
|
|
|
105
104
|
if (NotZero(fSignedAreaSTx2)) {
|
|
106
105
|
const fAbsArea = fabsf(fSignedAreaSTx2);
|
|
107
106
|
|
|
108
|
-
const fLenOs =
|
|
109
|
-
const fLenOt =
|
|
107
|
+
const fLenOs = vec3.length(vOs);
|
|
108
|
+
const fLenOt = vec3.length(vOt);
|
|
110
109
|
|
|
111
110
|
const fS = (tri_info.iFlag & ORIENT_PRESERVING) === 0 ? (-1.0) : 1.0;
|
|
112
111
|
|
|
@@ -8,7 +8,7 @@ import { InitTriInfo } from "./InitTriInfo.js";
|
|
|
8
8
|
import { GenerateTSpaces } from "./GenerateTSpaces.js";
|
|
9
9
|
import { DegenEpilogue } from "./DegenEpilogue.js";
|
|
10
10
|
import { Build4RuleGroups } from "./Build4RuleGroups.js";
|
|
11
|
-
import {
|
|
11
|
+
import { v3_allocate } from "../../../../core/geom/vec3/v3_allocate.js";
|
|
12
12
|
import { m_getNumFaces } from "./m_getNumFaces.js";
|
|
13
13
|
import { GenerateInitialVerticesIndexList } from "./GenerateInitialVerticesIndexList.js";
|
|
14
14
|
import { DegenPrologue } from "./DegenPrologue.js";
|
|
@@ -79,11 +79,11 @@ class STriInfo {
|
|
|
79
79
|
/**
|
|
80
80
|
* @type {vec3|Float32Array}
|
|
81
81
|
*/
|
|
82
|
-
this.vOs =
|
|
82
|
+
this.vOs = v3_allocate();
|
|
83
83
|
/**
|
|
84
84
|
* @type {vec3|Float32Array}
|
|
85
85
|
*/
|
|
86
|
-
this.vOt =
|
|
86
|
+
this.vOt = v3_allocate();
|
|
87
87
|
|
|
88
88
|
// original magnitudes
|
|
89
89
|
this.fMagS = 0;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Length } from "./Length.js";
|
|
2
1
|
import { vec3 } from "gl-matrix";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -8,7 +7,7 @@ import { vec3 } from "gl-matrix";
|
|
|
8
7
|
*/
|
|
9
8
|
export function NormalizeSafe(out, input) {
|
|
10
9
|
|
|
11
|
-
const len =
|
|
10
|
+
const len = vec3.length(input);
|
|
12
11
|
|
|
13
12
|
if (len !== 0) {
|
|
14
13
|
const m = 1 / len;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { vec3 } from "gl-matrix";
|
|
2
|
-
import {
|
|
2
|
+
import { v3_allocate } from "../../../../core/geom/vec3/v3_allocate.js";
|
|
3
3
|
|
|
4
4
|
export class STSpace {
|
|
5
5
|
constructor() {
|
|
@@ -7,12 +7,12 @@ export class STSpace {
|
|
|
7
7
|
*
|
|
8
8
|
* @type {vec3|Float32Array}
|
|
9
9
|
*/
|
|
10
|
-
this.vOs =
|
|
10
|
+
this.vOs = v3_allocate();
|
|
11
11
|
/**
|
|
12
12
|
*
|
|
13
13
|
* @type {vec3|Float32Array}
|
|
14
14
|
*/
|
|
15
|
-
this.vOt =
|
|
15
|
+
this.vOt = v3_allocate();
|
|
16
16
|
|
|
17
17
|
this.fMagS = 0;
|
|
18
18
|
this.fMagT = 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { vec3 } from "gl-matrix";
|
|
2
|
-
import { v3_length } from "../../../../core/geom/v3_length.js";
|
|
3
|
-
import { v3_dot } from "../../../../core/geom/v3_dot.js";
|
|
2
|
+
import { v3_length } from "../../../../core/geom/vec3/v3_length.js";
|
|
3
|
+
import { v3_dot } from "../../../../core/geom/vec3/v3_dot.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* executes following formula: v1 - v0*( dot(v0,v1) )
|
|
@@ -4,7 +4,7 @@ import { Vector3 as ThreeVector3 } from 'three';
|
|
|
4
4
|
import { rayTriangleIntersection } from "../../../../../core/geom/3d/triangle/rayTriangleIntersection.js";
|
|
5
5
|
import { SurfacePoint3 } from "../../../../../core/geom/3d/SurfacePoint3.js";
|
|
6
6
|
import { assert } from "../../../../../core/assert.js";
|
|
7
|
-
import { v3_length } from "../../../../../core/geom/v3_length.js";
|
|
7
|
+
import { v3_length } from "../../../../../core/geom/vec3/v3_length.js";
|
|
8
8
|
import { ray3_array_apply_matrix4 } from "../../../../../core/geom/3d/ray/ray3_array_apply_matrix4.js";
|
|
9
9
|
import { mat4 } from "gl-matrix";
|
|
10
10
|
import { ray3_array_compose } from "../../../../../core/geom/3d/ray/ray3_array_compose.js";
|
|
@@ -7,7 +7,7 @@ import { TextureAssetLoader } from "../../../../asset/loaders/texture/TextureAss
|
|
|
7
7
|
import Vector3 from "../../../../../core/geom/Vector3.js";
|
|
8
8
|
import Vector2 from "../../../../../core/geom/Vector2.js";
|
|
9
9
|
import { GLTFAssetLoader } from "../../../../asset/loaders/GLTFAssetLoader.js";
|
|
10
|
-
import
|
|
10
|
+
import Entity from "../../../../ecs/Entity.js";
|
|
11
11
|
import Renderable from "../../../../ecs/renderable/Renderable.js";
|
|
12
12
|
import { Transform } from "../../../../ecs/transform/Transform.js";
|
|
13
13
|
import { merge_geometry_hierarchy } from "./merge_geometry_hierarchy.js";
|
|
@@ -116,7 +116,7 @@ async function main(engine) {
|
|
|
116
116
|
whiteSpace: "pre"
|
|
117
117
|
};
|
|
118
118
|
|
|
119
|
-
new
|
|
119
|
+
new Entity()
|
|
120
120
|
.add(new Renderable(apply_random_coloring(optimized_hierarchy)))
|
|
121
121
|
.add(Transform.fromJSON({
|
|
122
122
|
position: new Vector3(128, 2, 128)
|
|
@@ -130,7 +130,7 @@ async function main(engine) {
|
|
|
130
130
|
})))
|
|
131
131
|
.build(engine.entityManager.dataset);
|
|
132
132
|
|
|
133
|
-
new
|
|
133
|
+
new Entity()
|
|
134
134
|
.add(new Renderable(apply_random_coloring(hierarchy)))
|
|
135
135
|
.add(Transform.fromJSON({
|
|
136
136
|
position: new Vector3(138, 2, 128)
|
|
@@ -145,7 +145,7 @@ async function main(engine) {
|
|
|
145
145
|
.build(engine.entityManager.dataset);
|
|
146
146
|
|
|
147
147
|
|
|
148
|
-
new
|
|
148
|
+
new Entity()
|
|
149
149
|
.add(new Renderable(optimized_hierarchy))
|
|
150
150
|
.add(Transform.fromJSON({
|
|
151
151
|
position: new Vector3(148, 2, 128)
|