@woosh/meep-engine 2.48.22 → 2.49.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/ecs/component/editors/three/BufferGeometryEditor.js +1 -1
- package/editor/ecs/component/editors/three/MeshEditor.js +1 -1
- package/editor/tools/GridPaintTool.js +1 -1
- package/editor/tools/SelectionTool.js +1 -1
- package/editor/tools/paint/TerrainPaintTool.js +1 -1
- package/editor/view/GridPickCoordinateView.js +1 -1
- package/editor/view/library/MeshLibraryView.js +1 -1
- package/package.json +1 -1
- package/src/core/UUID.js +2 -0
- package/src/core/assert.js +4 -1
- package/src/core/binary/32BitEncoder.js +1 -1
- package/src/core/binary/ctz32.js +1 -1
- package/src/core/binary/operations/bitCount.spec.js +19 -0
- package/src/core/binary/uint82float.spec.js +7 -0
- package/src/core/bvh2/LeafNode.js +2 -2
- package/src/core/bvh2/Node.d.ts +1 -1
- package/src/core/bvh2/Node.js +1 -1
- package/src/core/bvh2/NodeValidator.js +1 -1
- package/src/core/bvh2/bvh3/EBBVHLeafProxy.js +3 -0
- package/src/core/bvh2/bvh3/query/compute_tight_near_far_clipping_planes.js +5 -4
- package/src/core/bvh2/serialization/deserializeBinaryNode.js +1 -1
- package/src/core/bvh2/serialization/deserializeBinaryNodeFromBinaryBuffer.js +2 -2
- package/src/core/bvh2/serialization/serializeBinaryNode.js +1 -1
- package/src/core/bvh2/serialization/serializeBinaryNodeToBinaryBuffer.js +2 -2
- package/src/core/bvh2/transform/RotationOptimizer.spec.js +161 -155
- package/src/core/cache/Cache.js +4 -2
- package/src/core/codegen/LineBuilder.js +15 -3
- package/src/core/codegen/LineBuilder.spec.js +7 -0
- package/src/core/collection/HashMap.js +491 -236
- package/src/core/collection/HashMap.spec.js +110 -1
- package/src/core/collection/array/{typedArrayToDataType.js → typed/typedArrayToDataType.js} +1 -1
- package/src/core/collection/array/weightedRandomFromArray.spec.js +20 -0
- package/src/core/collection/heap/Uint32Heap.js +1 -0
- package/src/core/debug/matchers/AnyOf.js +1 -2
- package/src/core/events/signal/Signal.js +7 -5
- package/src/core/events/signal/SignalBinding.js +56 -54
- package/src/core/events/signal/SignalFlags.js +7 -0
- package/src/core/function/Functions.js +1 -1
- package/src/core/geom/{Rectangle.js → 2d/Rectangle.js} +5 -5
- package/src/core/geom/{AABB2.js → 2d/aabb/AABB2.js} +10 -78
- package/src/core/geom/2d/aabb/aabb2_compute_center_from_multiple.js +19 -0
- package/src/core/geom/2d/aabb/aabb2_compute_overlap.js +42 -0
- package/src/core/geom/2d/aabb/aabb2_contains.js +23 -0
- package/src/core/geom/2d/aabb/aabb2_distance_sqr_to_point.js +25 -0
- package/src/core/geom/2d/aabb/aabb2_distance_to_point.js +17 -0
- package/src/core/geom/2d/aabb/aabb2_distance_to_point.spec.js +17 -0
- package/src/core/geom/2d/aabb/aabb2_overlap_exists.js +18 -0
- package/src/core/geom/2d/aabb/aabb2_signed_distance_sqr_to_point.js +45 -0
- package/src/core/geom/2d/aabb/aabb2_signed_distance_sqr_to_point.spec.js +40 -0
- package/src/core/geom/2d/aabb/aabb2_signed_distance_to_point.js +27 -0
- package/src/core/geom/2d/convex-hull/fixed_convex_hull_humus.js +4 -0
- package/src/core/geom/2d/quad-tree/PointQuadTree.js +3 -0
- package/src/core/geom/2d/quad-tree/QuadTreeDatum.js +1 -1
- package/src/core/geom/2d/quad-tree/QuadTreeNode.js +3 -3
- package/src/core/geom/2d/quad-tree/qt_collect_by_circle.js +6 -8
- package/src/core/geom/2d/quad-tree/qt_match_data_by_circle.js +3 -3
- package/src/core/geom/2d/quad-tree/qt_query_data_nearest_to_point.js +8 -10
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/AABB3.d.ts +1 -1
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/AABB3.js +13 -13
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/AABB3.spec.js +1 -1
- package/src/core/geom/3d/aabb/aabb3_compute_plane_side.js +17 -15
- package/src/core/geom/3d/aabb/aabb3_compute_plane_side.spec.js +25 -0
- package/src/core/geom/3d/aabb/aabb3_detailed_volume_intersection.js +1 -1
- package/src/core/geom/3d/aabb/aabb3_from_v3_array.js +3 -0
- package/src/core/geom/3d/aabb/aabb3_from_v3_array.spec.js +32 -0
- package/src/core/geom/3d/aabb/aabb3_intersects_aabb3.spec.js +115 -0
- package/src/core/geom/3d/aabb/aabb3_raycast.js +6 -1
- package/src/core/geom/3d/aabb/aabb3_signed_distance_sqr_to_point.js +13 -9
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/serializeAABB3Encoded_v0.js +6 -6
- package/src/core/geom/3d/{CircleMath.js → compute_circle_bounding_box.js} +1 -1
- package/src/core/geom/3d/decompose_matrix_4_array.js +18 -19
- package/src/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.js +1 -1
- package/src/{engine/graphics/ecs/mesh-v2 → core/geom/3d/matrix}/allocate_transform_m4.js +1 -1
- package/src/core/geom/3d/normal/hemioct/decode_hemioct_to_unit.js +26 -0
- package/src/core/geom/3d/normal/hemioct/encode_unit3_hemioct.js +0 -26
- package/src/core/geom/3d/normal/hemioct/unit_hemioct.spec.js +2 -1
- package/src/core/geom/3d/plane/computePlaneLineIntersection.js +51 -0
- package/src/core/geom/3d/plane/computePlanePlaneIntersection.js +77 -0
- package/src/core/geom/3d/plane/computePlaneRayIntersection.js +55 -0
- package/src/core/geom/3d/plane/plane3_computeLineSegmentIntersection.js +50 -0
- package/src/core/geom/3d/plane/planeRayIntersection.js +14 -0
- package/src/core/geom/3d/{tetrahedra/in_sphere_fast.js → sphere/in_sphere3d_fast.js} +1 -1
- package/src/core/geom/3d/{tetrahedra/in_sphere_robust.js → sphere/in_sphere3d_robust.js} +1 -1
- package/src/core/geom/3d/sphere/sphere_array_intersects_point.js +2 -2
- package/src/core/geom/3d/sphere/{sphereIntersectsPoint.js → sphere_intersects_point.js} +7 -4
- package/src/core/geom/3d/sphere/sphere_intersects_point.spec.js +134 -0
- package/src/core/geom/3d/sphere/sphere_intersects_ray.spec.js +49 -0
- package/src/core/geom/3d/sphere/sphere_radius_sqr_from_v3_array_transformed.js +11 -7
- package/src/core/geom/3d/tetrahedra/delaunay/{debug_validate_mesh.js → debug/debug_validate_mesh.js} +1 -1
- package/src/core/geom/3d/tetrahedra/delaunay/{push_boundary_with_validation.js → debug/push_boundary_with_validation.js} +1 -1
- package/src/core/geom/3d/tetrahedra/delaunay/{validate_cavity_boundary.js → debug/validate_cavity_boundary.js} +2 -2
- package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_compute_cavity.js +2 -2
- package/src/core/geom/3d/triangle/computeTriangleRayIntersection.js +0 -164
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentric.js +87 -0
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentricEdge.js +81 -0
- package/src/core/geom/{GeometryMath.js → 3d/triangle/rayTriangleIntersection.js} +7 -3
- package/src/core/geom/ConicRay.js +160 -152
- package/src/core/geom/Matrix4.js +2 -0
- package/src/core/geom/Quaternion.js +19 -1
- package/src/core/geom/packing/max-rect/MaxRectangles.js +5 -215
- package/src/core/geom/packing/max-rect/cost/costByBestShortSide.js +11 -0
- package/src/core/geom/packing/max-rect/cost/costByRemainingArea.js +14 -0
- package/src/core/geom/packing/max-rect/cutArea.js +79 -0
- package/src/core/geom/packing/max-rect/findBestContainer.js +58 -0
- package/src/core/geom/packing/max-rect/packOneBox.js +49 -0
- package/src/core/geom/v3_dot.js +1 -1
- package/src/core/graph/GraphUtils.js +1 -1
- package/src/core/graph/build_face_graph_from_mesh.js +1 -3
- package/src/core/graph/layout/CircleLayout.js +3 -3
- package/src/core/graph/layout/{BoxLayouter.js → box/BoxLayouter.js} +6 -50
- package/src/core/graph/layout/box/applyCentralGravityAABB2.js +29 -0
- package/src/core/json/resolvePath.spec.js +14 -0
- package/src/core/land/reactive/{compiler/ReactiveCompiler.spec.js → compileReactiveExpression.spec.js} +17 -17
- package/src/core/math/random/MersenneTwister.spec.js +19 -0
- package/src/core/math/random/randomGaussian.spec.js +9 -0
- package/src/core/math/statistics/computeStatisticalMean.js +2 -2
- package/src/core/model/node-graph/visual/NodeVisualData.js +1 -1
- package/src/core/model/reactive/model/arithmetic/ReactiveAdd.js +1 -1
- package/src/core/model/reactive/model/arithmetic/ReactiveDivide.js +3 -1
- package/src/core/model/reactive/model/arithmetic/ReactiveMultiply.js +1 -1
- package/src/core/model/reactive/model/arithmetic/ReactiveNegate.js +3 -1
- package/src/core/model/reactive/model/arithmetic/ReactiveSubtract.js +1 -1
- package/src/core/model/reactive/model/comparative/ReactiveEquals.js +1 -1
- package/src/core/model/reactive/model/comparative/ReactiveGreaterThan.js +3 -1
- package/src/core/model/reactive/model/comparative/ReactiveGreaterThanOrEqual.js +3 -1
- package/src/core/model/reactive/model/comparative/ReactiveLessThan.js +3 -1
- package/src/core/model/reactive/model/comparative/ReactiveLessThanOrEqual.js +3 -1
- package/src/core/model/reactive/model/comparative/ReactiveNotEquals.js +1 -1
- package/src/core/model/reactive/model/logic/ReactiveAnd.js +1 -1
- package/src/core/model/reactive/model/logic/ReactiveNot.js +3 -1
- package/src/core/model/reactive/model/logic/ReactiveOr.js +1 -1
- package/src/core/primitives/numbers/computeHashFloat.spec.js +7 -0
- package/src/core/process/task/util/iteratorTask.js +3 -1
- package/src/engine/animation/curve/AnimationCurve.js +34 -5
- package/src/engine/animation/curve/AnimationCurve.spec.js +100 -0
- package/src/engine/asset/AssetTransformer.js +1 -0
- package/src/engine/asset/loaders/GLTFAssetLoader.js +1 -1
- package/src/engine/asset/loaders/image/ImageRGBADataLoader.js +2 -2
- package/src/engine/asset/preloader/Preloader.js +3 -3
- package/src/engine/computeStridedIntegerArrayHash.js +4 -2
- package/src/engine/ecs/components/Renderable.d.ts +2 -2
- package/src/engine/ecs/components/Renderable.js +1 -1
- package/src/{ecs → engine/ecs}/grid/pick.js +4 -4
- package/src/engine/ecs/gui/position/ViewportPositionSystem.js +1 -1
- package/src/engine/ecs/parent/entity_node_compute_bounding_box.js +1 -1
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionSerializer.js +1 -18
- package/src/engine/ecs/systems/MotionSystem.js +7 -1
- package/src/engine/ecs/systems/SynchronizePositionSystem.js +8 -2
- package/src/engine/ecs/terrain/tiles/TerrainTile.js +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTileManager.js +2 -2
- package/src/engine/ecs/tooltip/TooltipComponentSystem.js +1 -1
- package/src/engine/ecs/transform/Transform.js +1 -1
- package/src/engine/graphics/camera/makeScreenScissorFrustum.d.ts +1 -1
- package/src/engine/graphics/camera/makeScreenScissorFrustum.js +3 -3
- package/src/engine/graphics/camera/testClippingPlaneComputation.js +13 -13
- package/src/engine/graphics/ecs/camera/Camera.js +1 -1
- package/src/engine/graphics/ecs/light/LightSystem.js +1 -1
- package/src/engine/graphics/ecs/mesh/Mesh.d.ts +1 -1
- package/src/engine/graphics/ecs/mesh/Mesh.js +1 -1
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.d.ts +1 -1
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.js +1 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMesh.d.ts +1 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMesh.js +1 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshSystem.js +9 -0
- package/src/engine/graphics/ecs/mesh-v2/sg_hierarchy_compute_bounding_box_via_parent_entity.d.ts +1 -1
- package/src/engine/graphics/geometry/MikkT/MikkTSpace.js +1 -1
- package/src/engine/graphics/geometry/MikkT/STSpace.js +1 -1
- package/src/engine/graphics/geometry/bvh/buffered/BVHGeometryRaycaster.js +1 -1
- package/src/engine/graphics/geometry/skining/computeSkinnedMeshBoundingVolumes.js +1 -1
- package/src/engine/graphics/material/optimization/MaterialOptimizationContext.js +1 -1
- package/src/engine/graphics/particles/particular/engine/MovingBoundingBox.js +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleLayer.js +1 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.js +1 -0
- package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +1 -1
- package/src/engine/graphics/postprocess/threejs/postprocessing/TexturePass.js +2 -2
- package/src/engine/graphics/render/forward_plus/debug/createScreenGrid.js +1 -1
- package/src/engine/graphics/render/view/CameraView.js +1 -1
- package/src/engine/graphics/sh3/path_tracer/GeometryBVHBatched.js +2 -2
- package/src/engine/graphics/texture/atlas/AtlasPatch.js +2 -2
- package/src/engine/graphics/texture/atlas/TextureAtlas.spec.js +2 -2
- package/src/engine/graphics/texture/sampler/Sampler2D.js +1 -1
- package/src/engine/graphics/texture/sampler/sampler2d_compute_texel_value_conversion_scale_to_uint8.js +1 -1
- package/src/engine/graphics/util/makeMeshPreviewScene.js +1 -1
- package/src/engine/graphics/util/renderObjectToSampler2D.js +1 -1
- package/src/engine/intelligence/behavior/Behavior.spec.js +15 -0
- package/src/engine/intelligence/mcts/MoveEdge.js +1 -1
- package/src/engine/reference/v1/ReferenceManager.js +3 -0
- package/src/engine/reference/v2/Reference.js +33 -37
- package/src/engine/sound/sopra/README.md +6 -0
- package/src/engine/ui/tiles2d/computeTileGridMove.js +3 -2
- package/src/engine/ui/tiles2d/computeTileGridMove.spec.js +1 -1
- package/src/generation/automata/CaveGeneratorCellularAutomata.js +10 -7
- package/src/generation/automata/CaveGeneratorCellularAutomata.spec.js +12 -0
- package/src/generation/automata/CellularAutomata.js +5 -4
- package/src/generation/filtering/numeric/complex/CellFilterGaussianBlur.js +25 -9
- package/src/generation/theme/AreaMask.js +1 -1
- package/src/view/View.js +1 -1
- package/src/view/elements/progress/RectangularPieProgressView.js +1 -1
- package/src/view/minimap/Minimap.js +1 -1
- package/src/view/minimap/dom/MinimapCameraView.js +1 -1
- package/src/view/minimap/gl/MinimapFogOfWar.js +1 -1
- package/src/view/tooltip/DomTooltipObserver.js +1 -1
- package/src/view/tooltip/TooltipManager.js +1 -1
- package/src/view/tooltip/TooltipView.js +1 -1
- package/src/view/util/DomSizeObserver.js +2 -2
- package/src/core/geom/2d/AABB2Math.js +0 -40
- package/src/core/geom/2d/AABB2Math.spec.js +0 -17
- package/src/core/geom/Plane.js +0 -250
- package/src/core/land/reactive/ReactiveLexer.js +0 -158
- package/src/core/land/reactive/ReactiveLexer.ts +0 -181
- package/src/core/land/reactive/ReactiveListener.ts +0 -323
- package/src/core/land/reactive/ReactiveParser.js +0 -1573
- package/src/core/land/reactive/ReactiveParser.ts +0 -1776
- package/src/core/land/reactive/ReactiveVisitor.js +0 -1
- package/src/core/land/reactive/ReactiveVisitor.ts +0 -218
- package/src/core/land/reactive/compiler/ReactiveCompiler.js +0 -350
- package/src/core/land/reactive/compiler/ReactiveNearlyCompiler.js +0 -166
- package/src/core/land/reactive/compiler/ReactiveParser.js +0 -34
- package/src/core/land/reactive/nearley/ReactiveNearley.js +0 -187
- /package/src/core/geom/{LineSegment2.js → 2d/LineSegment2.js} +0 -0
- /package/src/core/geom/{Rectangle.spec.js → 2d/Rectangle.spec.js} +0 -0
- /package/src/core/geom/{AABB2.d.ts → 2d/aabb/AABB2.d.ts} +0 -0
- /package/src/core/geom/{AABB2.spec.js → 2d/aabb/AABB2.spec.js} +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/deserializeAABB3.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/deserializeAABB3Encoded_v0.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/deserializeAABB3Quantized16Uint.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/serializeAABB3.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/serializeAABB3Quantized16Uint.js +0 -0
- /package/src/{engine/graphics/ecs/mesh-v2 → core/geom/3d/vector}/allocate_v3.js +0 -0
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { max3 } from "../../math/max3.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param {number} x0
|
|
6
|
-
* @param {number} y0
|
|
7
|
-
* @param {number} x1
|
|
8
|
-
* @param {number} y1
|
|
9
|
-
* @param {number} px
|
|
10
|
-
* @param {number} py
|
|
11
|
-
* @returns {number}
|
|
12
|
-
*/
|
|
13
|
-
export function aabb2_distanceToPoint(x0, y0, x1, y1, px, py) {
|
|
14
|
-
const sqrD = aabb2_sqrDistanceToPoint(x0, y0, x1, y1, px, py);
|
|
15
|
-
return Math.sqrt(sqrD);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @param {number} x0
|
|
21
|
-
* @param {number} y0
|
|
22
|
-
* @param {number} x1
|
|
23
|
-
* @param {number} y1
|
|
24
|
-
* @param {number} px
|
|
25
|
-
* @param {number} py
|
|
26
|
-
* @returns {number}
|
|
27
|
-
*/
|
|
28
|
-
export function aabb2_sqrDistanceToPoint(x0, y0, x1, y1, px, py) {
|
|
29
|
-
|
|
30
|
-
const dxLeft = x0 - px;
|
|
31
|
-
const dxRight = px - x1;
|
|
32
|
-
|
|
33
|
-
const dyTop = y0 - py;
|
|
34
|
-
const dyBottom = py - y1;
|
|
35
|
-
|
|
36
|
-
var dx = max3(dxLeft, 0, dxRight);
|
|
37
|
-
var dy = max3(dyTop, 0, dyBottom);
|
|
38
|
-
|
|
39
|
-
return dx * dx + dy * dy;
|
|
40
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { aabb2_distanceToPoint } from "./AABB2Math.js";
|
|
2
|
-
|
|
3
|
-
test('aabb2_distanceToPoint', () => {
|
|
4
|
-
expect(aabb2_distanceToPoint(0, 0, 0, 0, 0, 0)).toBeCloseTo(0);
|
|
5
|
-
|
|
6
|
-
expect(aabb2_distanceToPoint(0, 0, 0, 0, 1, 0)).toBeCloseTo(1);
|
|
7
|
-
expect(aabb2_distanceToPoint(0, 0, 0, 0, 0, 1)).toBeCloseTo(1);
|
|
8
|
-
|
|
9
|
-
expect(aabb2_distanceToPoint(0, 0, 0, 0, 1, 1)).toBeCloseTo(1.41421356237);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
expect(aabb2_distanceToPoint(0, 0, 1, 1, 2, 0.5)).toBeCloseTo(1);
|
|
13
|
-
expect(aabb2_distanceToPoint(0, 0, 1, 1, 0.5, 2)).toBeCloseTo(1);
|
|
14
|
-
|
|
15
|
-
expect(aabb2_distanceToPoint(0, 0, 1, 1, -1, 0.5)).toBeCloseTo(1);
|
|
16
|
-
expect(aabb2_distanceToPoint(0, 0, 1, 1, 0.5, -1)).toBeCloseTo(1);
|
|
17
|
-
});
|
package/src/core/geom/Plane.js
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by Alex on 20/02/2017.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { v3_dot } from "./v3_dot.js";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
Algorithm taken from http://geomalgorithms.com/a05-_intersect-1.html. See the
|
|
11
|
-
section 'Intersection of 2 Planes' and specifically the subsection
|
|
12
|
-
(A) Direct Linear Equation
|
|
13
|
-
@param {Plane} p1
|
|
14
|
-
@param {Plane} p2
|
|
15
|
-
@param {Vector3} point
|
|
16
|
-
@param {Vector3} direction
|
|
17
|
-
@returns {boolean}
|
|
18
|
-
*/
|
|
19
|
-
export function computePlanePlaneIntersection(p1, p2, point, direction) {
|
|
20
|
-
|
|
21
|
-
// the cross product gives us the direction of the line at the intersection
|
|
22
|
-
// of the two planes, and gives us an easy way to check if the two planes
|
|
23
|
-
// are parallel - the cross product will have zero magnitude
|
|
24
|
-
|
|
25
|
-
direction.crossVectors(p1.normal, p2.normal);
|
|
26
|
-
|
|
27
|
-
const magnitude = direction.lengthSqr();
|
|
28
|
-
|
|
29
|
-
if (magnitude === 0) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// now find a point on the intersection. We use the 'Direct Linear Equation'
|
|
34
|
-
// method described in the linked page, and we choose which coordinate
|
|
35
|
-
// to set as zero by seeing which has the largest absolute value in the
|
|
36
|
-
// directional vector
|
|
37
|
-
|
|
38
|
-
const X = Math.abs(direction.x);
|
|
39
|
-
const Y = Math.abs(direction.y);
|
|
40
|
-
const Z = Math.abs(direction.z);
|
|
41
|
-
|
|
42
|
-
if (Z >= X && Z >= Y) {
|
|
43
|
-
solveIntersectingPoint('z', 'x', 'y', p1, p2, point);
|
|
44
|
-
} else if (Y >= Z && Y >= X) {
|
|
45
|
-
solveIntersectingPoint('y', 'z', 'x', p1, p2, point);
|
|
46
|
-
} else {
|
|
47
|
-
solveIntersectingPoint('x', 'y', 'z', p1, p2, point);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
*
|
|
55
|
-
* @param {Vector3} out Result will be written here
|
|
56
|
-
* @param {Vector3} origin Ray origin
|
|
57
|
-
* @param {Vector3} direction Ray direction
|
|
58
|
-
* @param {Vector3} normal Plane normal
|
|
59
|
-
* @param {number} dist Plane distance
|
|
60
|
-
* @returns {boolean} true if intersection is found, false otherwise
|
|
61
|
-
*/
|
|
62
|
-
export function planeRayIntersection(out, origin, direction, normal, dist) {
|
|
63
|
-
return computePlaneRayIntersection(out, origin.x, origin.y, origin.z, direction.x, direction.y, direction.z, normal.x, normal.y, normal.z, dist)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
*
|
|
68
|
-
* @param {Vector3} out Result will be written here
|
|
69
|
-
* @param {number} originX Ray origin
|
|
70
|
-
* @param {number} originY Ray origin
|
|
71
|
-
* @param {number} originZ Ray origin
|
|
72
|
-
* @param {number} directionX Ray direction
|
|
73
|
-
* @param {number} directionY Ray direction
|
|
74
|
-
* @param {number} directionZ Ray direction
|
|
75
|
-
* @param {number} normalX Plane normal
|
|
76
|
-
* @param {number} normalY Plane normal
|
|
77
|
-
* @param {number} normalZ Plane normal
|
|
78
|
-
* @param {number} dist Plane distance
|
|
79
|
-
* @returns {boolean} true if intersection is found, false otherwise
|
|
80
|
-
*/
|
|
81
|
-
export function computePlaneRayIntersection(out, originX, originY, originZ, directionX, directionY, directionZ, normalX, normalY, normalZ, dist) {
|
|
82
|
-
const denom = v3_dot(directionX, directionY, directionZ, normalX, normalY, normalZ);
|
|
83
|
-
|
|
84
|
-
const p = v3_dot(normalX, normalY, normalZ, originX, originY, originZ) + dist;
|
|
85
|
-
|
|
86
|
-
if (denom !== 0) {
|
|
87
|
-
|
|
88
|
-
const t = -p / denom;
|
|
89
|
-
|
|
90
|
-
if (t < 0) {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
out.set(
|
|
95
|
-
directionX * t + originX,
|
|
96
|
-
directionY * t + originY,
|
|
97
|
-
directionZ * t + originZ
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
return true;
|
|
101
|
-
|
|
102
|
-
} else {
|
|
103
|
-
|
|
104
|
-
if (p === 0) {
|
|
105
|
-
|
|
106
|
-
out.set(originX, originY, originZ);
|
|
107
|
-
|
|
108
|
-
return true;
|
|
109
|
-
|
|
110
|
-
} else {
|
|
111
|
-
|
|
112
|
-
//no intersection
|
|
113
|
-
return false;
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
*
|
|
122
|
-
* @param {Vector3} out Result will be written here
|
|
123
|
-
* @param {number} originX Ray origin
|
|
124
|
-
* @param {number} originY Ray origin
|
|
125
|
-
* @param {number} originZ Ray origin
|
|
126
|
-
* @param {number} directionX Ray direction
|
|
127
|
-
* @param {number} directionY Ray direction
|
|
128
|
-
* @param {number} directionZ Ray direction
|
|
129
|
-
* @param {number} normalX Plane normal
|
|
130
|
-
* @param {number} normalY Plane normal
|
|
131
|
-
* @param {number} normalZ Plane normal
|
|
132
|
-
* @param {number} dist Plane distance
|
|
133
|
-
* @returns {boolean} true if intersection is found, false otherwise
|
|
134
|
-
*/
|
|
135
|
-
export function computePlaneLineIntersection(out, originX, originY, originZ, directionX, directionY, directionZ, normalX, normalY, normalZ, dist) {
|
|
136
|
-
const denom = v3_dot(directionX, directionY, directionZ, normalX, normalY, normalZ);
|
|
137
|
-
|
|
138
|
-
const p = v3_dot(normalX, normalY, normalZ, originX, originY, originZ) + dist;
|
|
139
|
-
|
|
140
|
-
if (denom !== 0) {
|
|
141
|
-
|
|
142
|
-
const t = -p / denom;
|
|
143
|
-
|
|
144
|
-
out.set(
|
|
145
|
-
directionX * t + originX,
|
|
146
|
-
directionY * t + originY,
|
|
147
|
-
directionZ * t + originZ
|
|
148
|
-
);
|
|
149
|
-
|
|
150
|
-
return true;
|
|
151
|
-
|
|
152
|
-
} else {
|
|
153
|
-
|
|
154
|
-
if (p === 0) {
|
|
155
|
-
|
|
156
|
-
out.set(originX, originY, originZ);
|
|
157
|
-
|
|
158
|
-
return true;
|
|
159
|
-
|
|
160
|
-
} else {
|
|
161
|
-
|
|
162
|
-
//no intersection
|
|
163
|
-
return false;
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
*
|
|
172
|
-
* @param {Float32Array|number[]|vec3} result
|
|
173
|
-
* @param {number} result_offset
|
|
174
|
-
* @param {number} x0
|
|
175
|
-
* @param {number} y0
|
|
176
|
-
* @param {number} z0
|
|
177
|
-
* @param {number} x1
|
|
178
|
-
* @param {number} y1
|
|
179
|
-
* @param {number} z1
|
|
180
|
-
* @param {number} normalX
|
|
181
|
-
* @param {number} normalY
|
|
182
|
-
* @param {number} normalZ
|
|
183
|
-
* @param {number} dist
|
|
184
|
-
* @returns {boolean}
|
|
185
|
-
*/
|
|
186
|
-
export function plane3_computeLineSegmentIntersection(
|
|
187
|
-
result, result_offset,
|
|
188
|
-
x0, y0, z0,
|
|
189
|
-
x1, y1, z1,
|
|
190
|
-
normalX, normalY, normalZ, dist
|
|
191
|
-
) {
|
|
192
|
-
|
|
193
|
-
const directionX = x1 - x0;
|
|
194
|
-
const directionY = y1 - y0;
|
|
195
|
-
const directionZ = z1 - z0;
|
|
196
|
-
|
|
197
|
-
const denom = v3_dot(directionX, directionY, directionZ, normalX, normalY, normalZ);
|
|
198
|
-
|
|
199
|
-
if (denom === 0) {
|
|
200
|
-
return false;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const p = v3_dot(normalX, normalY, normalZ, x0, y0, z0) + dist;
|
|
204
|
-
|
|
205
|
-
const t = -p / denom;
|
|
206
|
-
|
|
207
|
-
if (t < 0 || t > 1) {
|
|
208
|
-
return false;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
result[result_offset] = directionX * t + x0;
|
|
212
|
-
result[result_offset + 1] = directionY * t + y0;
|
|
213
|
-
result[result_offset + 2] = directionZ * t + z0;
|
|
214
|
-
|
|
215
|
-
return true;
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
|
|
221
|
-
This method helps finding a point on the intersection between two planes.
|
|
222
|
-
Depending on the orientation of the planes, the problem could solve for the
|
|
223
|
-
zero point on either the x, y or z axis
|
|
224
|
-
* @param {string} zeroCoord
|
|
225
|
-
* @param {string} A
|
|
226
|
-
* @param {string} B
|
|
227
|
-
* @param {THREE.Plane} p1
|
|
228
|
-
* @param {THREE.Plane} p2
|
|
229
|
-
* @param {Vector3} result
|
|
230
|
-
*/
|
|
231
|
-
function solveIntersectingPoint(zeroCoord, A, B, p1, p2, result) {
|
|
232
|
-
const nP1 = p1.normal;
|
|
233
|
-
|
|
234
|
-
const a1 = nP1[A];
|
|
235
|
-
const b1 = nP1[B];
|
|
236
|
-
const d1 = p1.constant;
|
|
237
|
-
|
|
238
|
-
const nP2 = p2.normal;
|
|
239
|
-
|
|
240
|
-
const a2 = nP2[A];
|
|
241
|
-
const b2 = nP2[B];
|
|
242
|
-
const d2 = p2.constant;
|
|
243
|
-
|
|
244
|
-
const A0 = ((b2 * d1) - (b1 * d2)) / ((a1 * b2 - a2 * b1));
|
|
245
|
-
const B0 = ((a1 * d2) - (a2 * d1)) / ((a1 * b2 - a2 * b1));
|
|
246
|
-
|
|
247
|
-
result[zeroCoord] = 0;
|
|
248
|
-
result[A] = A0;
|
|
249
|
-
result[B] = B0;
|
|
250
|
-
}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
// Generated from app/src/lang/Reactive.g4 by ANTLR 4.6-SNAPSHOT
|
|
2
|
-
import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer";
|
|
3
|
-
import { LexerATNSimulator } from "antlr4ts/atn/LexerATNSimulator";
|
|
4
|
-
import { Lexer } from "antlr4ts/Lexer";
|
|
5
|
-
import * as Utils from "antlr4ts/misc/Utils";
|
|
6
|
-
import { VocabularyImpl } from "antlr4ts/VocabularyImpl";
|
|
7
|
-
|
|
8
|
-
export class ReactiveLexer extends Lexer {
|
|
9
|
-
// tslint:enable:no-trailing-whitespace
|
|
10
|
-
constructor(input) {
|
|
11
|
-
super(input);
|
|
12
|
-
this._interp = new LexerATNSimulator(ReactiveLexer._ATN, this);
|
|
13
|
-
}
|
|
14
|
-
// @Override
|
|
15
|
-
// @NotNull
|
|
16
|
-
get vocabulary() {
|
|
17
|
-
return ReactiveLexer.VOCABULARY;
|
|
18
|
-
}
|
|
19
|
-
// @Override
|
|
20
|
-
get grammarFileName() {
|
|
21
|
-
return "Reactive.g4";
|
|
22
|
-
}
|
|
23
|
-
// @Override
|
|
24
|
-
get ruleNames() {
|
|
25
|
-
return ReactiveLexer.ruleNames;
|
|
26
|
-
}
|
|
27
|
-
// @Override
|
|
28
|
-
get serializedATN() {
|
|
29
|
-
return ReactiveLexer._serializedATN;
|
|
30
|
-
}
|
|
31
|
-
// @Override
|
|
32
|
-
get modeNames() {
|
|
33
|
-
return ReactiveLexer.modeNames;
|
|
34
|
-
}
|
|
35
|
-
static get _ATN() {
|
|
36
|
-
if (!ReactiveLexer.__ATN) {
|
|
37
|
-
ReactiveLexer.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(ReactiveLexer._serializedATN));
|
|
38
|
-
}
|
|
39
|
-
return ReactiveLexer.__ATN;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
ReactiveLexer.T__0 = 1;
|
|
43
|
-
ReactiveLexer.T__1 = 2;
|
|
44
|
-
ReactiveLexer.T__2 = 3;
|
|
45
|
-
ReactiveLexer.Identifier = 4;
|
|
46
|
-
ReactiveLexer.NonzeroDigit = 5;
|
|
47
|
-
ReactiveLexer.DigitSequence = 6;
|
|
48
|
-
ReactiveLexer.FractionalConstant = 7;
|
|
49
|
-
ReactiveLexer.ExponentPart = 8;
|
|
50
|
-
ReactiveLexer.PLUS = 9;
|
|
51
|
-
ReactiveLexer.MINUS = 10;
|
|
52
|
-
ReactiveLexer.MULTIPLY = 11;
|
|
53
|
-
ReactiveLexer.DIVIDE = 12;
|
|
54
|
-
ReactiveLexer.NOT = 13;
|
|
55
|
-
ReactiveLexer.GT = 14;
|
|
56
|
-
ReactiveLexer.GTE = 15;
|
|
57
|
-
ReactiveLexer.LT = 16;
|
|
58
|
-
ReactiveLexer.LTE = 17;
|
|
59
|
-
ReactiveLexer.EQUALS = 18;
|
|
60
|
-
ReactiveLexer.NOT_EQUALS = 19;
|
|
61
|
-
ReactiveLexer.AND = 20;
|
|
62
|
-
ReactiveLexer.OR = 21;
|
|
63
|
-
ReactiveLexer.DOT = 22;
|
|
64
|
-
ReactiveLexer.OPEN_BRACKET = 23;
|
|
65
|
-
ReactiveLexer.CLOSED_BRACKET = 24;
|
|
66
|
-
ReactiveLexer.Whitespace = 25;
|
|
67
|
-
// tslint:disable:no-trailing-whitespace
|
|
68
|
-
ReactiveLexer.modeNames = [
|
|
69
|
-
"DEFAULT_MODE",
|
|
70
|
-
];
|
|
71
|
-
ReactiveLexer.ruleNames = [
|
|
72
|
-
"T__0", "T__1", "T__2", "Identifier", "IdentifierNondigit", "Nondigit",
|
|
73
|
-
"Digit", "NonzeroDigit", "DigitSequence", "FractionalConstant", "Sign",
|
|
74
|
-
"ExponentPart", "PLUS", "MINUS", "MULTIPLY", "DIVIDE", "NOT", "GT", "GTE",
|
|
75
|
-
"LT", "LTE", "EQUALS", "NOT_EQUALS", "AND", "OR", "DOT", "OPEN_BRACKET",
|
|
76
|
-
"CLOSED_BRACKET", "Whitespace",
|
|
77
|
-
];
|
|
78
|
-
ReactiveLexer._LITERAL_NAMES = [
|
|
79
|
-
undefined, "'0'", "'true'", "'false'", undefined, undefined, undefined,
|
|
80
|
-
undefined, undefined, "'+'", "'-'", "'*'", "'/'", "'!'", "'>'", "'>='",
|
|
81
|
-
"'<'", "'<='", "'=='", "'!='", "'&&'", "'||'", "'.'", "'('", "')'",
|
|
82
|
-
];
|
|
83
|
-
ReactiveLexer._SYMBOLIC_NAMES = [
|
|
84
|
-
undefined, undefined, undefined, undefined, "Identifier", "NonzeroDigit",
|
|
85
|
-
"DigitSequence", "FractionalConstant", "ExponentPart", "PLUS", "MINUS",
|
|
86
|
-
"MULTIPLY", "DIVIDE", "NOT", "GT", "GTE", "LT", "LTE", "EQUALS", "NOT_EQUALS",
|
|
87
|
-
"AND", "OR", "DOT", "OPEN_BRACKET", "CLOSED_BRACKET", "Whitespace",
|
|
88
|
-
];
|
|
89
|
-
ReactiveLexer.VOCABULARY = new VocabularyImpl(ReactiveLexer._LITERAL_NAMES, ReactiveLexer._SYMBOLIC_NAMES, []);
|
|
90
|
-
ReactiveLexer._serializedATN = "\x03\uAF6F\u8320\u479D\uB75C\u4880\u1605\u191C\uAB37\x02\x1B\xA4\b\x01" +
|
|
91
|
-
"\x04\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06" +
|
|
92
|
-
"\x04\x07\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r" +
|
|
93
|
-
"\t\r\x04\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t" +
|
|
94
|
-
"\x12\x04\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t" +
|
|
95
|
-
"\x17\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t" +
|
|
96
|
-
"\x1C\x04\x1D\t\x1D\x04\x1E\t\x1E\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03" +
|
|
97
|
-
"\x03\x03\x03\x03\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x05" +
|
|
98
|
-
"\x03\x05\x03\x05\x07\x05N\n\x05\f\x05\x0E\x05Q\v\x05\x03\x06\x03\x06\x03" +
|
|
99
|
-
"\x07\x03\x07\x03\b\x03\b\x03\t\x03\t\x03\n\x06\n\\\n\n\r\n\x0E\n]\x03" +
|
|
100
|
-
"\v\x05\va\n\v\x03\v\x03\v\x03\v\x03\v\x03\v\x05\vh\n\v\x03\f\x03\f\x03" +
|
|
101
|
-
"\r\x03\r\x05\rn\n\r\x03\r\x03\r\x03\r\x05\rs\n\r\x03\r\x05\rv\n\r\x03" +
|
|
102
|
-
"\x0E\x03\x0E\x03\x0F\x03\x0F\x03\x10\x03\x10\x03\x11\x03\x11\x03\x12\x03" +
|
|
103
|
-
"\x12\x03\x13\x03\x13\x03\x14\x03\x14\x03\x14\x03\x15\x03\x15\x03\x16\x03" +
|
|
104
|
-
"\x16\x03\x16\x03\x17\x03\x17\x03\x17\x03\x18\x03\x18\x03\x18\x03\x19\x03" +
|
|
105
|
-
"\x19\x03\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x03" +
|
|
106
|
-
"\x1D\x03\x1D\x03\x1E\x06\x1E\x9F\n\x1E\r\x1E\x0E\x1E\xA0\x03\x1E\x03\x1E" +
|
|
107
|
-
"\x02\x02\x02\x1F\x03\x02\x03\x05\x02\x04\x07\x02\x05\t\x02\x06\v\x02\x02" +
|
|
108
|
-
"\r\x02\x02\x0F\x02\x02\x11\x02\x07\x13\x02\b\x15\x02\t\x17\x02\x02\x19" +
|
|
109
|
-
"\x02\n\x1B\x02\v\x1D\x02\f\x1F\x02\r!\x02\x0E#\x02\x0F%\x02\x10\'\x02" +
|
|
110
|
-
"\x11)\x02\x12+\x02\x13-\x02\x14/\x02\x151\x02\x163\x02\x175\x02\x187\x02" +
|
|
111
|
-
"\x199\x02\x1A;\x02\x1B\x03\x02\x07\x05\x02C\\aac|\x03\x022;\x03\x023;" +
|
|
112
|
-
"\x04\x02--//\x05\x02\v\f\x0E\x0F\"\"\xA8\x02\x03\x03\x02\x02\x02\x02\x05" +
|
|
113
|
-
"\x03\x02\x02\x02\x02\x07\x03\x02\x02\x02\x02\t\x03\x02\x02\x02\x02\x11" +
|
|
114
|
-
"\x03\x02\x02\x02\x02\x13\x03\x02\x02\x02\x02\x15\x03\x02\x02\x02\x02\x19" +
|
|
115
|
-
"\x03\x02\x02\x02\x02\x1B\x03\x02\x02\x02\x02\x1D\x03\x02\x02\x02\x02\x1F" +
|
|
116
|
-
"\x03\x02\x02\x02\x02!\x03\x02\x02\x02\x02#\x03\x02\x02\x02\x02%\x03\x02" +
|
|
117
|
-
"\x02\x02\x02\'\x03\x02\x02\x02\x02)\x03\x02\x02\x02\x02+\x03\x02\x02\x02" +
|
|
118
|
-
"\x02-\x03\x02\x02\x02\x02/\x03\x02\x02\x02\x021\x03\x02\x02\x02\x023\x03" +
|
|
119
|
-
"\x02\x02\x02\x025\x03\x02\x02\x02\x027\x03\x02\x02\x02\x029\x03\x02\x02" +
|
|
120
|
-
"\x02\x02;\x03\x02\x02\x02\x03=\x03\x02\x02\x02\x05?\x03\x02\x02\x02\x07" +
|
|
121
|
-
"D\x03\x02\x02\x02\tJ\x03\x02\x02\x02\vR\x03\x02\x02\x02\rT\x03\x02\x02" +
|
|
122
|
-
"\x02\x0FV\x03\x02\x02\x02\x11X\x03\x02\x02\x02\x13[\x03\x02\x02\x02\x15" +
|
|
123
|
-
"g\x03\x02\x02\x02\x17i\x03\x02\x02\x02\x19u\x03\x02\x02\x02\x1Bw\x03\x02" +
|
|
124
|
-
"\x02\x02\x1Dy\x03\x02\x02\x02\x1F{\x03\x02\x02\x02!}\x03\x02\x02\x02#" +
|
|
125
|
-
"\x7F\x03\x02\x02\x02%\x81\x03\x02\x02\x02\'\x83\x03\x02\x02\x02)\x86\x03" +
|
|
126
|
-
"\x02\x02\x02+\x88\x03\x02\x02\x02-\x8B\x03\x02\x02\x02/\x8E\x03\x02\x02" +
|
|
127
|
-
"\x021\x91\x03\x02\x02\x023\x94\x03\x02\x02\x025\x97\x03\x02\x02\x027\x99" +
|
|
128
|
-
"\x03\x02\x02\x029\x9B\x03\x02\x02\x02;\x9E\x03\x02\x02\x02=>\x072\x02" +
|
|
129
|
-
"\x02>\x04\x03\x02\x02\x02?@\x07v\x02\x02@A\x07t\x02\x02AB\x07w\x02\x02" +
|
|
130
|
-
"BC\x07g\x02\x02C\x06\x03\x02\x02\x02DE\x07h\x02\x02EF\x07c\x02\x02FG\x07" +
|
|
131
|
-
"n\x02\x02GH\x07u\x02\x02HI\x07g\x02\x02I\b\x03\x02\x02\x02JO\x05\r\x07" +
|
|
132
|
-
"\x02KN\x05\r\x07\x02LN\x05\x0F\b\x02MK\x03\x02\x02\x02ML\x03\x02\x02\x02" +
|
|
133
|
-
"NQ\x03\x02\x02\x02OM\x03\x02\x02\x02OP\x03\x02\x02\x02P\n\x03\x02\x02" +
|
|
134
|
-
"\x02QO\x03\x02\x02\x02RS\x05\r\x07\x02S\f\x03\x02\x02\x02TU\t\x02\x02" +
|
|
135
|
-
"\x02U\x0E\x03\x02\x02\x02VW\t\x03\x02\x02W\x10\x03\x02\x02\x02XY\t\x04" +
|
|
136
|
-
"\x02\x02Y\x12\x03\x02\x02\x02Z\\\x05\x0F\b\x02[Z\x03\x02\x02\x02\\]\x03" +
|
|
137
|
-
"\x02\x02\x02][\x03\x02\x02\x02]^\x03\x02\x02\x02^\x14\x03\x02\x02\x02" +
|
|
138
|
-
"_a\x05\x13\n\x02`_\x03\x02\x02\x02`a\x03\x02\x02\x02ab\x03\x02\x02\x02" +
|
|
139
|
-
"bc\x070\x02\x02ch\x05\x13\n\x02de\x05\x13\n\x02ef\x070\x02\x02fh\x03\x02" +
|
|
140
|
-
"\x02\x02g`\x03\x02\x02\x02gd\x03\x02\x02\x02h\x16\x03\x02\x02\x02ij\t" +
|
|
141
|
-
"\x05\x02\x02j\x18\x03\x02\x02\x02km\x07g\x02\x02ln\x05\x17\f\x02ml\x03" +
|
|
142
|
-
"\x02\x02\x02mn\x03\x02\x02\x02no\x03\x02\x02\x02ov\x05\x13\n\x02pr\x07" +
|
|
143
|
-
"G\x02\x02qs\x05\x17\f\x02rq\x03\x02\x02\x02rs\x03\x02\x02\x02st\x03\x02" +
|
|
144
|
-
"\x02\x02tv\x05\x13\n\x02uk\x03\x02\x02\x02up\x03\x02\x02\x02v\x1A\x03" +
|
|
145
|
-
"\x02\x02\x02wx\x07-\x02\x02x\x1C\x03\x02\x02\x02yz\x07/\x02\x02z\x1E\x03" +
|
|
146
|
-
"\x02\x02\x02{|\x07,\x02\x02| \x03\x02\x02\x02}~\x071\x02\x02~\"\x03\x02" +
|
|
147
|
-
"\x02\x02\x7F\x80\x07#\x02\x02\x80$\x03\x02\x02\x02\x81\x82\x07@\x02\x02" +
|
|
148
|
-
"\x82&\x03\x02\x02\x02\x83\x84\x07@\x02\x02\x84\x85\x07?\x02\x02\x85(\x03" +
|
|
149
|
-
"\x02\x02\x02\x86\x87\x07>\x02\x02\x87*\x03\x02\x02\x02\x88\x89\x07>\x02" +
|
|
150
|
-
"\x02\x89\x8A\x07?\x02\x02\x8A,\x03\x02\x02\x02\x8B\x8C\x07?\x02\x02\x8C" +
|
|
151
|
-
"\x8D\x07?\x02\x02\x8D.\x03\x02\x02\x02\x8E\x8F\x07#\x02\x02\x8F\x90\x07" +
|
|
152
|
-
"?\x02\x02\x900\x03\x02\x02\x02\x91\x92\x07(\x02\x02\x92\x93\x07(\x02\x02" +
|
|
153
|
-
"\x932\x03\x02\x02\x02\x94\x95\x07~\x02\x02\x95\x96\x07~\x02\x02\x964\x03" +
|
|
154
|
-
"\x02\x02\x02\x97\x98\x070\x02\x02\x986\x03\x02\x02\x02\x99\x9A\x07*\x02" +
|
|
155
|
-
"\x02\x9A8\x03\x02\x02\x02\x9B\x9C\x07+\x02\x02\x9C:\x03\x02\x02\x02\x9D" +
|
|
156
|
-
"\x9F\t\x06\x02\x02\x9E\x9D\x03\x02\x02\x02\x9F\xA0\x03\x02\x02\x02\xA0" +
|
|
157
|
-
"\x9E\x03\x02\x02\x02\xA0\xA1\x03\x02\x02\x02\xA1\xA2\x03\x02\x02\x02\xA2" +
|
|
158
|
-
"\xA3\b\x1E\x02\x02\xA3<\x03\x02\x02\x02\f\x02MO]`gmru\xA0\x03\b\x02\x02";
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
// Generated from app/src/lang/Reactive.g4 by ANTLR 4.6-SNAPSHOT
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {ATN} from "antlr4ts/atn/ATN";
|
|
5
|
-
import {ATNDeserializer} from "antlr4ts/atn/ATNDeserializer";
|
|
6
|
-
import {CharStream} from "antlr4ts/CharStream";
|
|
7
|
-
import {Lexer} from "antlr4ts/Lexer";
|
|
8
|
-
import {LexerATNSimulator} from "antlr4ts/atn/LexerATNSimulator";
|
|
9
|
-
import {Vocabulary} from "antlr4ts/Vocabulary";
|
|
10
|
-
import {VocabularyImpl} from "antlr4ts/VocabularyImpl";
|
|
11
|
-
|
|
12
|
-
import * as Utils from "antlr4ts/misc/Utils";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export class ReactiveLexer extends Lexer {
|
|
16
|
-
public static readonly T__0 = 1;
|
|
17
|
-
public static readonly T__1 = 2;
|
|
18
|
-
public static readonly T__2 = 3;
|
|
19
|
-
public static readonly Identifier = 4;
|
|
20
|
-
public static readonly NonzeroDigit = 5;
|
|
21
|
-
public static readonly DigitSequence = 6;
|
|
22
|
-
public static readonly FractionalConstant = 7;
|
|
23
|
-
public static readonly ExponentPart = 8;
|
|
24
|
-
public static readonly PLUS = 9;
|
|
25
|
-
public static readonly MINUS = 10;
|
|
26
|
-
public static readonly MULTIPLY = 11;
|
|
27
|
-
public static readonly DIVIDE = 12;
|
|
28
|
-
public static readonly NOT = 13;
|
|
29
|
-
public static readonly GT = 14;
|
|
30
|
-
public static readonly GTE = 15;
|
|
31
|
-
public static readonly LT = 16;
|
|
32
|
-
public static readonly LTE = 17;
|
|
33
|
-
public static readonly EQUALS = 18;
|
|
34
|
-
public static readonly NOT_EQUALS = 19;
|
|
35
|
-
public static readonly AND = 20;
|
|
36
|
-
public static readonly OR = 21;
|
|
37
|
-
public static readonly DOT = 22;
|
|
38
|
-
public static readonly OPEN_BRACKET = 23;
|
|
39
|
-
public static readonly CLOSED_BRACKET = 24;
|
|
40
|
-
public static readonly Whitespace = 25;
|
|
41
|
-
// tslint:disable:no-trailing-whitespace
|
|
42
|
-
public static readonly modeNames: string[] = [
|
|
43
|
-
"DEFAULT_MODE",
|
|
44
|
-
];
|
|
45
|
-
|
|
46
|
-
public static readonly ruleNames: string[] = [
|
|
47
|
-
"T__0", "T__1", "T__2", "Identifier", "IdentifierNondigit", "Nondigit",
|
|
48
|
-
"Digit", "NonzeroDigit", "DigitSequence", "FractionalConstant", "Sign",
|
|
49
|
-
"ExponentPart", "PLUS", "MINUS", "MULTIPLY", "DIVIDE", "NOT", "GT", "GTE",
|
|
50
|
-
"LT", "LTE", "EQUALS", "NOT_EQUALS", "AND", "OR", "DOT", "OPEN_BRACKET",
|
|
51
|
-
"CLOSED_BRACKET", "Whitespace",
|
|
52
|
-
];
|
|
53
|
-
|
|
54
|
-
private static readonly _LITERAL_NAMES: Array<string | undefined> = [
|
|
55
|
-
undefined, "'0'", "'true'", "'false'", undefined, undefined, undefined,
|
|
56
|
-
undefined, undefined, "'+'", "'-'", "'*'", "'/'", "'!'", "'>'", "'>='",
|
|
57
|
-
"'<'", "'<='", "'=='", "'!='", "'&&'", "'||'", "'.'", "'('", "')'",
|
|
58
|
-
];
|
|
59
|
-
private static readonly _SYMBOLIC_NAMES: Array<string | undefined> = [
|
|
60
|
-
undefined, undefined, undefined, undefined, "Identifier", "NonzeroDigit",
|
|
61
|
-
"DigitSequence", "FractionalConstant", "ExponentPart", "PLUS", "MINUS",
|
|
62
|
-
"MULTIPLY", "DIVIDE", "NOT", "GT", "GTE", "LT", "LTE", "EQUALS", "NOT_EQUALS",
|
|
63
|
-
"AND", "OR", "DOT", "OPEN_BRACKET", "CLOSED_BRACKET", "Whitespace",
|
|
64
|
-
];
|
|
65
|
-
public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(ReactiveLexer._LITERAL_NAMES, ReactiveLexer._SYMBOLIC_NAMES, []);
|
|
66
|
-
|
|
67
|
-
// @Override
|
|
68
|
-
// @NotNull
|
|
69
|
-
public get vocabulary(): Vocabulary {
|
|
70
|
-
return ReactiveLexer.VOCABULARY;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// tslint:enable:no-trailing-whitespace
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
constructor(input: CharStream) {
|
|
77
|
-
super(input);
|
|
78
|
-
this._interp = new LexerATNSimulator(ReactiveLexer._ATN, this);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// @Override
|
|
82
|
-
public get grammarFileName(): string {
|
|
83
|
-
return "Reactive.g4";
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// @Override
|
|
87
|
-
public get ruleNames(): string[] {
|
|
88
|
-
return ReactiveLexer.ruleNames;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// @Override
|
|
92
|
-
public get serializedATN(): string {
|
|
93
|
-
return ReactiveLexer._serializedATN;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// @Override
|
|
97
|
-
public get modeNames(): string[] {
|
|
98
|
-
return ReactiveLexer.modeNames;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
public static readonly _serializedATN: string =
|
|
102
|
-
"\x03\uAF6F\u8320\u479D\uB75C\u4880\u1605\u191C\uAB37\x02\x1B\xA4\b\x01" +
|
|
103
|
-
"\x04\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06" +
|
|
104
|
-
"\x04\x07\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r" +
|
|
105
|
-
"\t\r\x04\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t" +
|
|
106
|
-
"\x12\x04\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t" +
|
|
107
|
-
"\x17\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t" +
|
|
108
|
-
"\x1C\x04\x1D\t\x1D\x04\x1E\t\x1E\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03" +
|
|
109
|
-
"\x03\x03\x03\x03\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x05" +
|
|
110
|
-
"\x03\x05\x03\x05\x07\x05N\n\x05\f\x05\x0E\x05Q\v\x05\x03\x06\x03\x06\x03" +
|
|
111
|
-
"\x07\x03\x07\x03\b\x03\b\x03\t\x03\t\x03\n\x06\n\\\n\n\r\n\x0E\n]\x03" +
|
|
112
|
-
"\v\x05\va\n\v\x03\v\x03\v\x03\v\x03\v\x03\v\x05\vh\n\v\x03\f\x03\f\x03" +
|
|
113
|
-
"\r\x03\r\x05\rn\n\r\x03\r\x03\r\x03\r\x05\rs\n\r\x03\r\x05\rv\n\r\x03" +
|
|
114
|
-
"\x0E\x03\x0E\x03\x0F\x03\x0F\x03\x10\x03\x10\x03\x11\x03\x11\x03\x12\x03" +
|
|
115
|
-
"\x12\x03\x13\x03\x13\x03\x14\x03\x14\x03\x14\x03\x15\x03\x15\x03\x16\x03" +
|
|
116
|
-
"\x16\x03\x16\x03\x17\x03\x17\x03\x17\x03\x18\x03\x18\x03\x18\x03\x19\x03" +
|
|
117
|
-
"\x19\x03\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x03" +
|
|
118
|
-
"\x1D\x03\x1D\x03\x1E\x06\x1E\x9F\n\x1E\r\x1E\x0E\x1E\xA0\x03\x1E\x03\x1E" +
|
|
119
|
-
"\x02\x02\x02\x1F\x03\x02\x03\x05\x02\x04\x07\x02\x05\t\x02\x06\v\x02\x02" +
|
|
120
|
-
"\r\x02\x02\x0F\x02\x02\x11\x02\x07\x13\x02\b\x15\x02\t\x17\x02\x02\x19" +
|
|
121
|
-
"\x02\n\x1B\x02\v\x1D\x02\f\x1F\x02\r!\x02\x0E#\x02\x0F%\x02\x10\'\x02" +
|
|
122
|
-
"\x11)\x02\x12+\x02\x13-\x02\x14/\x02\x151\x02\x163\x02\x175\x02\x187\x02" +
|
|
123
|
-
"\x199\x02\x1A;\x02\x1B\x03\x02\x07\x05\x02C\\aac|\x03\x022;\x03\x023;" +
|
|
124
|
-
"\x04\x02--//\x05\x02\v\f\x0E\x0F\"\"\xA8\x02\x03\x03\x02\x02\x02\x02\x05" +
|
|
125
|
-
"\x03\x02\x02\x02\x02\x07\x03\x02\x02\x02\x02\t\x03\x02\x02\x02\x02\x11" +
|
|
126
|
-
"\x03\x02\x02\x02\x02\x13\x03\x02\x02\x02\x02\x15\x03\x02\x02\x02\x02\x19" +
|
|
127
|
-
"\x03\x02\x02\x02\x02\x1B\x03\x02\x02\x02\x02\x1D\x03\x02\x02\x02\x02\x1F" +
|
|
128
|
-
"\x03\x02\x02\x02\x02!\x03\x02\x02\x02\x02#\x03\x02\x02\x02\x02%\x03\x02" +
|
|
129
|
-
"\x02\x02\x02\'\x03\x02\x02\x02\x02)\x03\x02\x02\x02\x02+\x03\x02\x02\x02" +
|
|
130
|
-
"\x02-\x03\x02\x02\x02\x02/\x03\x02\x02\x02\x021\x03\x02\x02\x02\x023\x03" +
|
|
131
|
-
"\x02\x02\x02\x025\x03\x02\x02\x02\x027\x03\x02\x02\x02\x029\x03\x02\x02" +
|
|
132
|
-
"\x02\x02;\x03\x02\x02\x02\x03=\x03\x02\x02\x02\x05?\x03\x02\x02\x02\x07" +
|
|
133
|
-
"D\x03\x02\x02\x02\tJ\x03\x02\x02\x02\vR\x03\x02\x02\x02\rT\x03\x02\x02" +
|
|
134
|
-
"\x02\x0FV\x03\x02\x02\x02\x11X\x03\x02\x02\x02\x13[\x03\x02\x02\x02\x15" +
|
|
135
|
-
"g\x03\x02\x02\x02\x17i\x03\x02\x02\x02\x19u\x03\x02\x02\x02\x1Bw\x03\x02" +
|
|
136
|
-
"\x02\x02\x1Dy\x03\x02\x02\x02\x1F{\x03\x02\x02\x02!}\x03\x02\x02\x02#" +
|
|
137
|
-
"\x7F\x03\x02\x02\x02%\x81\x03\x02\x02\x02\'\x83\x03\x02\x02\x02)\x86\x03" +
|
|
138
|
-
"\x02\x02\x02+\x88\x03\x02\x02\x02-\x8B\x03\x02\x02\x02/\x8E\x03\x02\x02" +
|
|
139
|
-
"\x021\x91\x03\x02\x02\x023\x94\x03\x02\x02\x025\x97\x03\x02\x02\x027\x99" +
|
|
140
|
-
"\x03\x02\x02\x029\x9B\x03\x02\x02\x02;\x9E\x03\x02\x02\x02=>\x072\x02" +
|
|
141
|
-
"\x02>\x04\x03\x02\x02\x02?@\x07v\x02\x02@A\x07t\x02\x02AB\x07w\x02\x02" +
|
|
142
|
-
"BC\x07g\x02\x02C\x06\x03\x02\x02\x02DE\x07h\x02\x02EF\x07c\x02\x02FG\x07" +
|
|
143
|
-
"n\x02\x02GH\x07u\x02\x02HI\x07g\x02\x02I\b\x03\x02\x02\x02JO\x05\r\x07" +
|
|
144
|
-
"\x02KN\x05\r\x07\x02LN\x05\x0F\b\x02MK\x03\x02\x02\x02ML\x03\x02\x02\x02" +
|
|
145
|
-
"NQ\x03\x02\x02\x02OM\x03\x02\x02\x02OP\x03\x02\x02\x02P\n\x03\x02\x02" +
|
|
146
|
-
"\x02QO\x03\x02\x02\x02RS\x05\r\x07\x02S\f\x03\x02\x02\x02TU\t\x02\x02" +
|
|
147
|
-
"\x02U\x0E\x03\x02\x02\x02VW\t\x03\x02\x02W\x10\x03\x02\x02\x02XY\t\x04" +
|
|
148
|
-
"\x02\x02Y\x12\x03\x02\x02\x02Z\\\x05\x0F\b\x02[Z\x03\x02\x02\x02\\]\x03" +
|
|
149
|
-
"\x02\x02\x02][\x03\x02\x02\x02]^\x03\x02\x02\x02^\x14\x03\x02\x02\x02" +
|
|
150
|
-
"_a\x05\x13\n\x02`_\x03\x02\x02\x02`a\x03\x02\x02\x02ab\x03\x02\x02\x02" +
|
|
151
|
-
"bc\x070\x02\x02ch\x05\x13\n\x02de\x05\x13\n\x02ef\x070\x02\x02fh\x03\x02" +
|
|
152
|
-
"\x02\x02g`\x03\x02\x02\x02gd\x03\x02\x02\x02h\x16\x03\x02\x02\x02ij\t" +
|
|
153
|
-
"\x05\x02\x02j\x18\x03\x02\x02\x02km\x07g\x02\x02ln\x05\x17\f\x02ml\x03" +
|
|
154
|
-
"\x02\x02\x02mn\x03\x02\x02\x02no\x03\x02\x02\x02ov\x05\x13\n\x02pr\x07" +
|
|
155
|
-
"G\x02\x02qs\x05\x17\f\x02rq\x03\x02\x02\x02rs\x03\x02\x02\x02st\x03\x02" +
|
|
156
|
-
"\x02\x02tv\x05\x13\n\x02uk\x03\x02\x02\x02up\x03\x02\x02\x02v\x1A\x03" +
|
|
157
|
-
"\x02\x02\x02wx\x07-\x02\x02x\x1C\x03\x02\x02\x02yz\x07/\x02\x02z\x1E\x03" +
|
|
158
|
-
"\x02\x02\x02{|\x07,\x02\x02| \x03\x02\x02\x02}~\x071\x02\x02~\"\x03\x02" +
|
|
159
|
-
"\x02\x02\x7F\x80\x07#\x02\x02\x80$\x03\x02\x02\x02\x81\x82\x07@\x02\x02" +
|
|
160
|
-
"\x82&\x03\x02\x02\x02\x83\x84\x07@\x02\x02\x84\x85\x07?\x02\x02\x85(\x03" +
|
|
161
|
-
"\x02\x02\x02\x86\x87\x07>\x02\x02\x87*\x03\x02\x02\x02\x88\x89\x07>\x02" +
|
|
162
|
-
"\x02\x89\x8A\x07?\x02\x02\x8A,\x03\x02\x02\x02\x8B\x8C\x07?\x02\x02\x8C" +
|
|
163
|
-
"\x8D\x07?\x02\x02\x8D.\x03\x02\x02\x02\x8E\x8F\x07#\x02\x02\x8F\x90\x07" +
|
|
164
|
-
"?\x02\x02\x900\x03\x02\x02\x02\x91\x92\x07(\x02\x02\x92\x93\x07(\x02\x02" +
|
|
165
|
-
"\x932\x03\x02\x02\x02\x94\x95\x07~\x02\x02\x95\x96\x07~\x02\x02\x964\x03" +
|
|
166
|
-
"\x02\x02\x02\x97\x98\x070\x02\x02\x986\x03\x02\x02\x02\x99\x9A\x07*\x02" +
|
|
167
|
-
"\x02\x9A8\x03\x02\x02\x02\x9B\x9C\x07+\x02\x02\x9C:\x03\x02\x02\x02\x9D" +
|
|
168
|
-
"\x9F\t\x06\x02\x02\x9E\x9D\x03\x02\x02\x02\x9F\xA0\x03\x02\x02\x02\xA0" +
|
|
169
|
-
"\x9E\x03\x02\x02\x02\xA0\xA1\x03\x02\x02\x02\xA1\xA2\x03\x02\x02\x02\xA2" +
|
|
170
|
-
"\xA3\b\x1E\x02\x02\xA3<\x03\x02\x02\x02\f\x02MO]`gmru\xA0\x03\b\x02\x02";
|
|
171
|
-
public static __ATN: ATN;
|
|
172
|
-
public static get _ATN(): ATN {
|
|
173
|
-
if (!ReactiveLexer.__ATN) {
|
|
174
|
-
ReactiveLexer.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(ReactiveLexer._serializedATN));
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return ReactiveLexer.__ATN;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
|