@openglobus/og 0.19.3 → 0.20.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/README.md +3 -3
- package/css/og.css +18 -4
- package/lib/@openglobus/js/Clock.d.ts +106 -0
- package/lib/@openglobus/js/Deferred.d.ts +6 -0
- package/lib/@openglobus/js/Events.d.ts +90 -0
- package/lib/@openglobus/js/Extent.d.ts +145 -0
- package/lib/@openglobus/js/Globe.d.ts +134 -0
- package/lib/@openglobus/js/ImageCanvas.d.ts +128 -0
- package/lib/@openglobus/js/Lock.d.ts +15 -0
- package/lib/@openglobus/js/LonLat.d.ts +128 -0
- package/lib/@openglobus/js/Object3d.d.ts +64 -0
- package/lib/@openglobus/js/Popup.d.ts +46 -0
- package/lib/@openglobus/js/QueueArray.d.ts +16 -0
- package/lib/@openglobus/js/Rectangle.d.ts +76 -0
- package/lib/@openglobus/js/Stack.d.ts +20 -0
- package/lib/@openglobus/js/astro/astro.d.ts +39 -0
- package/lib/@openglobus/js/astro/earth.d.ts +8 -0
- package/lib/@openglobus/js/astro/jd.d.ts +234 -0
- package/lib/@openglobus/js/astro/orbit.d.ts +5 -0
- package/lib/@openglobus/js/astro/rotation.d.ts +2 -0
- package/lib/@openglobus/js/bv/Box.d.ts +32 -0
- package/lib/@openglobus/js/bv/Sphere.d.ts +37 -0
- package/lib/@openglobus/js/bv/index.d.ts +3 -0
- package/lib/@openglobus/js/camera/Camera.d.ts +314 -0
- package/lib/@openglobus/js/camera/Frustum.d.ts +139 -0
- package/lib/@openglobus/js/camera/PlanetCamera.d.ts +234 -0
- package/lib/@openglobus/js/camera/index.d.ts +3 -0
- package/lib/@openglobus/js/cons.d.ts +40 -0
- package/lib/@openglobus/js/control/Atmosphere.d.ts +16 -0
- package/lib/@openglobus/js/control/CompassButton.d.ts +16 -0
- package/lib/@openglobus/js/control/Control.d.ts +100 -0
- package/lib/@openglobus/js/control/DebugInfo.d.ts +25 -0
- package/lib/@openglobus/js/control/DrawingSwitcher.d.ts +13 -0
- package/lib/@openglobus/js/control/EarthCoordinates.d.ts +41 -0
- package/lib/@openglobus/js/control/EarthNavigation.d.ts +50 -0
- package/lib/@openglobus/js/control/GeoImageDragControl.d.ts +22 -0
- package/lib/@openglobus/js/control/KeyboardNavigation.d.ts +28 -0
- package/lib/@openglobus/js/control/LayerAnimation.d.ts +71 -0
- package/lib/@openglobus/js/control/LayerSwitcher.d.ts +36 -0
- package/lib/@openglobus/js/control/Lighting.d.ts +53 -0
- package/lib/@openglobus/js/control/MouseNavigation.d.ts +64 -0
- package/lib/@openglobus/js/control/MouseWheelZoomControl.d.ts +44 -0
- package/lib/@openglobus/js/control/RulerSwitcher.d.ts +17 -0
- package/lib/@openglobus/js/control/ScaleControl.d.ts +24 -0
- package/lib/@openglobus/js/control/SegmentBoundVisualization.d.ts +12 -0
- package/lib/@openglobus/js/control/ShowFps.d.ts +9 -0
- package/lib/@openglobus/js/control/SimpleNavigation.d.ts +25 -0
- package/lib/@openglobus/js/control/SimpleSkyBackground.d.ts +17 -0
- package/lib/@openglobus/js/control/Sun.d.ts +33 -0
- package/lib/@openglobus/js/control/ToggleWireframe.d.ts +14 -0
- package/lib/@openglobus/js/control/TouchNavigation.d.ts +52 -0
- package/lib/@openglobus/js/control/ZoomControl.d.ts +27 -0
- package/lib/@openglobus/js/control/drawing/DrawingControl.d.ts +12 -0
- package/lib/@openglobus/js/control/drawing/LineStringDrawingScene.d.ts +15 -0
- package/lib/@openglobus/js/control/drawing/PolygonDrawingScene.d.ts +98 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfile.d.ts +77 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileButtonsView.d.ts +14 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileControl.d.ts +33 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileLegend.d.ts +20 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileScene.d.ts +80 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileView.d.ts +63 -0
- package/lib/@openglobus/js/control/elevationProfile/PointListDialog.d.ts +12 -0
- package/lib/@openglobus/js/control/heightRuler/HeightRuler.d.ts +7 -0
- package/lib/@openglobus/js/control/heightRuler/HeightRulerScene.d.ts +35 -0
- package/lib/@openglobus/js/control/heightRuler/HeightRulerSwitcher.d.ts +6 -0
- package/lib/@openglobus/js/control/index.d.ts +29 -0
- package/lib/@openglobus/js/control/ruler/Ruler.d.ts +13 -0
- package/lib/@openglobus/js/control/ruler/RulerScene.d.ts +88 -0
- package/lib/@openglobus/js/control/selection/Selection.d.ts +55 -0
- package/lib/@openglobus/js/control/selection/SelectionScene.d.ts +44 -0
- package/lib/@openglobus/js/control/timeline/TimelineControl.d.ts +18 -0
- package/lib/@openglobus/js/control/timeline/TimelineModel.d.ts +41 -0
- package/lib/@openglobus/js/control/timeline/TimelineView.d.ts +85 -0
- package/lib/@openglobus/js/control/timeline/timelineUtils.d.ts +12 -0
- package/lib/@openglobus/js/control/visibleExtent/drawnode.d.ts +7 -0
- package/lib/@openglobus/js/ellipsoid/Ellipsoid.d.ts +193 -0
- package/lib/@openglobus/js/ellipsoid/index.d.ts +3 -0
- package/lib/@openglobus/js/ellipsoid/wgs84.d.ts +6 -0
- package/lib/@openglobus/js/entity/BaseBillboard.d.ts +222 -0
- package/lib/@openglobus/js/entity/BaseBillboardHandler.d.ts +81 -0
- package/lib/@openglobus/js/entity/Billboard.d.ts +113 -0
- package/lib/@openglobus/js/entity/BillboardHandler.d.ts +15 -0
- package/lib/@openglobus/js/entity/Entity.d.ts +354 -0
- package/lib/@openglobus/js/entity/EntityCollection.d.ts +363 -0
- package/lib/@openglobus/js/entity/GeoObject.d.ts +152 -0
- package/lib/@openglobus/js/entity/GeoObjectHandler.d.ts +104 -0
- package/lib/@openglobus/js/entity/Geometry.d.ts +124 -0
- package/lib/@openglobus/js/entity/GeometryHandler.d.ts +84 -0
- package/lib/@openglobus/js/entity/Label.d.ts +214 -0
- package/lib/@openglobus/js/entity/LabelHandler.d.ts +65 -0
- package/lib/@openglobus/js/entity/LabelWorker.d.ts +15 -0
- package/lib/@openglobus/js/entity/PointCloud.d.ts +179 -0
- package/lib/@openglobus/js/entity/PointCloudHandler.d.ts +42 -0
- package/lib/@openglobus/js/entity/Polyline.d.ts +345 -0
- package/lib/@openglobus/js/entity/PolylineHandler.d.ts +22 -0
- package/lib/@openglobus/js/entity/Ray.d.ts +133 -0
- package/lib/@openglobus/js/entity/RayHandler.d.ts +70 -0
- package/lib/@openglobus/js/entity/Strip.d.ts +139 -0
- package/lib/@openglobus/js/entity/StripHandler.d.ts +42 -0
- package/lib/@openglobus/js/entity/index.d.ts +10 -0
- package/lib/@openglobus/js/index.d.ts +33 -0
- package/lib/@openglobus/js/input/KeyboardHandler.d.ts +33 -0
- package/lib/@openglobus/js/input/MouseHandler.d.ts +16 -0
- package/lib/@openglobus/js/input/TouchHandler.d.ts +11 -0
- package/lib/@openglobus/js/input/input.d.ts +3 -0
- package/lib/@openglobus/js/layer/BaseGeoImage.d.ts +145 -0
- package/lib/@openglobus/js/layer/Bing.d.ts +4 -0
- package/lib/@openglobus/js/layer/CanvasTiles.d.ts +103 -0
- package/lib/@openglobus/js/layer/GeoImage.d.ts +61 -0
- package/lib/@openglobus/js/layer/GeoTexture2d.d.ts +17 -0
- package/lib/@openglobus/js/layer/GeoVideo.d.ts +68 -0
- package/lib/@openglobus/js/layer/KML.d.ts +72 -0
- package/lib/@openglobus/js/layer/Layer.d.ts +415 -0
- package/lib/@openglobus/js/layer/Material.d.ts +34 -0
- package/lib/@openglobus/js/layer/OpenStreetMap.d.ts +4 -0
- package/lib/@openglobus/js/layer/Vector.d.ts +246 -0
- package/lib/@openglobus/js/layer/WMS.d.ts +75 -0
- package/lib/@openglobus/js/layer/XYZ.d.ts +148 -0
- package/lib/@openglobus/js/layer/index.d.ts +12 -0
- package/lib/@openglobus/js/light/LightSource.d.ts +174 -0
- package/lib/@openglobus/js/math/Line2.d.ts +11 -0
- package/lib/@openglobus/js/math/Line3.d.ts +28 -0
- package/lib/@openglobus/js/math/Mat3.d.ts +77 -0
- package/lib/@openglobus/js/math/Mat4.d.ts +195 -0
- package/lib/@openglobus/js/math/Plane.d.ts +20 -0
- package/lib/@openglobus/js/math/Quat.d.ts +373 -0
- package/lib/@openglobus/js/math/Ray.d.ts +76 -0
- package/lib/@openglobus/js/math/Vec2.d.ts +310 -0
- package/lib/@openglobus/js/math/Vec3.d.ts +472 -0
- package/lib/@openglobus/js/math/Vec4.d.ts +163 -0
- package/lib/@openglobus/js/math/coder.d.ts +51 -0
- package/lib/@openglobus/js/math/index.d.ts +11 -0
- package/lib/@openglobus/js/math.d.ts +266 -0
- package/lib/@openglobus/js/mercator.d.ts +92 -0
- package/lib/@openglobus/js/proj/EPSG3857.d.ts +9 -0
- package/lib/@openglobus/js/proj/EPSG4326.d.ts +9 -0
- package/lib/@openglobus/js/proj/Proj.d.ts +43 -0
- package/lib/@openglobus/js/quadTree/EPSG4326QuadTreeStrategy.d.ts +6 -0
- package/lib/@openglobus/js/quadTree/EarthQuadTreeStrategy.d.ts +9 -0
- package/lib/@openglobus/js/quadTree/EntityCollectionNode.d.ts +54 -0
- package/lib/@openglobus/js/quadTree/MarsQuadTreeStrategy.d.ts +11 -0
- package/lib/@openglobus/js/quadTree/Node.d.ts +80 -0
- package/lib/@openglobus/js/quadTree/QuadTreeStrategy.d.ts +28 -0
- package/lib/@openglobus/js/quadTree/Wgs84QuadTreeStrategy.d.ts +6 -0
- package/lib/@openglobus/js/quadTree/index.d.ts +12 -0
- package/lib/@openglobus/js/quadTree/quadTree.d.ts +40 -0
- package/lib/@openglobus/js/renderer/Renderer.d.ts +319 -0
- package/lib/@openglobus/js/renderer/RendererEvents.d.ts +240 -0
- package/lib/@openglobus/js/scene/Axes.d.ts +12 -0
- package/lib/@openglobus/js/scene/BaseNode.d.ts +61 -0
- package/lib/@openglobus/js/scene/Planet.d.ts +652 -0
- package/lib/@openglobus/js/scene/RenderNode.d.ts +150 -0
- package/lib/@openglobus/js/scene/SkyBox.d.ts +13 -0
- package/lib/@openglobus/js/scene/index.d.ts +5 -0
- package/lib/@openglobus/js/segment/Segment.d.ts +288 -0
- package/lib/@openglobus/js/segment/SegmentLonLat.d.ts +44 -0
- package/lib/@openglobus/js/segment/SegmentLonLatWgs84.d.ts +10 -0
- package/lib/@openglobus/js/segment/Slice.d.ts +13 -0
- package/lib/@openglobus/js/segment/segmentHelper.d.ts +18 -0
- package/lib/@openglobus/js/shaders/atmos.d.ts +4 -0
- package/lib/@openglobus/js/shaders/billboard.d.ts +3 -0
- package/lib/@openglobus/js/shaders/bloom.d.ts +2 -0
- package/lib/@openglobus/js/shaders/blur.d.ts +3 -0
- package/lib/@openglobus/js/shaders/depth.d.ts +2 -0
- package/lib/@openglobus/js/shaders/drawnode.d.ts +8 -0
- package/lib/@openglobus/js/shaders/geoObject.d.ts +3 -0
- package/lib/@openglobus/js/shaders/label.d.ts +4 -0
- package/lib/@openglobus/js/shaders/lumFilter.d.ts +2 -0
- package/lib/@openglobus/js/shaders/pointCloud.d.ts +2 -0
- package/lib/@openglobus/js/shaders/polyline.d.ts +3 -0
- package/lib/@openglobus/js/shaders/ray.d.ts +2 -0
- package/lib/@openglobus/js/shaders/screenFrame.d.ts +2 -0
- package/lib/@openglobus/js/shaders/skybox.d.ts +2 -0
- package/lib/@openglobus/js/shaders/toneMapping.d.ts +2 -0
- package/lib/@openglobus/js/shaders/utils.d.ts +1 -0
- package/lib/@openglobus/js/terrain/BilTerrain.d.ts +18 -0
- package/lib/@openglobus/js/terrain/EmptyTerrain.d.ts +113 -0
- package/lib/@openglobus/js/terrain/Geoid.d.ts +33 -0
- package/lib/@openglobus/js/terrain/GlobusRgbTerrain.d.ts +6 -0
- package/lib/@openglobus/js/terrain/GlobusTerrain.d.ts +137 -0
- package/lib/{js/terrain/MapboxTerrain.d.ts → @openglobus/js/terrain/RgbTerrain.d.ts} +6 -5
- package/lib/@openglobus/js/terrain/index.d.ts +6 -0
- package/lib/@openglobus/js/ui/Button.d.ts +32 -0
- package/lib/@openglobus/js/ui/ButtonGroup.d.ts +16 -0
- package/lib/@openglobus/js/ui/Color.d.ts +22 -0
- package/lib/@openglobus/js/ui/Dialog.d.ts +55 -0
- package/lib/@openglobus/js/ui/Slider.d.ts +38 -0
- package/lib/@openglobus/js/ui/ToggleButton.d.ts +20 -0
- package/lib/@openglobus/js/ui/View.d.ts +37 -0
- package/lib/@openglobus/js/ui/icons.d.ts +1 -0
- package/lib/@openglobus/js/utils/BaseWorker.d.ts +14 -0
- package/lib/@openglobus/js/utils/FontAtlas.d.ts +82 -0
- package/lib/@openglobus/js/utils/GeoImageCreator.d.ts +34 -0
- package/lib/@openglobus/js/utils/ImagesCacheManager.d.ts +22 -0
- package/lib/@openglobus/js/utils/Loader.d.ts +63 -0
- package/lib/@openglobus/js/utils/NormalMapCreator.d.ts +52 -0
- package/lib/@openglobus/js/utils/PlainSegmentWorker.d.ts +24 -0
- package/lib/@openglobus/js/utils/TerrainWorker.d.ts +28 -0
- package/lib/@openglobus/js/utils/TextureAtlas.d.ts +113 -0
- package/lib/@openglobus/js/utils/VectorTileCreator.d.ts +18 -0
- package/lib/@openglobus/js/utils/colorTable.d.ts +3 -0
- package/lib/@openglobus/js/utils/earcut.d.ts +7 -0
- package/lib/@openglobus/js/utils/objParser.d.ts +24 -0
- package/lib/@openglobus/js/utils/shared.d.ts +263 -0
- package/lib/@openglobus/js/utils/units.d.ts +16 -0
- package/lib/@openglobus/js/webgl/BaseFramebuffer.d.ts +53 -0
- package/lib/@openglobus/js/webgl/Framebuffer.d.ts +69 -0
- package/lib/@openglobus/js/webgl/Handler.d.ts +473 -0
- package/lib/@openglobus/js/webgl/Multisample.d.ts +27 -0
- package/lib/@openglobus/js/webgl/Program.d.ts +159 -0
- package/lib/@openglobus/js/webgl/ProgramController.d.ts +86 -0
- package/lib/@openglobus/js/webgl/index.d.ts +6 -0
- package/lib/@openglobus/js/webgl/types.d.ts +9 -0
- package/lib/@openglobus/js/webgl/variableHandlers.d.ts +22 -0
- package/lib/@openglobus/og.css +1 -1
- package/lib/@openglobus/og.esm.js +1 -1
- package/lib/@openglobus/og.esm.js.map +1 -1
- package/lib/@openglobus/og.umd.js +1 -1
- package/lib/@openglobus/og.umd.js.map +1 -1
- package/lib/js/Extent.js +2 -2
- package/lib/js/Globe.d.ts +1 -1
- package/lib/js/Object3d.d.ts +16 -1
- package/lib/js/Object3d.js +66 -1
- package/lib/js/astro/jd.js +26 -26
- package/lib/js/camera/Frustum.d.ts +1 -1
- package/lib/js/camera/Frustum.js +3 -2
- package/lib/js/control/DebugInfo.js +19 -18
- package/lib/js/control/Lighting.d.ts +4 -0
- package/lib/js/control/Lighting.js +51 -12
- package/lib/js/control/SimpleSkyBackground.d.ts +2 -0
- package/lib/js/control/SimpleSkyBackground.js +13 -3
- package/lib/js/control/drawing/PolygonDrawingScene.js +2 -2
- package/lib/js/control/timeline/timelineUtils.js +32 -32
- package/lib/js/control/visibleExtent/drawnode.js +1 -1
- package/lib/js/entity/GeoObject.d.ts +20 -6
- package/lib/js/entity/GeoObject.js +44 -4
- package/lib/js/entity/GeoObjectHandler.d.ts +6 -1
- package/lib/js/entity/GeoObjectHandler.js +58 -6
- package/lib/js/entity/Geometry.d.ts +24 -11
- package/lib/js/entity/Geometry.js +17 -9
- package/lib/js/entity/GeometryHandler.js +5 -5
- package/lib/js/entity/Label.d.ts +7 -0
- package/lib/js/entity/Label.js +11 -0
- package/lib/js/entity/Polyline.d.ts +15 -7
- package/lib/js/entity/Polyline.js +54 -6
- package/lib/js/entity/Strip.d.ts +12 -0
- package/lib/js/entity/Strip.js +16 -0
- package/lib/js/entity/StripHandler.js +1 -1
- package/lib/js/entity/index.d.ts +10 -11
- package/lib/js/entity/index.js +10 -11
- package/lib/js/index.d.ts +5 -5
- package/lib/js/index.js +5 -5
- package/lib/js/layer/Bing.d.ts +4 -0
- package/lib/js/layer/Bing.js +40 -0
- package/lib/js/layer/GeoImage.d.ts +1 -1
- package/lib/js/layer/GeoVideo.d.ts +1 -1
- package/lib/js/layer/Layer.d.ts +1 -1
- package/lib/js/layer/Layer.js +2 -2
- package/lib/js/layer/OpenStreetMap.d.ts +4 -0
- package/lib/js/layer/OpenStreetMap.js +19 -0
- package/lib/js/layer/Vector.d.ts +3 -0
- package/lib/js/layer/Vector.js +3 -3
- package/lib/js/layer/index.d.ts +12 -11
- package/lib/js/layer/index.js +12 -11
- package/lib/js/math/Mat4.js +18 -17
- package/lib/js/mercator.js +2 -1
- package/lib/js/quadTree/EPSG4326QuadTreeStrategy.js +4 -5
- package/lib/js/quadTree/EarthQuadTreeStrategy.d.ts +3 -0
- package/lib/js/quadTree/EarthQuadTreeStrategy.js +40 -5
- package/lib/js/quadTree/EntityCollectionNode.d.ts +2 -2
- package/lib/js/quadTree/EntityCollectionNode.js +13 -14
- package/lib/js/quadTree/MarsQuadTreeStrategy.d.ts +5 -0
- package/lib/js/quadTree/MarsQuadTreeStrategy.js +31 -5
- package/lib/js/quadTree/Node.d.ts +2 -1
- package/lib/js/quadTree/Node.js +38 -28
- package/lib/js/quadTree/QuadTreeStrategy.d.ts +3 -0
- package/lib/js/quadTree/QuadTreeStrategy.js +17 -0
- package/lib/js/quadTree/Wgs84QuadTreeStrategy.js +3 -3
- package/lib/js/renderer/Renderer.js +1 -0
- package/lib/js/scene/Axes.js +4 -4
- package/lib/js/scene/Planet.js +6 -4
- package/lib/js/segment/Segment.d.ts +12 -9
- package/lib/js/segment/Segment.js +47 -24
- package/lib/js/segment/SegmentLonLat.d.ts +1 -5
- package/lib/js/segment/SegmentLonLat.js +8 -100
- package/lib/js/segment/SegmentLonLatWgs84.js +5 -3
- package/lib/js/shaders/billboard.js +4 -4
- package/lib/js/shaders/drawnode.js +16 -19
- package/lib/js/shaders/geoObject.js +10 -11
- package/lib/js/shaders/ray.js +7 -3
- package/lib/js/terrain/BilTerrain.d.ts +1 -1
- package/lib/js/terrain/BilTerrain.js +7 -6
- package/lib/js/terrain/EmptyTerrain.d.ts +7 -0
- package/lib/js/terrain/EmptyTerrain.js +7 -0
- package/lib/js/terrain/GlobusRgbTerrain.d.ts +6 -0
- package/lib/js/terrain/GlobusRgbTerrain.js +25 -0
- package/lib/js/terrain/GlobusTerrain.d.ts +5 -5
- package/lib/js/terrain/GlobusTerrain.js +35 -30
- package/lib/js/terrain/RgbTerrain.d.ts +22 -0
- package/lib/js/terrain/RgbTerrain.js +415 -0
- package/lib/js/terrain/index.d.ts +3 -2
- package/lib/js/terrain/index.js +3 -2
- package/lib/js/ui/Color.d.ts +22 -0
- package/lib/js/ui/Color.js +58 -0
- package/lib/js/utils/GeoImageCreator.js +1 -1
- package/lib/js/utils/NormalMapCreator.js +1 -1
- package/lib/js/utils/VectorTileCreator.js +3 -3
- package/lib/js/utils/objParser.js +3 -3
- package/lib/js/utils/shared.d.ts +3 -9
- package/lib/js/utils/shared.js +24 -9
- package/package.json +26 -18
- package/lib/js/terrain/MapboxTerrain.js +0 -298
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { Mat3 } from "./Mat3";
|
|
2
|
+
import { Vec3 } from "./Vec3";
|
|
3
|
+
import { Vec4 } from "./Vec4";
|
|
4
|
+
export type NumberArray16 = [
|
|
5
|
+
number,
|
|
6
|
+
number,
|
|
7
|
+
number,
|
|
8
|
+
number,
|
|
9
|
+
number,
|
|
10
|
+
number,
|
|
11
|
+
number,
|
|
12
|
+
number,
|
|
13
|
+
number,
|
|
14
|
+
number,
|
|
15
|
+
number,
|
|
16
|
+
number,
|
|
17
|
+
number,
|
|
18
|
+
number,
|
|
19
|
+
number,
|
|
20
|
+
number
|
|
21
|
+
];
|
|
22
|
+
/**
|
|
23
|
+
* Class represents a 4x4 matrix.
|
|
24
|
+
* @class
|
|
25
|
+
*/
|
|
26
|
+
export declare class Mat4 {
|
|
27
|
+
/**
|
|
28
|
+
* A 4x4 matrix, index-able as a column-major order array.
|
|
29
|
+
* @public
|
|
30
|
+
* @type {Array.<number>}
|
|
31
|
+
*/
|
|
32
|
+
_m: NumberArray16;
|
|
33
|
+
constructor();
|
|
34
|
+
/**
|
|
35
|
+
* Returns identity matrix instance.
|
|
36
|
+
* @static
|
|
37
|
+
* @returns {Mat4} -
|
|
38
|
+
*/
|
|
39
|
+
static identity(): Mat4;
|
|
40
|
+
/**
|
|
41
|
+
* Sets column-major order array matrix.
|
|
42
|
+
* @public
|
|
43
|
+
* @param {Array.<number>} m - Matrix array.
|
|
44
|
+
* @returns {Mat4} -
|
|
45
|
+
*/
|
|
46
|
+
set(m: NumberArray16): Mat4;
|
|
47
|
+
/**
|
|
48
|
+
* Duplicates a Matrix3 instance.
|
|
49
|
+
* @public
|
|
50
|
+
* @returns {Mat4} -
|
|
51
|
+
*/
|
|
52
|
+
clone(): Mat4;
|
|
53
|
+
/**
|
|
54
|
+
* Copy matrix.
|
|
55
|
+
* @public
|
|
56
|
+
* @param {Mat4} a - Matrix to copy.
|
|
57
|
+
* @return {Mat4}
|
|
58
|
+
*/
|
|
59
|
+
copy(a: Mat4): Mat4;
|
|
60
|
+
/**
|
|
61
|
+
* Converts to 3x3 matrix.
|
|
62
|
+
* @public
|
|
63
|
+
* @returns {Mat3} -
|
|
64
|
+
*/
|
|
65
|
+
toMatrix3(): Mat3;
|
|
66
|
+
/**
|
|
67
|
+
* Multiply to 3d vector.
|
|
68
|
+
* @public
|
|
69
|
+
* @param {Vec3} p - 3d vector.
|
|
70
|
+
* @returns {Vec3} -
|
|
71
|
+
*/
|
|
72
|
+
mulVec3(p: Vec3): Vec3;
|
|
73
|
+
/**
|
|
74
|
+
* Multiply to 4d vector.
|
|
75
|
+
* @public
|
|
76
|
+
* @param {Vec4} p - 4d vector.
|
|
77
|
+
* @returns {Vec4} -
|
|
78
|
+
*/
|
|
79
|
+
mulVec4(p: Vec4): Vec4;
|
|
80
|
+
/**
|
|
81
|
+
* Creates an inverse 3x3 matrix of the current.
|
|
82
|
+
* @public
|
|
83
|
+
* @returns {Mat3} -
|
|
84
|
+
*/
|
|
85
|
+
toInverseMatrix3(): Mat3 | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Creates an inverse matrix of the current.
|
|
88
|
+
* @public
|
|
89
|
+
* @returns {Mat4} -
|
|
90
|
+
*/
|
|
91
|
+
inverseTo(res?: Mat4): Mat4;
|
|
92
|
+
/**
|
|
93
|
+
* Creates a transposed matrix of the current.
|
|
94
|
+
* @public
|
|
95
|
+
* @returns {Mat4} -
|
|
96
|
+
*/
|
|
97
|
+
transposeTo(): Mat4;
|
|
98
|
+
/**
|
|
99
|
+
* Sets matrix to identity.
|
|
100
|
+
* @public
|
|
101
|
+
* @returns {Mat4} -
|
|
102
|
+
*/
|
|
103
|
+
setIdentity(): Mat4;
|
|
104
|
+
/**
|
|
105
|
+
* Computes the product of two matrices.
|
|
106
|
+
* @public
|
|
107
|
+
* @param {Mat4} mx - Matrix to multiply.
|
|
108
|
+
* @returns {Mat4} -
|
|
109
|
+
*/
|
|
110
|
+
mul(mx: Mat4): Mat4;
|
|
111
|
+
/**
|
|
112
|
+
* Add translation vector to the current matrix.
|
|
113
|
+
* @public
|
|
114
|
+
* @param {Vec3} v - Translate vector.
|
|
115
|
+
* @returns {Mat4} -
|
|
116
|
+
*/
|
|
117
|
+
translate(v: Vec3): Mat4;
|
|
118
|
+
/**
|
|
119
|
+
* Sets translation matrix to the position.
|
|
120
|
+
* @public
|
|
121
|
+
* @param {Vec3} v - Translate to position.
|
|
122
|
+
* @returns {Mat4} -
|
|
123
|
+
*/
|
|
124
|
+
translateToPosition(v: Vec3): Mat4;
|
|
125
|
+
/**
|
|
126
|
+
* Rotate current matrix around the aligned axis and angle.
|
|
127
|
+
* @public
|
|
128
|
+
* @param {Vec3} u - Aligned axis.
|
|
129
|
+
* @param {number} angle - Aligned axis angle in radians.
|
|
130
|
+
* @returns {Mat4} -
|
|
131
|
+
*/
|
|
132
|
+
rotate(u: Vec3, angle: number): Mat4;
|
|
133
|
+
/**
|
|
134
|
+
* Sets current rotation matrix around the aligned axis and angle.
|
|
135
|
+
* @public
|
|
136
|
+
* @param {Vec3} u - Aligned axis.
|
|
137
|
+
* @param {number} angle - Aligned axis angle in radians.
|
|
138
|
+
* @returns {Mat4} -
|
|
139
|
+
*/
|
|
140
|
+
setRotation(u: Vec3, angle: number): Mat4;
|
|
141
|
+
/**
|
|
142
|
+
* Gets the rotation matrix from one vector to another.
|
|
143
|
+
* @public
|
|
144
|
+
* @param {Vec3} a - First vector.
|
|
145
|
+
* @param {Vec3} b - Second vector.
|
|
146
|
+
* @returns {Mat4} -
|
|
147
|
+
*/
|
|
148
|
+
rotateBetweenVectors(a: Vec3, b: Vec3): Mat4;
|
|
149
|
+
/**
|
|
150
|
+
* Scale current matrix to the vector values.
|
|
151
|
+
* @public
|
|
152
|
+
* @param {Vec3} v - Scale vector.
|
|
153
|
+
* @returns {Mat4} -
|
|
154
|
+
*/
|
|
155
|
+
scale(v: Vec3): Mat4;
|
|
156
|
+
/**
|
|
157
|
+
* Sets perspective projection matrix frustum values.
|
|
158
|
+
* @public
|
|
159
|
+
* @param {number} left -
|
|
160
|
+
* @param {number} right -
|
|
161
|
+
* @param {number} bottom -
|
|
162
|
+
* @param {number} top -
|
|
163
|
+
* @param {number} near -
|
|
164
|
+
* @param {number} far -
|
|
165
|
+
* @returns {Mat4} -
|
|
166
|
+
*/
|
|
167
|
+
setPerspective(left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4;
|
|
168
|
+
/**
|
|
169
|
+
* Creates current orthographic projection matrix.
|
|
170
|
+
* @public
|
|
171
|
+
* @param {number} left -
|
|
172
|
+
* @param {number} right -
|
|
173
|
+
* @param {number} bottom -
|
|
174
|
+
* @param {number} top -
|
|
175
|
+
* @param {number} near -
|
|
176
|
+
* @param {number} far -
|
|
177
|
+
* @return {Mat4} -
|
|
178
|
+
*/
|
|
179
|
+
setOrtho(left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4;
|
|
180
|
+
/**
|
|
181
|
+
* Sets current rotation matrix by euler's angles.
|
|
182
|
+
* @public
|
|
183
|
+
* @param {number} ax - Rotation angle in radians around X axis.
|
|
184
|
+
* @param {number} ay - Rotation angle in radians around Y axis.
|
|
185
|
+
* @param {number} az - Rotation angle in radians around Z axis.
|
|
186
|
+
* @returns {Mat4} -
|
|
187
|
+
*/
|
|
188
|
+
eulerToMatrix(ax: number, ay: number, az: number): Mat4;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Mat4 factory.
|
|
192
|
+
* @static
|
|
193
|
+
* @returns {Mat4} -
|
|
194
|
+
*/
|
|
195
|
+
export declare function mat4(): Mat4;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Vec3 } from "./Vec3";
|
|
2
|
+
import { Line3 } from "./Line3";
|
|
3
|
+
/**
|
|
4
|
+
* Plane class.
|
|
5
|
+
* @constructor
|
|
6
|
+
* @param {Vec3} [p] - Plane point.
|
|
7
|
+
* @param {Vec3} [n] - Planet normal.
|
|
8
|
+
*/
|
|
9
|
+
declare class Plane {
|
|
10
|
+
p: Vec3;
|
|
11
|
+
n: Vec3;
|
|
12
|
+
constructor(p: Vec3, n: Vec3);
|
|
13
|
+
set(p: Vec3, n: Vec3): void;
|
|
14
|
+
getNormal(): Vec3;
|
|
15
|
+
distance(p: Vec3): number;
|
|
16
|
+
getProjection(v: Vec3, def?: Vec3): Vec3;
|
|
17
|
+
getProjectionPoint(p: Vec3, vh?: Vec3): Vec3;
|
|
18
|
+
getIntersection(Pn1: Plane, Pn2: Plane, L: Line3): number;
|
|
19
|
+
}
|
|
20
|
+
export { Plane };
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import { Vec3 } from "./Vec3";
|
|
2
|
+
import { Mat4 } from "./Mat4";
|
|
3
|
+
import { Mat3 } from "./Mat3";
|
|
4
|
+
/**
|
|
5
|
+
* A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space.
|
|
6
|
+
* @constructor
|
|
7
|
+
* @param {Number} [x=0.0] The X component.
|
|
8
|
+
* @param {Number} [y=0.0] The Y component.
|
|
9
|
+
* @param {Number} [z=0.0] The Z component.
|
|
10
|
+
* @param {Number} [w=0.0] The W component.
|
|
11
|
+
*/
|
|
12
|
+
export declare class Quat {
|
|
13
|
+
/**
|
|
14
|
+
* The X component.
|
|
15
|
+
* @public
|
|
16
|
+
* @type {Number}
|
|
17
|
+
* @default 0.0
|
|
18
|
+
*/
|
|
19
|
+
x: number;
|
|
20
|
+
/**
|
|
21
|
+
* The Y component.
|
|
22
|
+
* @public
|
|
23
|
+
* @type {Number}
|
|
24
|
+
* @default 0.0
|
|
25
|
+
*/
|
|
26
|
+
y: number;
|
|
27
|
+
/**
|
|
28
|
+
* The Z component.
|
|
29
|
+
* @public
|
|
30
|
+
* @type {Number}
|
|
31
|
+
* @default 0.0
|
|
32
|
+
*/
|
|
33
|
+
z: number;
|
|
34
|
+
/**
|
|
35
|
+
* The W component.
|
|
36
|
+
* @public
|
|
37
|
+
* @type {Number}
|
|
38
|
+
* @default 0.0
|
|
39
|
+
*/
|
|
40
|
+
w: number;
|
|
41
|
+
constructor(x?: number, y?: number, z?: number, w?: number);
|
|
42
|
+
/**
|
|
43
|
+
* Identity Quat.
|
|
44
|
+
* @const
|
|
45
|
+
* @type {Quat}
|
|
46
|
+
*/
|
|
47
|
+
static get IDENTITY(): Quat;
|
|
48
|
+
/**
|
|
49
|
+
* Returns a Quat represents rotation around X axis.
|
|
50
|
+
* @static
|
|
51
|
+
* @param {number} a - The angle in radians to rotate around the axis.
|
|
52
|
+
* @returns {Quat} -
|
|
53
|
+
*/
|
|
54
|
+
static xRotation(a: number): Quat;
|
|
55
|
+
/**
|
|
56
|
+
* Returns a Quat represents rotation around Y axis.
|
|
57
|
+
* @static
|
|
58
|
+
* @param {number} a - The angle in radians to rotate around the axis.
|
|
59
|
+
* @returns {Quat} -
|
|
60
|
+
*/
|
|
61
|
+
static yRotation(a: number): Quat;
|
|
62
|
+
/**
|
|
63
|
+
* Returns a Quat represents rotation around Z axis.
|
|
64
|
+
* @static
|
|
65
|
+
* @param {number} a - The angle in radians to rotate around the axis.
|
|
66
|
+
* @returns {Quat} -
|
|
67
|
+
*/
|
|
68
|
+
static zRotation(a: number): Quat;
|
|
69
|
+
/**
|
|
70
|
+
* Computes a Quat representing a rotation around an axis.
|
|
71
|
+
* @static
|
|
72
|
+
* @param {Vec3} axis - The axis of rotation.
|
|
73
|
+
* @param {number} [angle=0.0] The angle in radians to rotate around the axis.
|
|
74
|
+
* @returns {Quat} -
|
|
75
|
+
*/
|
|
76
|
+
static axisAngleToQuat(axis: Vec3, angle?: number): Quat;
|
|
77
|
+
/**
|
|
78
|
+
* Computes a rotation from the given heading and up vector.
|
|
79
|
+
* @static
|
|
80
|
+
* @param {Vec3} forward - Heading target coordinates.
|
|
81
|
+
* @param {Vec3} up - Up vector.
|
|
82
|
+
* @returns {Quat} -
|
|
83
|
+
*/
|
|
84
|
+
static getLookRotation(forward: Vec3, up: Vec3): Quat;
|
|
85
|
+
/**
|
|
86
|
+
* Computes a Quat from source point heading to the destination point.
|
|
87
|
+
* @static
|
|
88
|
+
* @param {Vec3} sourcePoint - Source coordinate.
|
|
89
|
+
* @param {Vec3} destPoint - Destination coordinate.
|
|
90
|
+
* @returns {Quat} -
|
|
91
|
+
*/
|
|
92
|
+
static getLookAtSourceDest(sourcePoint: Vec3, destPoint: Vec3): Quat;
|
|
93
|
+
/**
|
|
94
|
+
* Compute rotation between two vectors.
|
|
95
|
+
* @static
|
|
96
|
+
* @param {Vec3} u - First vector.
|
|
97
|
+
* @param {Vec3} v - Second vector.
|
|
98
|
+
* @returns {Quat} -
|
|
99
|
+
*/
|
|
100
|
+
static getRotationBetweenVectors(u: Vec3, v: Vec3): Quat;
|
|
101
|
+
/**
|
|
102
|
+
* Compute rotation between two vectors.
|
|
103
|
+
* @static
|
|
104
|
+
* @param {Vec3} u - First vector.
|
|
105
|
+
* @param {Vec3} v - Second vector.
|
|
106
|
+
* @param {Quat} res
|
|
107
|
+
* @returns {Quat} -
|
|
108
|
+
*/
|
|
109
|
+
static getRotationBetweenVectorsRes(u: Vec3, v: Vec3, res: Quat): Quat;
|
|
110
|
+
/**
|
|
111
|
+
* Compute rotation between two vectors with around vector up
|
|
112
|
+
* for exactly opposite vectors. If vectors exactly in the same
|
|
113
|
+
* direction as returns identity Quat.
|
|
114
|
+
* @static
|
|
115
|
+
* @param {Vec3} source - First vector.
|
|
116
|
+
* @param {Vec3} dest - Second vector.
|
|
117
|
+
* @param {Vec3} up - Up vector.
|
|
118
|
+
* @returns {Quat} -
|
|
119
|
+
*/
|
|
120
|
+
static getRotationBetweenVectorsUp(source: Vec3, dest: Vec3, up: Vec3): Quat;
|
|
121
|
+
/**
|
|
122
|
+
* Returns true if the components are zero.
|
|
123
|
+
* @public
|
|
124
|
+
* @returns {boolean} -
|
|
125
|
+
*/
|
|
126
|
+
isZero(): boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Clear Quat. Sets zeroes.
|
|
129
|
+
* @public
|
|
130
|
+
* @returns {Quat} -
|
|
131
|
+
*/
|
|
132
|
+
clear(): Quat;
|
|
133
|
+
/**
|
|
134
|
+
* Sets Quat values.
|
|
135
|
+
* @public
|
|
136
|
+
* @param {Number} [x=0.0] The X component.
|
|
137
|
+
* @param {Number} [y=0.0] The Y component.
|
|
138
|
+
* @param {Number} [z=0.0] The Z component.
|
|
139
|
+
* @param {Number} [w=0.0] The W component.
|
|
140
|
+
* @returns {Quat} -
|
|
141
|
+
*/
|
|
142
|
+
set(x: number, y: number, z: number, w: number): Quat;
|
|
143
|
+
/**
|
|
144
|
+
* Copy Quat values.
|
|
145
|
+
* @public
|
|
146
|
+
* @param {Quat} q - Copy Quat.
|
|
147
|
+
* @returns {Quat} -
|
|
148
|
+
*/
|
|
149
|
+
copy(q: Quat): Quat;
|
|
150
|
+
/**
|
|
151
|
+
* Set current Quat instance to identity Quat.
|
|
152
|
+
* @public
|
|
153
|
+
* @returns {Quat} -
|
|
154
|
+
*/
|
|
155
|
+
setIdentity(): Quat;
|
|
156
|
+
/**
|
|
157
|
+
* Duplicates a Quat instance.
|
|
158
|
+
* @public
|
|
159
|
+
* @returns {Quat} -
|
|
160
|
+
*/
|
|
161
|
+
clone(): Quat;
|
|
162
|
+
/**
|
|
163
|
+
* Computes the componentwise sum of two Quats.
|
|
164
|
+
* @public
|
|
165
|
+
* @param {Quat} q - Quat to add.
|
|
166
|
+
* @returns {Quat} -
|
|
167
|
+
*/
|
|
168
|
+
add(q: Quat): Quat;
|
|
169
|
+
/**
|
|
170
|
+
* Computes the componentwise difference of two Quats.
|
|
171
|
+
* @public
|
|
172
|
+
* @param {Quat} q - Quat to subtract.
|
|
173
|
+
* @returns {Quat} -
|
|
174
|
+
*/
|
|
175
|
+
sub(q: Quat): Quat;
|
|
176
|
+
/**
|
|
177
|
+
* Multiplies the provided Quat componentwise by the provided scalar.
|
|
178
|
+
* @public
|
|
179
|
+
* @param {Number} scale - The scalar to multiply with.
|
|
180
|
+
* @returns {Quat} -
|
|
181
|
+
*/
|
|
182
|
+
scaleTo(scale: number): Quat;
|
|
183
|
+
/**
|
|
184
|
+
* Multiplies the provided Quat componentwise.
|
|
185
|
+
* @public
|
|
186
|
+
* @param {Number} scale - The scalar to multiply with.
|
|
187
|
+
* @returns {Quat} -
|
|
188
|
+
*/
|
|
189
|
+
scale(scale: number): Quat;
|
|
190
|
+
/**
|
|
191
|
+
* Converts Quat values to array.
|
|
192
|
+
* @public
|
|
193
|
+
* @returns {Array.<number>} - (exactly 4 entries)
|
|
194
|
+
*/
|
|
195
|
+
toVec(): [number, number, number, number];
|
|
196
|
+
/**
|
|
197
|
+
* Sets current quaternion by spherical coordinates.
|
|
198
|
+
* @public
|
|
199
|
+
* @param {number} lat - Latitude.
|
|
200
|
+
* @param {number} lon - Longitude.
|
|
201
|
+
* @param {number} angle - Angle in radians.
|
|
202
|
+
* @returns {Quat} -
|
|
203
|
+
*/
|
|
204
|
+
setFromSphericalCoords(lat: number, lon: number, angle: number): Quat;
|
|
205
|
+
/**
|
|
206
|
+
* Sets rotation with the given heading and up vectors.
|
|
207
|
+
* @static
|
|
208
|
+
* @param {Vec3} forward - Heading target coordinates.
|
|
209
|
+
* @param {Vec3} up - Up vector.
|
|
210
|
+
* @returns {Quat} -
|
|
211
|
+
*/
|
|
212
|
+
setLookRotation(forward: Vec3, up: Vec3): Quat;
|
|
213
|
+
/**
|
|
214
|
+
* Gets spherical coordinates.
|
|
215
|
+
* @public
|
|
216
|
+
* @returns {Object} Returns object with latitude, longitude and alpha.
|
|
217
|
+
*/
|
|
218
|
+
toSphericalCoords(): any;
|
|
219
|
+
/**
|
|
220
|
+
* Sets current Quat representing a rotation around an axis.
|
|
221
|
+
* @public
|
|
222
|
+
* @param {Vec3} axis - The axis of rotation.
|
|
223
|
+
* @param {number} angle The angle in radians to rotate around the axis.
|
|
224
|
+
* @returns {Quat} -
|
|
225
|
+
*/
|
|
226
|
+
setFromAxisAngle(axis: Vec3, angle: number): Quat;
|
|
227
|
+
/**
|
|
228
|
+
* Returns axis and angle of the current Quat.
|
|
229
|
+
* @public
|
|
230
|
+
* @returns {Object} -
|
|
231
|
+
*/
|
|
232
|
+
getAxisAngle(): any;
|
|
233
|
+
/**
|
|
234
|
+
* Sets current Quat by Euler's angles.
|
|
235
|
+
* @public
|
|
236
|
+
* @param {number} pitch - Pitch angle in degrees.
|
|
237
|
+
* @param {number} yaw - Yaw angle in degrees.
|
|
238
|
+
* @param {number} roll - Roll angle in degrees.
|
|
239
|
+
* @returns {Quat} -
|
|
240
|
+
*/
|
|
241
|
+
setFromEulerAngles(pitch: number, yaw: number, roll: number): Quat;
|
|
242
|
+
/**
|
|
243
|
+
* Returns Euler's angles of the current Quat.
|
|
244
|
+
* @public
|
|
245
|
+
* @returns {Object} -
|
|
246
|
+
*/
|
|
247
|
+
getEulerAngles(): any;
|
|
248
|
+
/**
|
|
249
|
+
* Computes a Quat from the provided 4x4 matrix instance.
|
|
250
|
+
* @public
|
|
251
|
+
* @param {Mat4} mx - The rotation matrix.
|
|
252
|
+
* @returns {Quat} -
|
|
253
|
+
*/
|
|
254
|
+
setFromMatrix4(mx: Mat4): Quat;
|
|
255
|
+
/**
|
|
256
|
+
* Converts current Quat to the rotation 4x4 matrix.
|
|
257
|
+
* @public
|
|
258
|
+
* @params {Mat4} [out] - Output matrix
|
|
259
|
+
* @returns {Mat4} -
|
|
260
|
+
*/
|
|
261
|
+
getMat4(out?: Mat4): Mat4;
|
|
262
|
+
/**
|
|
263
|
+
* Converts current Quat to the rotation 3x3 matrix.
|
|
264
|
+
* @public
|
|
265
|
+
* @returns {Mat3} -
|
|
266
|
+
* @todo NOT TESTED
|
|
267
|
+
*/
|
|
268
|
+
getMat3(): Mat3;
|
|
269
|
+
/**
|
|
270
|
+
* Returns quaternion and vector production.
|
|
271
|
+
* @public
|
|
272
|
+
* @param {Vec3} v - 3d Vector.
|
|
273
|
+
* @returns {Vec3} -
|
|
274
|
+
*/
|
|
275
|
+
mulVec3(v: Vec3): Vec3;
|
|
276
|
+
/**
|
|
277
|
+
* Computes the product of two Quats.
|
|
278
|
+
* @public
|
|
279
|
+
* @param {Quat} q - Quat to multiply.
|
|
280
|
+
* @returns {Quat} -
|
|
281
|
+
*/
|
|
282
|
+
mul(q: Quat): Quat;
|
|
283
|
+
/**
|
|
284
|
+
* Computes the product of two Quats.
|
|
285
|
+
* @public
|
|
286
|
+
* @param {Quat} q - Quat to multiply.
|
|
287
|
+
* @returns {Quat} -
|
|
288
|
+
*/
|
|
289
|
+
mulA(q: Quat): Quat;
|
|
290
|
+
/**
|
|
291
|
+
* Gets the conjugate of the Quat.
|
|
292
|
+
* @public
|
|
293
|
+
* @returns {Quat} -
|
|
294
|
+
*/
|
|
295
|
+
conjugate(): Quat;
|
|
296
|
+
/**
|
|
297
|
+
* Computes the inverse of the Quat.
|
|
298
|
+
* @public
|
|
299
|
+
* @returns {Quat} -
|
|
300
|
+
*/
|
|
301
|
+
inverse(): Quat;
|
|
302
|
+
/**
|
|
303
|
+
* Computes a magnitude of the Quat.
|
|
304
|
+
* @public
|
|
305
|
+
* @returns {number} -
|
|
306
|
+
*/
|
|
307
|
+
magnitude(): number;
|
|
308
|
+
/**
|
|
309
|
+
* Computes a squared magnitude of the Quat.
|
|
310
|
+
* @public
|
|
311
|
+
* @returns {number} -
|
|
312
|
+
*/
|
|
313
|
+
magnitude2(): number;
|
|
314
|
+
/**
|
|
315
|
+
* Computes the dot (scalar) product of two Quats.
|
|
316
|
+
* @public
|
|
317
|
+
* @param {Quat} q - Second quaternion.
|
|
318
|
+
* @returns {number} -
|
|
319
|
+
*/
|
|
320
|
+
dot(q: Quat): number;
|
|
321
|
+
/**
|
|
322
|
+
* Current Quat normalization.
|
|
323
|
+
* @public
|
|
324
|
+
* @returns {Quat} -
|
|
325
|
+
*/
|
|
326
|
+
normalize(): Quat;
|
|
327
|
+
/**
|
|
328
|
+
* Compares two Quats.
|
|
329
|
+
* @public
|
|
330
|
+
* @param {Quat} q - Second quaternion.
|
|
331
|
+
* @returns {Boolean} -
|
|
332
|
+
*/
|
|
333
|
+
isEqual(q: Quat): boolean;
|
|
334
|
+
/**
|
|
335
|
+
* Performs a spherical linear interpolation between two Quats.
|
|
336
|
+
* @public
|
|
337
|
+
* @param {Quat} b - The end rotation Quat.
|
|
338
|
+
* @param {number} t - interpolation amount between the two Quats.
|
|
339
|
+
* @returns {Quat} -
|
|
340
|
+
*/
|
|
341
|
+
slerp(b: Quat, t: number): Quat;
|
|
342
|
+
/**
|
|
343
|
+
* Returns a roll angle in radians.
|
|
344
|
+
* @public
|
|
345
|
+
* @param {Boolean} [reprojectAxis] -
|
|
346
|
+
* @returns {Number} -
|
|
347
|
+
*/
|
|
348
|
+
getRoll(reprojectAxis?: boolean): number;
|
|
349
|
+
/**
|
|
350
|
+
* Returns a pitch angle in radians.
|
|
351
|
+
* @public
|
|
352
|
+
* @param {Boolean} [reprojectAxis] -
|
|
353
|
+
* @returns {number} -
|
|
354
|
+
*/
|
|
355
|
+
getPitch(reprojectAxis?: boolean): number;
|
|
356
|
+
/**
|
|
357
|
+
* Returns a yaw angle in radians.
|
|
358
|
+
* @public
|
|
359
|
+
* @param {Boolean} [reprojectAxis] -
|
|
360
|
+
* @returns {number} -
|
|
361
|
+
*/
|
|
362
|
+
getYaw(reprojectAxis?: boolean): number;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Creates Quat instance.
|
|
366
|
+
* @function
|
|
367
|
+
* @param {Number} [x=0.0] The X component.
|
|
368
|
+
* @param {Number} [y=0.0] The Y component.
|
|
369
|
+
* @param {Number} [z=0.0] The Z component.
|
|
370
|
+
* @param {Number} [w=0.0] The W component.
|
|
371
|
+
* @returns {Quat} -
|
|
372
|
+
*/
|
|
373
|
+
export declare function quat(x?: number, y?: number, z?: number, w?: number): Quat;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Box } from "../bv/Box";
|
|
2
|
+
import { Sphere } from "../bv/Sphere";
|
|
3
|
+
import { Vec3 } from "./Vec3";
|
|
4
|
+
/**
|
|
5
|
+
* Represents a ray that extends infinitely from the provided origin in the provided direction.
|
|
6
|
+
* @class
|
|
7
|
+
* @param {Vec3} origin - The origin of the ray.
|
|
8
|
+
* @param {Vec3} direction - The direction of the ray.
|
|
9
|
+
*/
|
|
10
|
+
export declare class Ray {
|
|
11
|
+
/**
|
|
12
|
+
* The origin of the ray.
|
|
13
|
+
* @public
|
|
14
|
+
* @type {Vec3}
|
|
15
|
+
*/
|
|
16
|
+
origin: Vec3;
|
|
17
|
+
/**
|
|
18
|
+
* The direction of the ray.
|
|
19
|
+
* @public
|
|
20
|
+
* @type {Vec3}
|
|
21
|
+
*/
|
|
22
|
+
direction: Vec3;
|
|
23
|
+
constructor(origin?: Vec3, direction?: Vec3);
|
|
24
|
+
/** @const */
|
|
25
|
+
static get OUTSIDE(): number;
|
|
26
|
+
/** @const */
|
|
27
|
+
static get INSIDE(): number;
|
|
28
|
+
/** @const */
|
|
29
|
+
static get INPLANE(): number;
|
|
30
|
+
/** @const */
|
|
31
|
+
static get AWAY(): number;
|
|
32
|
+
/**
|
|
33
|
+
* Sets a ray parameters.
|
|
34
|
+
* @public
|
|
35
|
+
* @param {Vec3} origin - The origin of the ray.
|
|
36
|
+
* @param {Vec3} direction - The direction of the ray.
|
|
37
|
+
* @returns {Ray}
|
|
38
|
+
*/
|
|
39
|
+
set(origin: Vec3, direction: Vec3): Ray;
|
|
40
|
+
/**
|
|
41
|
+
* Computes the point along the ray on the distance.
|
|
42
|
+
* @public
|
|
43
|
+
* @param {number} distance - Point distance.
|
|
44
|
+
* @returns {Vec3}
|
|
45
|
+
*/
|
|
46
|
+
getPoint(distance: number): Vec3;
|
|
47
|
+
/**
|
|
48
|
+
* Returns ray hit a triange result.
|
|
49
|
+
* @public
|
|
50
|
+
* @param {Vec3} v0 - First triangle corner coordinate.
|
|
51
|
+
* @param {Vec3} v1 - Second triangle corner coordinate.
|
|
52
|
+
* @param {Vec3} v2 - Third triangle corner coordinate.
|
|
53
|
+
* @param {Vec3} res - Hit point object pointer that stores hit result.
|
|
54
|
+
* @returns {number} - Hit code, could 0 - og.Ray.OUTSIDE, 1 - og.Ray.INSIDE,
|
|
55
|
+
* 2 - og.Ray.INPLANE and 3 - og.Ray.AWAY(ray goes away from triangle).
|
|
56
|
+
*/
|
|
57
|
+
hitTriangle(v0: Vec3, v1: Vec3, v2: Vec3, res: Vec3): number;
|
|
58
|
+
/**
|
|
59
|
+
* Gets a ray hit a plane result. If the ray cross the plane returns 1 - og.Ray.INSIDE otherwise returns 0 - og.Ray.OUTSIDE.
|
|
60
|
+
* @public
|
|
61
|
+
* @param {Vec3} v0 - First plane point.
|
|
62
|
+
* @param {Vec3} v1 - Second plane point.
|
|
63
|
+
* @param {Vec3} v2 - Third plane point.
|
|
64
|
+
* @param {Vec3} res - Hit point object pointer that stores hit result.
|
|
65
|
+
* @returns {number}
|
|
66
|
+
*/
|
|
67
|
+
hitPlane(v0: Vec3, v1: Vec3, v2: Vec3, res: Vec3): number;
|
|
68
|
+
/**
|
|
69
|
+
* Returns a ray hit sphere coordiante. If there isn't hit returns null.
|
|
70
|
+
* @public
|
|
71
|
+
* @param {Sphere} sphere - Sphere object.
|
|
72
|
+
* @returns {Vec3}
|
|
73
|
+
*/
|
|
74
|
+
hitSphere(sphere: Sphere): Vec3 | null;
|
|
75
|
+
hitBox(box: Box): void;
|
|
76
|
+
}
|