@openglobus/og 0.11.1 → 0.11.6
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/package.json +18 -20
- package/src/og/Clock.js +11 -11
- package/src/og/Deferred.js +1 -1
- package/src/og/Events.js +9 -7
- package/src/og/Extent.js +117 -72
- package/src/og/Globe.js +35 -22
- package/src/og/ImageCanvas.js +24 -18
- package/src/og/Lock.js +2 -2
- package/src/og/LonLat.js +40 -37
- package/src/og/Popup.js +21 -15
- package/src/og/QueueArray.js +7 -3
- package/src/og/Rectangle.js +11 -6
- package/src/og/Stack.js +8 -5
- package/src/og/ajax.js +21 -33
- package/src/og/astro/astro.js +5 -5
- package/src/og/astro/earth.js +23 -17
- package/src/og/astro/jd.js +44 -39
- package/src/og/astro/orbit.js +20 -18
- package/src/og/astro/rotation.js +17 -8
- package/src/og/bv/Box.js +7 -3
- package/src/og/bv/Sphere.js +17 -9
- package/src/og/camera/Camera.js +137 -86
- package/src/og/camera/Frustum.js +30 -19
- package/src/og/camera/PlanetCamera.js +30 -26
- package/src/og/control/CompassButton.js +8 -2
- package/src/og/control/Control.js +13 -11
- package/src/og/control/DebugInfo.js +4 -1
- package/src/og/control/EarthCoordinates.js +62 -41
- package/src/og/control/EarthNavigation.js +20 -22
- package/src/og/control/GeoImageDragControl.js +1 -1
- package/src/og/control/KeyboardNavigation.js +12 -12
- package/src/og/control/LayerSwitcher.js +24 -23
- package/src/og/control/Lighting.js +1 -1
- package/src/og/control/MouseNavigation.js +1 -1
- package/src/og/control/ScaleControl.js +1 -1
- package/src/og/control/SegmentBoundVisualization.js +8 -9
- package/src/og/control/ShowFps.js +15 -10
- package/src/og/control/SimpleNavigation.js +8 -10
- package/src/og/control/Sun.js +25 -15
- package/src/og/control/ToggleWireframe.js +5 -5
- package/src/og/control/TouchNavigation.js +58 -45
- package/src/og/control/ZoomControl.js +41 -25
- package/src/og/control/index.js +4 -0
- package/src/og/ellipsoid/Ellipsoid.js +181 -85
- package/src/og/ellipsoid/wgs84.js +4 -4
- package/src/og/entity/BaseBillboard.js +97 -44
- package/src/og/entity/Billboard.js +15 -11
- package/src/og/entity/BillboardHandler.js +314 -64
- package/src/og/entity/Entity.js +106 -74
- package/src/og/entity/EntityCollection.js +72 -49
- package/src/og/entity/GeoObject.js +228 -0
- package/src/og/entity/GeoObjectHandler.js +910 -0
- package/src/og/entity/Geometry.js +29 -26
- package/src/og/entity/GeometryHandler.js +598 -126
- package/src/og/entity/Label.js +74 -40
- package/src/og/entity/LabelHandler.js +47 -246
- package/src/og/entity/LabelWorker.js +213 -0
- package/src/og/entity/Object3d.js +504 -0
- package/src/og/entity/PointCloud.js +81 -33
- package/src/og/entity/PointCloudHandler.js +9 -9
- package/src/og/entity/Polyline.js +39 -39
- package/src/og/entity/Ray.js +61 -28
- package/src/og/entity/ShapeHandler.js +1 -1
- package/src/og/entity/Strip.js +77 -48
- package/src/og/entity/StripHandler.js +27 -27
- package/src/og/entity/index.js +8 -16
- package/src/og/input/KeyboardHandler.js +107 -104
- package/src/og/input/MouseHandler.js +81 -78
- package/src/og/input/TouchHandler.js +55 -51
- package/src/og/layer/BaseGeoImage.js +61 -30
- package/src/og/layer/CanvasTiles.js +26 -24
- package/src/og/layer/GeoImage.js +10 -10
- package/src/og/layer/GeoTexture2d.js +1 -1
- package/src/og/layer/GeoVideo.js +3 -3
- package/src/og/layer/KML.js +66 -40
- package/src/og/layer/Layer.js +27 -17
- package/src/og/layer/Material.js +93 -61
- package/src/og/layer/Vector.js +118 -72
- package/src/og/layer/WMS.js +36 -19
- package/src/og/layer/XYZ.js +55 -48
- package/src/og/light/LightSource.js +47 -40
- package/src/og/math/Line2.js +24 -24
- package/src/og/math/Line3.js +103 -102
- package/src/og/math/Mat3.js +134 -121
- package/src/og/math/Mat4.js +603 -459
- package/src/og/math/Plane.js +21 -20
- package/src/og/math/Quat.js +980 -927
- package/src/og/math/Ray.js +195 -187
- package/src/og/math/Vec2.js +127 -117
- package/src/og/math/Vec3.js +206 -176
- package/src/og/math/Vec4.js +49 -53
- package/src/og/math/coder.js +18 -18
- package/src/og/math.js +12 -12
- package/src/og/mercator.js +11 -11
- package/src/og/proj/EPSG3857.js +4 -4
- package/src/og/proj/EPSG4326.js +4 -4
- package/src/og/proj/Proj.js +31 -31
- package/src/og/quadTree/EntityCollectionNode.js +310 -300
- package/src/og/quadTree/Node.js +1008 -993
- package/src/og/renderer/Renderer.js +768 -747
- package/src/og/renderer/RendererEvents.js +9 -6
- package/src/og/scene/Axes.js +1 -1
- package/src/og/scene/BaseNode.js +8 -9
- package/src/og/scene/Planet.js +115 -87
- package/src/og/scene/RenderNode.js +29 -22
- package/src/og/scene/SkyBox.js +1 -1
- package/src/og/segment/Segment.js +1886 -1878
- package/src/og/segment/SegmentLonLat.js +298 -268
- package/src/og/segment/segmentHelper.js +11 -11
- package/src/og/shaders/bloom.js +1 -1
- package/src/og/shaders/blur.js +2 -2
- package/src/og/shaders/depth.js +1 -1
- package/src/og/shaders/geoObject.js +211 -0
- package/src/og/shaders/label.js +1 -1
- package/src/og/shaders/lumFilter.js +1 -1
- package/src/og/shaders/pointCloud.js +42 -42
- package/src/og/shaders/screenFrame.js +1 -1
- package/src/og/shaders/shape.js +15 -21
- package/src/og/shaders/skybox.js +37 -37
- package/src/og/shaders/toneMapping.js +1 -1
- package/src/og/shapes/BaseShape.js +129 -57
- package/src/og/shapes/Icosphere.js +30 -15
- package/src/og/shapes/Sphere.js +13 -16
- package/src/og/terrain/BilTerrain.js +2 -1
- package/src/og/terrain/EmptyTerrain.js +2 -2
- package/src/og/terrain/Geoid.js +2 -2
- package/src/og/terrain/GlobusTerrain.js +10 -10
- package/src/og/terrain/MapboxTerrain.js +1 -1
- package/src/og/utils/GeoImageCreator.js +9 -9
- package/src/og/utils/Loader.js +6 -6
- package/src/og/utils/NormalMapCreator.js +13 -13
- package/src/og/utils/TerrainWorker.js +1 -1
- package/src/og/utils/TextureAtlas.js +20 -22
- package/src/og/utils/VectorTileCreator.js +5 -5
- package/src/og/utils/earcut.js +1 -1
- package/src/og/utils/shared.js +15 -15
- package/src/og/webgl/Framebuffer.js +101 -53
- package/src/og/webgl/Handler.js +125 -85
- package/src/og/webgl/Multisample.js +55 -27
- package/src/og/webgl/Program.js +80 -35
- package/src/og/webgl/ProgramController.js +27 -23
- package/src/og/webgl/callbacks.js +8 -8
- package/types/Clock.d.ts +6 -2
- package/types/Deferred.d.ts +1 -1
- package/types/Events.d.ts +8 -4
- package/types/Extent.d.ts +37 -33
- package/types/Globe.d.ts +15 -13
- package/types/ImageCanvas.d.ts +5 -3
- package/types/LonLat.d.ts +24 -24
- package/types/Popup.d.ts +4 -0
- package/types/QueueArray.d.ts +6 -2
- package/types/Rectangle.d.ts +10 -4
- package/types/Stack.d.ts +4 -0
- package/types/ajax.d.ts +1 -1
- package/types/astro/earth.d.ts +3 -2
- package/types/bv/Box.d.ts +10 -5
- package/types/bv/Sphere.d.ts +13 -7
- package/types/camera/Camera.d.ts +90 -81
- package/types/camera/Frustum.d.ts +26 -22
- package/types/camera/PlanetCamera.d.ts +49 -53
- package/types/control/CompassButton.d.ts +4 -4
- package/types/control/Control.d.ts +7 -4
- package/types/control/DebugInfo.d.ts +3 -4
- package/types/control/EarthCoordinates.d.ts +6 -6
- package/types/control/EarthNavigation.d.ts +42 -0
- package/types/control/KeyboardNavigation.d.ts +3 -4
- package/types/control/LayerSwitcher.d.ts +3 -5
- package/types/control/Lighting.d.ts +3 -3
- package/types/control/MouseNavigation.d.ts +47 -0
- package/types/control/ScaleControl.d.ts +3 -3
- package/types/control/ShowFps.d.ts +3 -4
- package/types/control/SimpleNavigation.d.ts +3 -6
- package/types/control/Sun.d.ts +8 -10
- package/types/control/ToggleWireframe.d.ts +3 -3
- package/types/control/TouchNavigation.d.ts +48 -0
- package/types/control/ZoomControl.d.ts +3 -4
- package/types/control/index.d.ts +3 -1
- package/types/ellipsoid/Ellipsoid.d.ts +47 -43
- package/types/ellipsoid/wgs84.d.ts +3 -2
- package/types/entity/BaseBillboard.d.ts +41 -34
- package/types/entity/Billboard.d.ts +7 -7
- package/types/entity/BillboardHandler.d.ts +4 -0
- package/types/entity/Entity.d.ts +101 -83
- package/types/entity/EntityCollection.d.ts +57 -43
- package/types/entity/GeoObject.d.ts +111 -0
- package/types/entity/GeoObjectHandler.d.ts +77 -0
- package/types/entity/Geometry.d.ts +9 -7
- package/types/entity/GeometryHandler.d.ts +2 -2
- package/types/entity/Label.d.ts +24 -29
- package/types/entity/LabelHandler.d.ts +9 -2
- package/types/entity/LabelWorker.d.ts +9 -0
- package/types/entity/PointCloud.d.ts +8 -8
- package/types/entity/PointCloudHandler.d.ts +3 -3
- package/types/entity/Polyline.d.ts +58 -55
- package/types/entity/Ray.d.ts +19 -18
- package/types/entity/Strip.d.ts +8 -7
- package/types/entity/StripHandler.d.ts +3 -3
- package/types/entity/index.d.ts +7 -7
- package/types/input/KeyboardHandler.d.ts +10 -0
- package/types/input/MouseHandler.d.ts +5 -0
- package/types/input/TouchHandler.d.ts +5 -0
- package/types/layer/BaseGeoImage.d.ts +23 -35
- package/types/layer/CanvasTiles.d.ts +15 -22
- package/types/layer/GeoImage.d.ts +5 -18
- package/types/layer/GeoVideo.d.ts +5 -30
- package/types/layer/KML.d.ts +20 -15
- package/types/layer/Layer.d.ts +326 -0
- package/types/layer/Material.d.ts +45 -0
- package/types/layer/Vector.d.ts +208 -0
- package/types/layer/WMS.d.ts +4 -7
- package/types/layer/XYZ.d.ts +19 -25
- package/types/light/LightSource.d.ts +54 -53
- package/types/math/Line2.d.ts +11 -0
- package/types/math/Line3.d.ts +10 -0
- package/types/math/Mat3.d.ts +30 -18
- package/types/math/Mat4.d.ts +71 -52
- package/types/math/Plane.d.ts +5 -4
- package/types/math/Quat.d.ts +379 -0
- package/types/math/Ray.d.ts +82 -0
- package/types/math/Vec2.d.ts +102 -101
- package/types/math/Vec3.d.ts +143 -142
- package/types/math/Vec4.d.ts +40 -39
- package/types/math/coder.d.ts +12 -11
- package/types/math.d.ts +8 -8
- package/types/mercator.d.ts +3 -3
- package/types/proj/EPSG3857.d.ts +3 -2
- package/types/proj/EPSG4326.d.ts +3 -2
- package/types/proj/Proj.d.ts +42 -0
- package/types/quadTree/EntityCollectionNode.d.ts +34 -0
- package/types/quadTree/Node.d.ts +61 -0
- package/types/renderer/Renderer.d.ts +300 -0
- package/types/renderer/RendererEvents.d.ts +10 -7
- package/types/scene/BaseNode.d.ts +9 -9
- package/types/scene/Planet.d.ts +131 -126
- package/types/scene/RenderNode.d.ts +22 -23
- package/types/segment/Segment.d.ts +279 -0
- package/types/segment/SegmentLonLat.d.ts +16 -0
- package/types/shaders/geoObject.d.ts +3 -0
- package/types/shapes/BaseShape.d.ts +43 -40
- package/types/shapes/Sphere.d.ts +7 -7
- package/types/terrain/BilTerrain.d.ts +0 -1
- package/types/terrain/EmptyTerrain.d.ts +4 -4
- package/types/terrain/GlobusTerrain.d.ts +17 -54
- package/types/terrain/MapboxTerrain.d.ts +0 -1
- package/types/utils/GeoImageCreator.d.ts +3 -2
- package/types/utils/TextureAtlas.d.ts +8 -8
- package/types/utils/shared.d.ts +25 -24
- package/types/webgl/Framebuffer.d.ts +5 -5
- package/types/webgl/Handler.d.ts +68 -43
- package/types/webgl/Multisample.d.ts +5 -5
- package/types/webgl/Program.d.ts +8 -2
- package/types/webgl/ProgramController.d.ts +18 -13
- package/src/og/inherits.js +0 -8
- package/src/og/utils/polylabel.js +0 -176
- package/types/inherits.d.ts +0 -4
package/types/math/Vec3.d.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* @param {number} [x] - First cvalue.
|
|
5
5
|
* @param {number} [y] - Second value.
|
|
6
6
|
* @param {number} [z] - Third value.
|
|
7
|
-
* @returns {
|
|
7
|
+
* @returns {Vec3} -
|
|
8
8
|
*/
|
|
9
|
-
export function vec3(x?: number, y?: number, z?: number):
|
|
9
|
+
export function vec3(x?: number, y?: number, z?: number): Vec3;
|
|
10
10
|
/**
|
|
11
11
|
* Class represents a 3d vector.
|
|
12
12
|
* @class
|
|
@@ -41,116 +41,116 @@ export class Vec3 {
|
|
|
41
41
|
* @param {number} value - Double type value.
|
|
42
42
|
* @param {Vec3} high - Out vector high values.
|
|
43
43
|
* @param {Vec3} low - Out vector low values.
|
|
44
|
-
* @returns {Array.<number
|
|
44
|
+
* @returns {Array.<number>} Encoded array. (exactly 2 entries)
|
|
45
45
|
*/
|
|
46
|
-
static doubleToTwoFloats(v: any, high: Vec3, low: Vec3): Array<number
|
|
46
|
+
static doubleToTwoFloats(v: any, high: Vec3, low: Vec3): Array<number>;
|
|
47
47
|
/**
|
|
48
48
|
* Separate 63 bit Vec3 to two Vec3 32 bit float values.
|
|
49
49
|
* @function
|
|
50
50
|
* @param {number} value - Double type value.
|
|
51
51
|
* @param {Float32Array} high - Out vector high values.
|
|
52
52
|
* @param {Float32Array} low - Out vector low values.
|
|
53
|
-
* @returns {Array.<number
|
|
53
|
+
* @returns {Array.<number>} Encoded array. (exactly 2 entries)
|
|
54
54
|
*/
|
|
55
|
-
static doubleToTwoFloat32Array(v: any, high: Float32Array, low: Float32Array): Array<number
|
|
55
|
+
static doubleToTwoFloat32Array(v: any, high: Float32Array, low: Float32Array): Array<number>;
|
|
56
56
|
/**
|
|
57
57
|
* Creates 3d vector from array.
|
|
58
58
|
* @function
|
|
59
|
-
* @param {Array.<number
|
|
60
|
-
* @returns {
|
|
59
|
+
* @param {Array.<number>} arr - Input array (exactly 3 entries)
|
|
60
|
+
* @returns {Vec3} -
|
|
61
61
|
*/
|
|
62
|
-
static fromVec(arr: Array<number
|
|
62
|
+
static fromVec(arr: Array<number>): Vec3;
|
|
63
63
|
/**
|
|
64
64
|
* Gets angle between two vectors.
|
|
65
65
|
* @static
|
|
66
|
-
* @param {
|
|
67
|
-
* @param {
|
|
66
|
+
* @param {Vec3} a - First vector.
|
|
67
|
+
* @param {Vec3} b - Second vector.
|
|
68
68
|
* @returns {number} -
|
|
69
69
|
*/
|
|
70
|
-
static angle(a:
|
|
70
|
+
static angle(a: Vec3, b: Vec3): number;
|
|
71
71
|
/**
|
|
72
72
|
* Returns two vectors linear interpolation.
|
|
73
73
|
* @static
|
|
74
|
-
* @param {
|
|
75
|
-
* @param {
|
|
74
|
+
* @param {Vec3} v1 - Start vector.
|
|
75
|
+
* @param {Vec3} v2 - End vector.
|
|
76
76
|
* @param {number} l - Interpolate value.
|
|
77
|
-
* @returns {
|
|
77
|
+
* @returns {Vec3} -
|
|
78
78
|
*/
|
|
79
|
-
static lerp(v1:
|
|
79
|
+
static lerp(v1: Vec3, v2: Vec3, l: number): Vec3;
|
|
80
80
|
/**
|
|
81
81
|
* Returns summary vector.
|
|
82
82
|
* @static
|
|
83
|
-
* @param {
|
|
84
|
-
* @param {
|
|
85
|
-
* @returns {
|
|
83
|
+
* @param {Vec3} a - First vector.
|
|
84
|
+
* @param {Vec3} b - Second vector.
|
|
85
|
+
* @returns {Vec3} - Summary vector.
|
|
86
86
|
*/
|
|
87
|
-
static add(a:
|
|
87
|
+
static add(a: Vec3, b: Vec3): Vec3;
|
|
88
88
|
/**
|
|
89
89
|
* Returns two vectors subtraction.
|
|
90
90
|
* @static
|
|
91
|
-
* @param {
|
|
92
|
-
* @param {
|
|
93
|
-
* @returns {
|
|
91
|
+
* @param {Vec3} a - First vector.
|
|
92
|
+
* @param {Vec3} b - Second vector.
|
|
93
|
+
* @returns {Vec3} - Vectors subtraction.
|
|
94
94
|
*/
|
|
95
|
-
static sub(a:
|
|
95
|
+
static sub(a: Vec3, b: Vec3): Vec3;
|
|
96
96
|
/**
|
|
97
97
|
* Returns scaled vector.
|
|
98
98
|
* @static
|
|
99
|
-
* @param {
|
|
99
|
+
* @param {Vec3} a - Input vector.
|
|
100
100
|
* @param {number} scale - Scale value.
|
|
101
|
-
* @returns {
|
|
101
|
+
* @returns {Vec3} -
|
|
102
102
|
*/
|
|
103
|
-
static scale(a:
|
|
103
|
+
static scale(a: Vec3, scale: number): Vec3;
|
|
104
104
|
/**
|
|
105
105
|
* Returns two vectors production.
|
|
106
106
|
* @static
|
|
107
|
-
* @param {
|
|
108
|
-
* @param {
|
|
109
|
-
* @returns {
|
|
107
|
+
* @param {Vec3} a - First vector.
|
|
108
|
+
* @param {Vec3} b - Second vector.
|
|
109
|
+
* @returns {Vec3} -
|
|
110
110
|
*/
|
|
111
|
-
static mul(a:
|
|
111
|
+
static mul(a: Vec3, b: Vec3): Vec3;
|
|
112
112
|
/**
|
|
113
113
|
* Returns true if two vectors are non collinear.
|
|
114
114
|
* @public
|
|
115
|
-
* @param {
|
|
116
|
-
* @param {
|
|
117
|
-
* @returns {
|
|
115
|
+
* @param {Vec3} a - First vector.
|
|
116
|
+
* @param {Vec3} b - Second vector.
|
|
117
|
+
* @returns {Vec3} -
|
|
118
118
|
*/
|
|
119
|
-
public static noncollinear(a:
|
|
119
|
+
public static noncollinear(a: Vec3, b: Vec3): Vec3;
|
|
120
120
|
/**
|
|
121
121
|
* Get projection of the vector to plane where n - normal to the plane.
|
|
122
122
|
* @static
|
|
123
|
-
* @param {
|
|
124
|
-
* @param {
|
|
125
|
-
|
|
126
|
-
* @returns {
|
|
123
|
+
* @param {Vec3} b - Vector to project.
|
|
124
|
+
* @param {Vec3} n - Plane normal.
|
|
125
|
+
* @param {Vec3} [def] - Default value for non existed result.
|
|
126
|
+
* @returns {Vec3} -
|
|
127
127
|
*/
|
|
128
|
-
static proj_b_to_plane(b:
|
|
128
|
+
static proj_b_to_plane(b: Vec3, n: Vec3, def?: Vec3): Vec3;
|
|
129
129
|
/**
|
|
130
130
|
* Get projection of the first vector to the second.
|
|
131
131
|
* @static
|
|
132
|
-
* @param {
|
|
133
|
-
* @param {
|
|
134
|
-
* @returns {
|
|
132
|
+
* @param {Vec3} b - First vector.
|
|
133
|
+
* @param {Vec3} a - Second vector.
|
|
134
|
+
* @returns {Vec3} -
|
|
135
135
|
*/
|
|
136
|
-
static proj_b_to_a(b:
|
|
136
|
+
static proj_b_to_a(b: Vec3, a: Vec3): Vec3;
|
|
137
137
|
/**
|
|
138
138
|
* Makes vectors normalized and orthogonal to each other.
|
|
139
139
|
* Normalizes normal. Normalizes tangent and makes sure it is orthogonal to normal (that is, angle between them is 90 degrees).
|
|
140
140
|
* @static
|
|
141
|
-
* @param {
|
|
142
|
-
* @param {
|
|
143
|
-
* @returns {
|
|
141
|
+
* @param {Vec3} normal - Normal vector.
|
|
142
|
+
* @param {Vec3} tangent - Tangent vector.
|
|
143
|
+
* @returns {Vec3} -
|
|
144
144
|
*/
|
|
145
|
-
static orthoNormalize(normal:
|
|
145
|
+
static orthoNormalize(normal: Vec3, tangent: Vec3): Vec3;
|
|
146
146
|
/**
|
|
147
147
|
* Returns vector components division product one to another.
|
|
148
148
|
* @static
|
|
149
|
-
* @param {
|
|
150
|
-
* @param {
|
|
151
|
-
* @returns {
|
|
149
|
+
* @param {Vec3} a - First vector.
|
|
150
|
+
* @param {Vec3} b - Second vector.
|
|
151
|
+
* @returns {Vec3} -
|
|
152
152
|
*/
|
|
153
|
-
static div(a:
|
|
153
|
+
static div(a: Vec3, b: Vec3): Vec3;
|
|
154
154
|
static get LERP_DELTA(): number;
|
|
155
155
|
constructor(x: any, y: any, z: any);
|
|
156
156
|
/**
|
|
@@ -171,15 +171,15 @@ export class Vec3 {
|
|
|
171
171
|
/**
|
|
172
172
|
* Converts to 4d vector, Fourth value is 1.0.
|
|
173
173
|
* @public
|
|
174
|
-
* @returns {
|
|
174
|
+
* @returns {Vec4} -
|
|
175
175
|
*/
|
|
176
|
-
public toVec4():
|
|
176
|
+
public toVec4(): Vec4;
|
|
177
177
|
/**
|
|
178
178
|
* Returns clone vector.
|
|
179
179
|
* @public
|
|
180
|
-
* @returns {
|
|
180
|
+
* @returns {Vec3} -
|
|
181
181
|
*/
|
|
182
|
-
public clone():
|
|
182
|
+
public clone(): Vec3;
|
|
183
183
|
/**
|
|
184
184
|
* Converts vector to text string.
|
|
185
185
|
* @public
|
|
@@ -195,23 +195,23 @@ export class Vec3 {
|
|
|
195
195
|
/**
|
|
196
196
|
* Get projection of the first vector to the second.
|
|
197
197
|
* @static
|
|
198
|
-
* @param {
|
|
199
|
-
* @returns {
|
|
198
|
+
* @param {Vec3} a - Project vector.
|
|
199
|
+
* @returns {Vec3} -
|
|
200
200
|
*/
|
|
201
|
-
projToVec(a:
|
|
201
|
+
projToVec(a: Vec3): Vec3;
|
|
202
202
|
/**
|
|
203
203
|
* Compares with vector. Returns true if it equals another.
|
|
204
204
|
* @public
|
|
205
|
-
* @param {
|
|
205
|
+
* @param {Vec3} p - Vector to compare.
|
|
206
206
|
* @returns {boolean} -
|
|
207
207
|
*/
|
|
208
|
-
public equal(p:
|
|
208
|
+
public equal(p: Vec3): boolean;
|
|
209
209
|
/**
|
|
210
210
|
* Copy input vector's values.
|
|
211
|
-
* @param {
|
|
212
|
-
* @returns {
|
|
211
|
+
* @param {Vec3} point3 - Vector to copy.
|
|
212
|
+
* @returns {Vec3} -
|
|
213
213
|
*/
|
|
214
|
-
copy(point3:
|
|
214
|
+
copy(point3: Vec3): Vec3;
|
|
215
215
|
/**
|
|
216
216
|
* Gets vector's length.
|
|
217
217
|
* @public
|
|
@@ -227,226 +227,226 @@ export class Vec3 {
|
|
|
227
227
|
/**
|
|
228
228
|
* Converts vector's values to a quaternion object.
|
|
229
229
|
* @public
|
|
230
|
-
* @returns {
|
|
230
|
+
* @returns {Quat} -
|
|
231
231
|
*/
|
|
232
|
-
public getQuat():
|
|
232
|
+
public getQuat(): Quat;
|
|
233
233
|
/**
|
|
234
234
|
* Adds vector to the current.
|
|
235
235
|
* @public
|
|
236
|
-
* @param {
|
|
237
|
-
* @returns {
|
|
236
|
+
* @param {Vec3} point3 - Point to add.
|
|
237
|
+
* @returns {Vec3} -
|
|
238
238
|
*/
|
|
239
|
-
public addA(point3:
|
|
239
|
+
public addA(point3: Vec3): Vec3;
|
|
240
240
|
/**
|
|
241
241
|
* Gets two vectors summarization.
|
|
242
242
|
* @public
|
|
243
|
-
* @param {
|
|
244
|
-
* @returns {
|
|
243
|
+
* @param {Vec3} point3 - Vector to add.
|
|
244
|
+
* @returns {Vec3} Returns a sum vector.
|
|
245
245
|
*/
|
|
246
|
-
public add(point3:
|
|
246
|
+
public add(point3: Vec3): Vec3;
|
|
247
247
|
/**
|
|
248
248
|
* Subtract vector from the current.
|
|
249
249
|
* @public
|
|
250
|
-
* @param {
|
|
251
|
-
* @returns {
|
|
250
|
+
* @param {Vec3} point3 - Subtract vector.
|
|
251
|
+
* @returns {Vec3} -
|
|
252
252
|
*/
|
|
253
|
-
public subA(point3:
|
|
253
|
+
public subA(point3: Vec3): Vec3;
|
|
254
254
|
/**
|
|
255
255
|
* Gets vector subtraction.
|
|
256
256
|
* @public
|
|
257
|
-
* @param {
|
|
258
|
-
* @return {
|
|
257
|
+
* @param {Vec3} point3 - Subtract vector.
|
|
258
|
+
* @return {Vec3} Returns new instance of a subtraction
|
|
259
259
|
*/
|
|
260
|
-
public sub(point3:
|
|
260
|
+
public sub(point3: Vec3): Vec3;
|
|
261
261
|
/**
|
|
262
262
|
* Scale current vector.
|
|
263
263
|
* @public
|
|
264
264
|
* @param {number} scale - Scale value.
|
|
265
|
-
* @returns {
|
|
265
|
+
* @returns {Vec3} -
|
|
266
266
|
*/
|
|
267
|
-
public scale(scale: number):
|
|
267
|
+
public scale(scale: number): Vec3;
|
|
268
268
|
/**
|
|
269
269
|
* Scale current vector to another instance.
|
|
270
270
|
* @public
|
|
271
271
|
* @param {number} scale - Scale value.
|
|
272
|
-
* @returns {
|
|
272
|
+
* @returns {Vec3} -
|
|
273
273
|
*/
|
|
274
|
-
public scaleTo(scale: number):
|
|
274
|
+
public scaleTo(scale: number): Vec3;
|
|
275
275
|
/**
|
|
276
276
|
* Multiply current vector object to another and store result in the current instance.
|
|
277
277
|
* @public
|
|
278
|
-
* @param {
|
|
279
|
-
* @returns {
|
|
278
|
+
* @param {Vec3} vec - Multiply vector.
|
|
279
|
+
* @returns {Vec3} -
|
|
280
280
|
*/
|
|
281
|
-
public mulA(vec:
|
|
281
|
+
public mulA(vec: Vec3): Vec3;
|
|
282
282
|
/**
|
|
283
283
|
* Multiply current vector object to another and returns new vector instance.
|
|
284
284
|
* @public
|
|
285
|
-
* @param {
|
|
286
|
-
* @returns {
|
|
285
|
+
* @param {Vec3} vec - Multiply vector.
|
|
286
|
+
* @returns {Vec3} -
|
|
287
287
|
*/
|
|
288
|
-
public mul(vec:
|
|
288
|
+
public mul(vec: Vec3): Vec3;
|
|
289
289
|
/**
|
|
290
290
|
* Divide current vector's components to another. Results stores in the current vector object.
|
|
291
291
|
* @public
|
|
292
|
-
* @param {
|
|
293
|
-
* @returns {
|
|
292
|
+
* @param {Vec3} vec - Div vector.
|
|
293
|
+
* @returns {Vec3} -
|
|
294
294
|
*/
|
|
295
|
-
public divA(vec:
|
|
295
|
+
public divA(vec: Vec3): Vec3;
|
|
296
296
|
/**
|
|
297
297
|
* Divide current vector's components to another and returns new vector instance.
|
|
298
298
|
* @public
|
|
299
|
-
* @param {
|
|
300
|
-
* @returns {
|
|
299
|
+
* @param {Vec3} vec - Div vector.
|
|
300
|
+
* @returns {Vec3} -
|
|
301
301
|
*/
|
|
302
|
-
public div(vec:
|
|
302
|
+
public div(vec: Vec3): Vec3;
|
|
303
303
|
/**
|
|
304
304
|
* Gets vectors dot production.
|
|
305
305
|
* @public
|
|
306
|
-
* @param {
|
|
306
|
+
* @param {Vec3} point3 - Another vector.
|
|
307
307
|
* @returns {number} -
|
|
308
308
|
*/
|
|
309
|
-
public dot(point3:
|
|
309
|
+
public dot(point3: Vec3): number;
|
|
310
310
|
/**
|
|
311
311
|
* Gets vectors dot production.
|
|
312
312
|
* @public
|
|
313
|
-
* @param {Array.<number
|
|
313
|
+
* @param {Array.<number>} arr - Array vector. (exactly 3 entries)
|
|
314
314
|
* @returns {number} -
|
|
315
315
|
*/
|
|
316
|
-
public dotArr(arr: Array<number
|
|
316
|
+
public dotArr(arr: Array<number>): number;
|
|
317
317
|
/**
|
|
318
318
|
* Gets vectors cross production.
|
|
319
319
|
* @public
|
|
320
|
-
* @param {
|
|
321
|
-
* @returns {
|
|
320
|
+
* @param {Vec3} point3 - Another vector.
|
|
321
|
+
* @returns {Vec3} -
|
|
322
322
|
*/
|
|
323
|
-
public cross(point3:
|
|
323
|
+
public cross(point3: Vec3): Vec3;
|
|
324
324
|
/**
|
|
325
325
|
* Sets vector to zero.
|
|
326
326
|
* @public
|
|
327
|
-
* @returns {
|
|
327
|
+
* @returns {Vec3} -
|
|
328
328
|
*/
|
|
329
|
-
public clear():
|
|
329
|
+
public clear(): Vec3;
|
|
330
330
|
/**
|
|
331
331
|
* Returns normalized vector.
|
|
332
332
|
* @public
|
|
333
|
-
* @returns {
|
|
333
|
+
* @returns {Vec3} -
|
|
334
334
|
*/
|
|
335
|
-
public getNormal():
|
|
335
|
+
public getNormal(): Vec3;
|
|
336
336
|
/**
|
|
337
337
|
* Returns normalized vector.
|
|
338
338
|
* @deprecated
|
|
339
339
|
* @public
|
|
340
|
-
* @returns {
|
|
340
|
+
* @returns {Vec3} -
|
|
341
341
|
*/
|
|
342
|
-
public normal():
|
|
342
|
+
public normal(): Vec3;
|
|
343
343
|
/**
|
|
344
344
|
* Returns normalized negate vector.
|
|
345
345
|
* @public
|
|
346
|
-
* @returns {
|
|
346
|
+
* @returns {Vec3} -
|
|
347
347
|
*/
|
|
348
|
-
public normalNegate():
|
|
348
|
+
public normalNegate(): Vec3;
|
|
349
349
|
/**
|
|
350
350
|
* Returns normalized negate scale vector.
|
|
351
351
|
* @public
|
|
352
|
-
* @returns {
|
|
352
|
+
* @returns {Vec3} -
|
|
353
353
|
*/
|
|
354
|
-
public normalNegateScale(scale: any):
|
|
354
|
+
public normalNegateScale(scale: any): Vec3;
|
|
355
355
|
/**
|
|
356
356
|
* Returns normalized scale vector.
|
|
357
357
|
* @public
|
|
358
|
-
* @returns {
|
|
358
|
+
* @returns {Vec3} -
|
|
359
359
|
*/
|
|
360
|
-
public normalScale(scale: any):
|
|
360
|
+
public normalScale(scale: any): Vec3;
|
|
361
361
|
/**
|
|
362
362
|
* Normalize current vector.
|
|
363
363
|
* @public
|
|
364
|
-
* @returns {
|
|
364
|
+
* @returns {Vec3} -
|
|
365
365
|
*/
|
|
366
|
-
public normalize():
|
|
366
|
+
public normalize(): Vec3;
|
|
367
367
|
/**
|
|
368
368
|
* Converts vector to a number array.
|
|
369
369
|
* @public
|
|
370
|
-
* @returns {Array.<number
|
|
370
|
+
* @returns {Array.<number>} - (exactly 3 entries)
|
|
371
371
|
* @deprecated
|
|
372
372
|
*/
|
|
373
|
-
public toVec(): Array<number
|
|
373
|
+
public toVec(): Array<number>;
|
|
374
374
|
/**
|
|
375
375
|
* Converts vector to a number array.
|
|
376
376
|
* @public
|
|
377
|
-
* @returns {Array.<number
|
|
377
|
+
* @returns {Array.<number>} - (exactly 3 entries)
|
|
378
378
|
*/
|
|
379
|
-
public toArray(): Array<number
|
|
379
|
+
public toArray(): Array<number>;
|
|
380
380
|
/**
|
|
381
381
|
* Gets distance to point.
|
|
382
382
|
* @public
|
|
383
|
-
* @param {
|
|
383
|
+
* @param {Vec3} point3 - Distant point.
|
|
384
384
|
* @returns {number} -
|
|
385
385
|
*/
|
|
386
|
-
public distance(point3:
|
|
386
|
+
public distance(point3: Vec3): number;
|
|
387
387
|
/**
|
|
388
388
|
* Sets vector's values.
|
|
389
389
|
* @public
|
|
390
390
|
* @param {number} x - Value X.
|
|
391
391
|
* @param {number} y - Value Y.
|
|
392
392
|
* @param {number} z - Value Z.
|
|
393
|
-
* @returns {
|
|
393
|
+
* @returns {Vec3} -
|
|
394
394
|
*/
|
|
395
|
-
public set(x: number, y: number, z: number):
|
|
395
|
+
public set(x: number, y: number, z: number): Vec3;
|
|
396
396
|
/**
|
|
397
397
|
* Negate current vector.
|
|
398
398
|
* @public
|
|
399
|
-
* @returns {
|
|
399
|
+
* @returns {Vec3} -
|
|
400
400
|
*/
|
|
401
|
-
public negate():
|
|
401
|
+
public negate(): Vec3;
|
|
402
402
|
/**
|
|
403
403
|
* Negate current vector to another instance.
|
|
404
404
|
* @public
|
|
405
|
-
* @returns {
|
|
405
|
+
* @returns {Vec3} -
|
|
406
406
|
*/
|
|
407
|
-
public negateTo():
|
|
407
|
+
public negateTo(): Vec3;
|
|
408
408
|
/**
|
|
409
409
|
* Gets projected point coordinates of the current vector on the ray.
|
|
410
410
|
* @public
|
|
411
|
-
* @param {
|
|
412
|
-
* @param {
|
|
413
|
-
* @returns {
|
|
411
|
+
* @param {Vec3} pos - Ray position.
|
|
412
|
+
* @param {Vec3} direction - Ray direction.
|
|
413
|
+
* @returns {Vec3} -
|
|
414
414
|
*/
|
|
415
|
-
public projToRay(pos:
|
|
415
|
+
public projToRay(pos: Vec3, direction: Vec3): Vec3;
|
|
416
416
|
/**
|
|
417
417
|
* Gets angle between two vectors.
|
|
418
418
|
* @public
|
|
419
|
-
* @param {
|
|
419
|
+
* @param {Vec3} a - Another vector.
|
|
420
420
|
* @returns {number} -
|
|
421
421
|
*/
|
|
422
|
-
public angle(a:
|
|
422
|
+
public angle(a: Vec3): number;
|
|
423
423
|
/**
|
|
424
424
|
* Returns two vectors linear interpolation.
|
|
425
425
|
* @public
|
|
426
|
-
* @param {
|
|
426
|
+
* @param {Vec3} v2 - End vector.
|
|
427
427
|
* @param {number} l - Interpolate value.
|
|
428
|
-
* @returns {
|
|
428
|
+
* @returns {Vec3} -
|
|
429
429
|
*/
|
|
430
|
-
public lerp(v2:
|
|
430
|
+
public lerp(v2: Vec3, l: number): Vec3;
|
|
431
431
|
/**
|
|
432
432
|
* Returns vector interpolation by v(t) = v1 * t + v2 * (1 - t)
|
|
433
433
|
* @public
|
|
434
|
-
* @param {
|
|
434
|
+
* @param {Vec3} v2 - End vector.
|
|
435
435
|
* @param {number} t - Interpolate value.
|
|
436
|
-
* @returns {
|
|
436
|
+
* @returns {Vec3} -
|
|
437
437
|
*/
|
|
438
|
-
public smerp(v2:
|
|
438
|
+
public smerp(v2: Vec3, t: number): Vec3;
|
|
439
439
|
/**
|
|
440
440
|
* Spherically interpolates between two vectors.
|
|
441
441
|
* Interpolates between current and v2 vector by amount t. The difference between this and linear interpolation (aka, "lerp") is that
|
|
442
442
|
* the vectors are treated as directions rather than points in space. The direction of the returned vector is interpolated
|
|
443
443
|
* by the angle and its magnitude is interpolated between the magnitudes of from and to.
|
|
444
444
|
* @public
|
|
445
|
-
* @param {
|
|
445
|
+
* @param {Vec3} v2 -
|
|
446
446
|
* @param {number} t - The parameter t is clamped to the range [0, 1].
|
|
447
|
-
* @returns {
|
|
447
|
+
* @returns {Vec3} -
|
|
448
448
|
*/
|
|
449
|
-
public slerp(v2:
|
|
449
|
+
public slerp(v2: Vec3, t: number): Vec3;
|
|
450
450
|
/**
|
|
451
451
|
* Gets the shortest arc quaternion to rotate this vector to the destination vector.
|
|
452
452
|
* @param {Vec3} dest -
|
|
@@ -456,4 +456,5 @@ export class Vec3 {
|
|
|
456
456
|
*/
|
|
457
457
|
getRotationTo(dest: Vec3, fallbackAxis: Vec3): Quat;
|
|
458
458
|
}
|
|
459
|
+
import { Vec4 } from "./Vec4.js";
|
|
459
460
|
import { Quat } from "./Quat.js";
|