@math.gl/geometry-utils 4.2.0-alpha.5
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/LICENSE +140 -0
- package/README.md +8 -0
- package/dist/attribute-compression.d.ts +50 -0
- package/dist/attribute-compression.d.ts.map +1 -0
- package/dist/attribute-compression.js +184 -0
- package/dist/attribute-compression.js.map +1 -0
- package/dist/attribute-iterator.d.ts +8 -0
- package/dist/attribute-iterator.d.ts.map +1 -0
- package/dist/attribute-iterator.js +25 -0
- package/dist/attribute-iterator.js.map +1 -0
- package/dist/compute-vertex-normals.d.ts +4 -0
- package/dist/compute-vertex-normals.d.ts.map +1 -0
- package/dist/compute-vertex-normals.js +54 -0
- package/dist/compute-vertex-normals.js.map +1 -0
- package/dist/constants.d.ts +52 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +39 -0
- package/dist/constants.js.map +1 -0
- package/dist/coordinates.d.ts +3 -0
- package/dist/coordinates.d.ts.map +1 -0
- package/dist/coordinates.js +8 -0
- package/dist/coordinates.js.map +1 -0
- package/dist/geometry.d.ts +20 -0
- package/dist/geometry.d.ts.map +1 -0
- package/dist/geometry.js +31 -0
- package/dist/geometry.js.map +1 -0
- package/dist/gl-type.d.ts +17 -0
- package/dist/gl-type.d.ts.map +1 -0
- package/dist/gl-type.js +69 -0
- package/dist/gl-type.js.map +1 -0
- package/dist/index.cjs +535 -0
- package/dist/index.cjs.map +6 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/primitive-iterator.d.ts +21 -0
- package/dist/primitive-iterator.d.ts.map +1 -0
- package/dist/primitive-iterator.js +117 -0
- package/dist/primitive-iterator.js.map +1 -0
- package/dist/rgb565.d.ts +5 -0
- package/dist/rgb565.d.ts.map +1 -0
- package/dist/rgb565.js +24 -0
- package/dist/rgb565.js.map +1 -0
- package/dist/typed-array-utils.d.ts +3 -0
- package/dist/typed-array-utils.d.ts.map +1 -0
- package/dist/typed-array-utils.js +16 -0
- package/dist/typed-array-utils.js.map +1 -0
- package/package.json +40 -0
- package/src/attribute-compression.ts +232 -0
- package/src/attribute-iterator.ts +28 -0
- package/src/compute-vertex-normals.ts +63 -0
- package/src/constants.ts +42 -0
- package/src/coordinates.ts +8 -0
- package/src/geometry.ts +49 -0
- package/src/gl-type.ts +87 -0
- package/src/index.ts +38 -0
- package/src/primitive-iterator.ts +145 -0
- package/src/rgb565.ts +26 -0
- package/src/typed-array-utils.ts +16 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Uber Technologies, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Some primitive tessellation approaches were originally inspired by the TDL WebGL samples under
|
|
26
|
+
the New BSD License:
|
|
27
|
+
|
|
28
|
+
Copyright (c) 2011, Google Inc. All rights reserved.
|
|
29
|
+
|
|
30
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted
|
|
31
|
+
provided that the following conditions are met:
|
|
32
|
+
|
|
33
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions
|
|
34
|
+
and the following disclaimer.
|
|
35
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of
|
|
36
|
+
conditions and the following disclaimer in the documentation and/or other materials provided
|
|
37
|
+
with the distribution.
|
|
38
|
+
3. Neither the name of Google Inc. nor the names of its contributors may be used to endorse or
|
|
39
|
+
promote products derived from this software without specific prior written permission.
|
|
40
|
+
|
|
41
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
|
42
|
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
43
|
+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
44
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
45
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
46
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
|
47
|
+
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
48
|
+
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
math.gl builds on docs and code from "gl-matrix", which is MIT licensed as follows:
|
|
53
|
+
|
|
54
|
+
Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.
|
|
55
|
+
|
|
56
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
57
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
58
|
+
in the Software without restriction, including without limitation the rights
|
|
59
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
60
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
61
|
+
furnished to do so, subject to the following conditions:
|
|
62
|
+
|
|
63
|
+
The above copyright notice and this permission notice shall be included in
|
|
64
|
+
all copies or substantial portions of the Software.
|
|
65
|
+
|
|
66
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
67
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
68
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
69
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
70
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
71
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
72
|
+
THE SOFTWARE.
|
|
73
|
+
|
|
74
|
+
--
|
|
75
|
+
|
|
76
|
+
math.gl builds on docs and code from THREE.js, which is MIT licensed as follows:
|
|
77
|
+
|
|
78
|
+
The MIT License
|
|
79
|
+
|
|
80
|
+
Copyright © 2010-2017 three.js authors
|
|
81
|
+
|
|
82
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
83
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
84
|
+
in the Software without restriction, including without limitation the rights
|
|
85
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
86
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
87
|
+
furnished to do so, subject to the following conditions:
|
|
88
|
+
|
|
89
|
+
The above copyright notice and this permission notice shall be included in
|
|
90
|
+
all copies or substantial portions of the Software.
|
|
91
|
+
|
|
92
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
93
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
94
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
95
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
96
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
97
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
98
|
+
THE SOFTWARE.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
math.gl includes certain files from Cesium (https://github.com/AnalyticalGraphicsInc/cesium) under the Apache 2 License:
|
|
103
|
+
|
|
104
|
+
Copyright 2011-2018 CesiumJS Contributors
|
|
105
|
+
|
|
106
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
107
|
+
you may not use this file except in compliance with the License.
|
|
108
|
+
You may obtain a copy of the License at
|
|
109
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
110
|
+
|
|
111
|
+
Unless required by applicable law or agreed to in writing, software
|
|
112
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
113
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
114
|
+
See the License for the specific language governing permissions and limitations under the License.
|
|
115
|
+
|
|
116
|
+
Cesium-derived code can be found in the submodule: modules/3d-tiles
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
The @math.gl/geometry primitive tessellators are adapted from luma.gl under the MIT License:
|
|
121
|
+
|
|
122
|
+
Copyright (c) 2020 vis.gl contributors
|
|
123
|
+
|
|
124
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
125
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
126
|
+
in the Software without restriction, including without limitation the rights
|
|
127
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
128
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
129
|
+
furnished to do so, subject to the following conditions:
|
|
130
|
+
|
|
131
|
+
The above copyright notice and this permission notice shall be included in
|
|
132
|
+
all copies or substantial portions of the Software.
|
|
133
|
+
|
|
134
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
135
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
136
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
137
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
138
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
139
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
140
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# @math.gl/geometry-utils
|
|
2
|
+
|
|
3
|
+
[math.gl](https://math.gl/docs) is a suite of math modules for 3D applications.
|
|
4
|
+
|
|
5
|
+
This module contains dependency-light utilities for typed-array geometry, primitive iteration,
|
|
6
|
+
vertex normals, packed colors, and compressed attributes.
|
|
7
|
+
|
|
8
|
+
For documentation please visit the [website](https://math.gl).
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Vector2, Vector3 } from '@math.gl/core';
|
|
2
|
+
type Vector4 = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
z: number;
|
|
6
|
+
w: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Encodes a normalized vector into two SNORM values following octahedral encoding.
|
|
10
|
+
*
|
|
11
|
+
* @param vector Normalized vector to encode.
|
|
12
|
+
* @param rangeMaximum Maximum value of the SNORM range.
|
|
13
|
+
* @param result Target for the two encoded components.
|
|
14
|
+
*/
|
|
15
|
+
export declare function octEncodeInRange(vector: Vector3, rangeMaximum: number, result: Vector2): Vector2;
|
|
16
|
+
/** Encodes a normalized vector into two 8-bit octahedral components. */
|
|
17
|
+
export declare function octEncode(vector: Vector3, result: Vector2): Vector2;
|
|
18
|
+
/** Encodes a normalized vector into four 8-bit octahedral components. */
|
|
19
|
+
export declare function octEncodeToVector4(vector: Vector3, result: Vector4): Vector4;
|
|
20
|
+
/**
|
|
21
|
+
* Decodes two SNORM octahedral components into a normalized vector.
|
|
22
|
+
*
|
|
23
|
+
* @param x First encoded component.
|
|
24
|
+
* @param y Second encoded component.
|
|
25
|
+
* @param rangeMaximum Maximum value of the SNORM range.
|
|
26
|
+
* @param result Target for the decoded vector.
|
|
27
|
+
*/
|
|
28
|
+
export declare function octDecodeInRange(x: number, y: number, rangeMaximum: number, result: Vector3): Vector3;
|
|
29
|
+
/** Decodes two 8-bit octahedral components into a normalized vector. */
|
|
30
|
+
export declare function octDecode(x: number, y: number, result: Vector3): Vector3;
|
|
31
|
+
/** Decodes four 8-bit octahedral components into a normalized vector. */
|
|
32
|
+
export declare function octDecodeFromVector4(encoded: Vector4, result: Vector3): Vector3;
|
|
33
|
+
/** Packs an octahedrally encoded two-component vector into one number. */
|
|
34
|
+
export declare function octPackFloat(encoded: Vector2): number;
|
|
35
|
+
/** Encodes a normalized vector into an octahedral representation packed into one number. */
|
|
36
|
+
export declare function octEncodeFloat(vector: Vector3): number;
|
|
37
|
+
/** Decodes an octahedral representation packed into one number. */
|
|
38
|
+
export declare function octDecodeFloat(value: number, result: Vector3): Vector3;
|
|
39
|
+
/** Packs three normalized vectors into two numeric octahedral values. */
|
|
40
|
+
export declare function octPack(vector1: Vector3, vector2: Vector3, vector3: Vector3, result: Vector2): Vector2;
|
|
41
|
+
/** Decodes three normalized vectors packed by {@link octPack}. */
|
|
42
|
+
export declare function octUnpack(packed: Vector2, vector1: Vector3, vector2: Vector3, vector3: Vector3): void;
|
|
43
|
+
/** Packs two normalized texture coordinates into one number with 12 bits per component. */
|
|
44
|
+
export declare function compressTextureCoordinates(textureCoordinates: Vector2): number;
|
|
45
|
+
/** Decompresses texture coordinates packed by {@link compressTextureCoordinates}. */
|
|
46
|
+
export declare function decompressTextureCoordinates(compressed: number, result: Vector2): Vector2;
|
|
47
|
+
/** Decodes delta- and ZigZag-encoded vertex buffers in place. */
|
|
48
|
+
export declare function zigZagDeltaDecode(uBuffer: Uint16Array, vBuffer: Uint16Array, heightBuffer?: Uint16Array | number[]): void;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=attribute-compression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribute-compression.d.ts","sourceRoot":"","sources":["../src/attribute-compression.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,OAAO,EAAE,OAAO,EAA4B,MAAM,eAAe,CAAC;AAE1E,KAAK,OAAO,GAAG;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AA2B5D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,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CAI9E;AAED,qFAAqF;AACrF,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAMzF;AAED,iEAAiE;AACjE,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,EACpB,YAAY,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE,GACpC,IAAI,CAqBN"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
// Derived from Cesium under the Apache 2.0 license.
|
|
5
|
+
// https://github.com/CesiumGS/cesium/blob/main/LICENSE.md
|
|
6
|
+
import { Vector2, Vector3, assert, clamp, _MathUtils } from '@math.gl/core';
|
|
7
|
+
const RIGHT_SHIFT = 1 / 256;
|
|
8
|
+
const LEFT_SHIFT = 256;
|
|
9
|
+
const scratchVector2 = new Vector2();
|
|
10
|
+
const scratchVector3 = new Vector3();
|
|
11
|
+
const scratchEncodeVector2 = new Vector2();
|
|
12
|
+
const octEncodeScratch = new Vector2();
|
|
13
|
+
const uint8ForceArray = new Uint8Array(1);
|
|
14
|
+
function forceUint8(value) {
|
|
15
|
+
uint8ForceArray[0] = value;
|
|
16
|
+
return uint8ForceArray[0];
|
|
17
|
+
}
|
|
18
|
+
function fromSNorm(value, rangeMaximum = 255) {
|
|
19
|
+
return (clamp(value, 0, rangeMaximum) / rangeMaximum) * 2 - 1;
|
|
20
|
+
}
|
|
21
|
+
function toSNorm(value, rangeMaximum = 255) {
|
|
22
|
+
return Math.round((clamp(value, -1, 1) * 0.5 + 0.5) * rangeMaximum);
|
|
23
|
+
}
|
|
24
|
+
function signNotZero(value) {
|
|
25
|
+
return value < 0 ? -1 : 1;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Encodes a normalized vector into two SNORM values following octahedral encoding.
|
|
29
|
+
*
|
|
30
|
+
* @param vector Normalized vector to encode.
|
|
31
|
+
* @param rangeMaximum Maximum value of the SNORM range.
|
|
32
|
+
* @param result Target for the two encoded components.
|
|
33
|
+
*/
|
|
34
|
+
export function octEncodeInRange(vector, rangeMaximum, result) {
|
|
35
|
+
assert(vector);
|
|
36
|
+
assert(result);
|
|
37
|
+
scratchVector3.from(vector);
|
|
38
|
+
assert(Math.abs(scratchVector3.magnitudeSquared() - 1) <= _MathUtils.EPSILON6);
|
|
39
|
+
const denominator = Math.abs(vector.x) + Math.abs(vector.y) + Math.abs(vector.z);
|
|
40
|
+
result.x = vector.x / denominator;
|
|
41
|
+
result.y = vector.y / denominator;
|
|
42
|
+
if (vector.z < 0) {
|
|
43
|
+
const x = result.x;
|
|
44
|
+
const y = result.y;
|
|
45
|
+
result.x = (1 - Math.abs(y)) * signNotZero(x);
|
|
46
|
+
result.y = (1 - Math.abs(x)) * signNotZero(y);
|
|
47
|
+
}
|
|
48
|
+
result.x = toSNorm(result.x, rangeMaximum);
|
|
49
|
+
result.y = toSNorm(result.y, rangeMaximum);
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
/** Encodes a normalized vector into two 8-bit octahedral components. */
|
|
53
|
+
export function octEncode(vector, result) {
|
|
54
|
+
return octEncodeInRange(vector, 255, result);
|
|
55
|
+
}
|
|
56
|
+
/** Encodes a normalized vector into four 8-bit octahedral components. */
|
|
57
|
+
export function octEncodeToVector4(vector, result) {
|
|
58
|
+
octEncodeInRange(vector, 65535, octEncodeScratch);
|
|
59
|
+
result.x = forceUint8(octEncodeScratch.x * RIGHT_SHIFT);
|
|
60
|
+
result.y = forceUint8(octEncodeScratch.x);
|
|
61
|
+
result.z = forceUint8(octEncodeScratch.y * RIGHT_SHIFT);
|
|
62
|
+
result.w = forceUint8(octEncodeScratch.y);
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Decodes two SNORM octahedral components into a normalized vector.
|
|
67
|
+
*
|
|
68
|
+
* @param x First encoded component.
|
|
69
|
+
* @param y Second encoded component.
|
|
70
|
+
* @param rangeMaximum Maximum value of the SNORM range.
|
|
71
|
+
* @param result Target for the decoded vector.
|
|
72
|
+
*/
|
|
73
|
+
export function octDecodeInRange(x, y, rangeMaximum, result) {
|
|
74
|
+
assert(result);
|
|
75
|
+
if (x < 0 || x > rangeMaximum || y < 0 || y > rangeMaximum) {
|
|
76
|
+
throw new Error(`x and y must be unsigned normalized integers between 0 and ${rangeMaximum}`);
|
|
77
|
+
}
|
|
78
|
+
result.x = fromSNorm(x, rangeMaximum);
|
|
79
|
+
result.y = fromSNorm(y, rangeMaximum);
|
|
80
|
+
result.z = 1 - (Math.abs(result.x) + Math.abs(result.y));
|
|
81
|
+
if (result.z < 0) {
|
|
82
|
+
const oldX = result.x;
|
|
83
|
+
result.x = (1 - Math.abs(result.y)) * signNotZero(oldX);
|
|
84
|
+
result.y = (1 - Math.abs(oldX)) * signNotZero(result.y);
|
|
85
|
+
}
|
|
86
|
+
return result.normalize();
|
|
87
|
+
}
|
|
88
|
+
/** Decodes two 8-bit octahedral components into a normalized vector. */
|
|
89
|
+
export function octDecode(x, y, result) {
|
|
90
|
+
return octDecodeInRange(x, y, 255, result);
|
|
91
|
+
}
|
|
92
|
+
/** Decodes four 8-bit octahedral components into a normalized vector. */
|
|
93
|
+
export function octDecodeFromVector4(encoded, result) {
|
|
94
|
+
assert(encoded);
|
|
95
|
+
assert(result);
|
|
96
|
+
const { x, y, z, w } = encoded;
|
|
97
|
+
if (x < 0 || x > 255 || y < 0 || y > 255 || z < 0 || z > 255 || w < 0 || w > 255) {
|
|
98
|
+
throw new Error('x, y, z, and w must be unsigned normalized integers between 0 and 255');
|
|
99
|
+
}
|
|
100
|
+
return octDecodeInRange(x * LEFT_SHIFT + y, z * LEFT_SHIFT + w, 65535, result);
|
|
101
|
+
}
|
|
102
|
+
/** Packs an octahedrally encoded two-component vector into one number. */
|
|
103
|
+
export function octPackFloat(encoded) {
|
|
104
|
+
scratchVector2.from(encoded);
|
|
105
|
+
return 256 * scratchVector2.x + scratchVector2.y;
|
|
106
|
+
}
|
|
107
|
+
/** Encodes a normalized vector into an octahedral representation packed into one number. */
|
|
108
|
+
export function octEncodeFloat(vector) {
|
|
109
|
+
octEncode(vector, scratchEncodeVector2);
|
|
110
|
+
return octPackFloat(scratchEncodeVector2);
|
|
111
|
+
}
|
|
112
|
+
/** Decodes an octahedral representation packed into one number. */
|
|
113
|
+
export function octDecodeFloat(value, result) {
|
|
114
|
+
assert(Number.isFinite(value));
|
|
115
|
+
const temporary = value / 256;
|
|
116
|
+
const x = Math.floor(temporary);
|
|
117
|
+
const y = (temporary - x) * 256;
|
|
118
|
+
return octDecode(x, y, result);
|
|
119
|
+
}
|
|
120
|
+
/** Packs three normalized vectors into two numeric octahedral values. */
|
|
121
|
+
export function octPack(vector1, vector2, vector3, result) {
|
|
122
|
+
assert(vector1);
|
|
123
|
+
assert(vector2);
|
|
124
|
+
assert(vector3);
|
|
125
|
+
assert(result);
|
|
126
|
+
const encoded1 = octEncodeFloat(vector1);
|
|
127
|
+
const encoded2 = octEncodeFloat(vector2);
|
|
128
|
+
const encoded3 = octEncode(vector3, scratchEncodeVector2);
|
|
129
|
+
result.x = 65536 * encoded3.x + encoded1;
|
|
130
|
+
result.y = 65536 * encoded3.y + encoded2;
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
/** Decodes three normalized vectors packed by {@link octPack}. */
|
|
134
|
+
export function octUnpack(packed, vector1, vector2, vector3) {
|
|
135
|
+
let temporary = packed.x / 65536;
|
|
136
|
+
const x = Math.floor(temporary);
|
|
137
|
+
const encodedFloat1 = (temporary - x) * 65536;
|
|
138
|
+
temporary = packed.y / 65536;
|
|
139
|
+
const y = Math.floor(temporary);
|
|
140
|
+
const encodedFloat2 = (temporary - y) * 65536;
|
|
141
|
+
octDecodeFloat(encodedFloat1, vector1);
|
|
142
|
+
octDecodeFloat(encodedFloat2, vector2);
|
|
143
|
+
octDecode(x, y, vector3);
|
|
144
|
+
}
|
|
145
|
+
/** Packs two normalized texture coordinates into one number with 12 bits per component. */
|
|
146
|
+
export function compressTextureCoordinates(textureCoordinates) {
|
|
147
|
+
const x = (textureCoordinates.x * 4095) | 0;
|
|
148
|
+
const y = (textureCoordinates.y * 4095) | 0;
|
|
149
|
+
return 4096 * x + y;
|
|
150
|
+
}
|
|
151
|
+
/** Decompresses texture coordinates packed by {@link compressTextureCoordinates}. */
|
|
152
|
+
export function decompressTextureCoordinates(compressed, result) {
|
|
153
|
+
const temporary = compressed / 4096;
|
|
154
|
+
const x = Math.floor(temporary);
|
|
155
|
+
result.x = x / 4095;
|
|
156
|
+
result.y = (compressed - x * 4096) / 4095;
|
|
157
|
+
return result;
|
|
158
|
+
}
|
|
159
|
+
/** Decodes delta- and ZigZag-encoded vertex buffers in place. */
|
|
160
|
+
export function zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer) {
|
|
161
|
+
assert(uBuffer);
|
|
162
|
+
assert(vBuffer);
|
|
163
|
+
assert(uBuffer.length === vBuffer.length);
|
|
164
|
+
if (heightBuffer) {
|
|
165
|
+
assert(uBuffer.length === heightBuffer.length);
|
|
166
|
+
}
|
|
167
|
+
let u = 0;
|
|
168
|
+
let v = 0;
|
|
169
|
+
let height = 0;
|
|
170
|
+
for (let index = 0; index < uBuffer.length; index++) {
|
|
171
|
+
u += zigZagDecode(uBuffer[index]);
|
|
172
|
+
v += zigZagDecode(vBuffer[index]);
|
|
173
|
+
uBuffer[index] = u;
|
|
174
|
+
vBuffer[index] = v;
|
|
175
|
+
if (heightBuffer) {
|
|
176
|
+
height += zigZagDecode(heightBuffer[index]);
|
|
177
|
+
heightBuffer[index] = height;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function zigZagDecode(value) {
|
|
182
|
+
return (value >> 1) ^ -(value & 1);
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=attribute-compression.js.map
|
|
@@ -0,0 +1 @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AAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TypedArray } from '@math.gl/types';
|
|
2
|
+
/**
|
|
3
|
+
* Iterates over the fixed-size elements of a typed array.
|
|
4
|
+
*
|
|
5
|
+
* For performance, each iteration reuses the same typed-array view-sized value.
|
|
6
|
+
*/
|
|
7
|
+
export declare function makeAttributeIterator(values: TypedArray, size: number): Iterable<TypedArray>;
|
|
8
|
+
//# sourceMappingURL=attribute-iterator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribute-iterator.d.ts","sourceRoot":"","sources":["../src/attribute-iterator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,UAAU,EAAwB,MAAM,gBAAgB,CAAC;AAEtE;;;;GAIG;AACH,wBAAiB,qBAAqB,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC,CAgB7F"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
/**
|
|
5
|
+
* Iterates over the fixed-size elements of a typed array.
|
|
6
|
+
*
|
|
7
|
+
* For performance, each iteration reuses the same typed-array view-sized value.
|
|
8
|
+
*/
|
|
9
|
+
export function* makeAttributeIterator(values, size) {
|
|
10
|
+
if (!Number.isInteger(size) || size <= 0) {
|
|
11
|
+
throw new Error('Attribute size must be a positive integer');
|
|
12
|
+
}
|
|
13
|
+
if (values.length % size !== 0) {
|
|
14
|
+
throw new Error('Attribute length must be divisible by its size');
|
|
15
|
+
}
|
|
16
|
+
const ArrayType = values.constructor;
|
|
17
|
+
const element = new ArrayType(size);
|
|
18
|
+
for (let index = 0; index < values.length; index += size) {
|
|
19
|
+
for (let componentIndex = 0; componentIndex < size; componentIndex++) {
|
|
20
|
+
element[componentIndex] = values[index + componentIndex];
|
|
21
|
+
}
|
|
22
|
+
yield element;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=attribute-iterator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribute-iterator.js","sourceRoot":"","sources":["../src/attribute-iterator.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAIpC;;;;GAIG;AACH,MAAM,SAAS,CAAC,CAAC,qBAAqB,CAAC,MAAkB,EAAE,IAAY;IACrE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/D,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,GAAG,IAAI,KAAK,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,WAAoC,CAAC;IAC9D,MAAM,OAAO,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;IACpC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC;QACzD,KAAK,IAAI,cAAc,GAAG,CAAC,EAAE,cAAc,GAAG,IAAI,EAAE,cAAc,EAAE,EAAE,CAAC;YACrE,OAAO,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,KAAK,GAAG,cAAc,CAAE,CAAC;QAC5D,CAAC;QACD,MAAM,OAAO,CAAC;IAChB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compute-vertex-normals.d.ts","sourceRoot":"","sources":["../src/compute-vertex-normals.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,QAAQ,EAAC,sBAAmB;AAIzC,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAmDrE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { Vector3 } from '@math.gl/core';
|
|
5
|
+
import { GL } from "./constants.js";
|
|
6
|
+
import { getAttributeValues, getPositionAttribute } from "./geometry.js";
|
|
7
|
+
import { makePrimitiveIterator } from "./primitive-iterator.js";
|
|
8
|
+
/** Computes smooth, area-weighted vertex normals for a triangle geometry. */
|
|
9
|
+
export function computeVertexNormals(geometry) {
|
|
10
|
+
if (geometry.mode !== GL.TRIANGLES &&
|
|
11
|
+
geometry.mode !== GL.TRIANGLE_STRIP &&
|
|
12
|
+
geometry.mode !== GL.TRIANGLE_FAN) {
|
|
13
|
+
throw new Error('Triangle geometry is required');
|
|
14
|
+
}
|
|
15
|
+
const position = getPositionAttribute(geometry);
|
|
16
|
+
const positions = getAttributeValues(position);
|
|
17
|
+
const positionSize = position.size || 3;
|
|
18
|
+
if (positionSize < 3) {
|
|
19
|
+
throw new Error('Position attributes must have at least three components');
|
|
20
|
+
}
|
|
21
|
+
const vertexCount = positions.length / positionSize;
|
|
22
|
+
const normals = new Float32Array(vertexCount * 3);
|
|
23
|
+
const vectorA = new Vector3();
|
|
24
|
+
const vectorB = new Vector3();
|
|
25
|
+
const vectorC = new Vector3();
|
|
26
|
+
const edgeCB = new Vector3();
|
|
27
|
+
const edgeAB = new Vector3();
|
|
28
|
+
for (const primitive of makePrimitiveIterator(geometry)) {
|
|
29
|
+
const { i1, i2, i3 } = primitive;
|
|
30
|
+
if (i2 === undefined || i3 === undefined) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
vectorA.fromArray(positions, i1 * positionSize);
|
|
34
|
+
vectorB.fromArray(positions, i2 * positionSize);
|
|
35
|
+
vectorC.fromArray(positions, i3 * positionSize);
|
|
36
|
+
const faceNormal = edgeCB
|
|
37
|
+
.subVectors(vectorC, vectorB)
|
|
38
|
+
.cross(edgeAB.subVectors(vectorA, vectorB));
|
|
39
|
+
for (const vertexIndex of [i1, i2, i3]) {
|
|
40
|
+
normals[vertexIndex * 3] += faceNormal.x;
|
|
41
|
+
normals[vertexIndex * 3 + 1] += faceNormal.y;
|
|
42
|
+
normals[vertexIndex * 3 + 2] += faceNormal.z;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const normal = new Vector3();
|
|
46
|
+
for (let vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) {
|
|
47
|
+
normal.fromArray(normals, vertexIndex * 3);
|
|
48
|
+
if (normal.magnitudeSquared() > 0) {
|
|
49
|
+
normal.normalize().toArray(normals, vertexIndex * 3);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return normals;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=compute-vertex-normals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compute-vertex-normals.js","sourceRoot":"","sources":["../src/compute-vertex-normals.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,EAAE,EAAC,uBAAoB;AAE/B,OAAO,EAAC,kBAAkB,EAAE,oBAAoB,EAAC,sBAAmB;AACpE,OAAO,EAAC,qBAAqB,EAAC,gCAA6B;AAE3D,6EAA6E;AAC7E,MAAM,UAAU,oBAAoB,CAAC,QAAkB;IACrD,IACE,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,SAAS;QAC9B,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,c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AAC;QAChD,MAAM,UAAU,GAAG,MAAM;aACtB,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC;aAC5B,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QAE9C,KAAK,MAAM,WAAW,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;YACvC,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC;YACzC,OAAO,CAAC,WAAW,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC;YAC7C,OAAO,CAAC,WAAW,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;IAC7B,KAAK,IAAI,WAAW,GAAG,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,WAAW,EAAE,EAAE,CAAC;QACnE,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC;QAC3C,IAAI,MAAM,CAAC,gBAAgB,EAAE,GAAG,CAAC,EAAE,CAAC;YAClC,MAAM,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** Portable point, line, and triangle primitive types. */
|
|
2
|
+
export declare const GL_PRIMITIVE: {
|
|
3
|
+
readonly POINTS: 0;
|
|
4
|
+
readonly LINES: 1;
|
|
5
|
+
readonly TRIANGLES: 4;
|
|
6
|
+
};
|
|
7
|
+
/** WebGL-compatible primitive topology constants. */
|
|
8
|
+
export declare const GL_PRIMITIVE_MODE: {
|
|
9
|
+
readonly POINTS: 0;
|
|
10
|
+
readonly LINES: 1;
|
|
11
|
+
readonly LINE_LOOP: 2;
|
|
12
|
+
readonly LINE_STRIP: 3;
|
|
13
|
+
readonly TRIANGLES: 4;
|
|
14
|
+
readonly TRIANGLE_STRIP: 5;
|
|
15
|
+
readonly TRIANGLE_FAN: 6;
|
|
16
|
+
};
|
|
17
|
+
/** WebGL-compatible vertex component type constants. */
|
|
18
|
+
export declare const GL_TYPE: {
|
|
19
|
+
readonly BYTE: 5120;
|
|
20
|
+
readonly UNSIGNED_BYTE: 5121;
|
|
21
|
+
readonly SHORT: 5122;
|
|
22
|
+
readonly UNSIGNED_SHORT: 5123;
|
|
23
|
+
readonly INT: 5124;
|
|
24
|
+
readonly UNSIGNED_INT: 5125;
|
|
25
|
+
readonly FLOAT: 5126;
|
|
26
|
+
readonly DOUBLE: 5130;
|
|
27
|
+
readonly UNSIGNED_SHORT_4_4_4_4: 32819;
|
|
28
|
+
readonly UNSIGNED_SHORT_5_5_5_1: 32820;
|
|
29
|
+
readonly UNSIGNED_SHORT_5_6_5: 33635;
|
|
30
|
+
};
|
|
31
|
+
/** WebGL-compatible constants used by geometry utilities. */
|
|
32
|
+
export declare const GL: {
|
|
33
|
+
readonly BYTE: 5120;
|
|
34
|
+
readonly UNSIGNED_BYTE: 5121;
|
|
35
|
+
readonly SHORT: 5122;
|
|
36
|
+
readonly UNSIGNED_SHORT: 5123;
|
|
37
|
+
readonly INT: 5124;
|
|
38
|
+
readonly UNSIGNED_INT: 5125;
|
|
39
|
+
readonly FLOAT: 5126;
|
|
40
|
+
readonly DOUBLE: 5130;
|
|
41
|
+
readonly UNSIGNED_SHORT_4_4_4_4: 32819;
|
|
42
|
+
readonly UNSIGNED_SHORT_5_5_5_1: 32820;
|
|
43
|
+
readonly UNSIGNED_SHORT_5_6_5: 33635;
|
|
44
|
+
readonly POINTS: 0;
|
|
45
|
+
readonly LINES: 1;
|
|
46
|
+
readonly LINE_LOOP: 2;
|
|
47
|
+
readonly LINE_STRIP: 3;
|
|
48
|
+
readonly TRIANGLES: 4;
|
|
49
|
+
readonly TRIANGLE_STRIP: 5;
|
|
50
|
+
readonly TRIANGLE_FAN: 6;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAIA,0DAA0D;AAC1D,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,qDAAqD;AACrD,eAAO,MAAM,iBAAiB;;;;;;;;CAQpB,CAAC;AAEX,wDAAwD;AACxD,eAAO,MAAM,OAAO;;;;;;;;;;;;CAYV,CAAC;AAEX,6DAA6D;AAC7D,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;CAGL,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
/** Portable point, line, and triangle primitive types. */
|
|
5
|
+
export const GL_PRIMITIVE = {
|
|
6
|
+
POINTS: 0x0000,
|
|
7
|
+
LINES: 0x0001,
|
|
8
|
+
TRIANGLES: 0x0004
|
|
9
|
+
};
|
|
10
|
+
/** WebGL-compatible primitive topology constants. */
|
|
11
|
+
export const GL_PRIMITIVE_MODE = {
|
|
12
|
+
POINTS: 0x0000,
|
|
13
|
+
LINES: 0x0001,
|
|
14
|
+
LINE_LOOP: 0x0002,
|
|
15
|
+
LINE_STRIP: 0x0003,
|
|
16
|
+
TRIANGLES: 0x0004,
|
|
17
|
+
TRIANGLE_STRIP: 0x0005,
|
|
18
|
+
TRIANGLE_FAN: 0x0006
|
|
19
|
+
};
|
|
20
|
+
/** WebGL-compatible vertex component type constants. */
|
|
21
|
+
export const GL_TYPE = {
|
|
22
|
+
BYTE: 5120,
|
|
23
|
+
UNSIGNED_BYTE: 5121,
|
|
24
|
+
SHORT: 5122,
|
|
25
|
+
UNSIGNED_SHORT: 5123,
|
|
26
|
+
INT: 5124,
|
|
27
|
+
UNSIGNED_INT: 5125,
|
|
28
|
+
FLOAT: 5126,
|
|
29
|
+
DOUBLE: 5130,
|
|
30
|
+
UNSIGNED_SHORT_4_4_4_4: 32819,
|
|
31
|
+
UNSIGNED_SHORT_5_5_5_1: 32820,
|
|
32
|
+
UNSIGNED_SHORT_5_6_5: 33635
|
|
33
|
+
};
|
|
34
|
+
/** WebGL-compatible constants used by geometry utilities. */
|
|
35
|
+
export const GL = {
|
|
36
|
+
...GL_PRIMITIVE_MODE,
|
|
37
|
+
...GL_TYPE
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,0DAA0D;AAC1D,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,MAAM;CACT,CAAC;AAEX,qDAAqD;AACrD,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE,MAAM;IACjB,cAAc,EAAE,MAAM;IACtB,YAAY,EAAE,MAAM;CACZ,CAAC;AAEX,wDAAwD;AACxD,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,IAAI;IACV,aAAa,EAAE,IAAI;IACnB,KAAK,EAAE,IAAI;IACX,cAAc,EAAE,IAAI;IACpB,GAAG,EAAE,IAAI;IACT,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,sBAAsB,EAAE,KAAK;IAC7B,sBAAsB,EAAE,KAAK;IAC7B,oBAAoB,EAAE,KAAK;CACnB,CAAC;AAEX,6DAA6D;AAC7D,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,GAAG,iBAAiB;IACpB,GAAG,OAAO;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinates.d.ts","sourceRoot":"","sources":["../src/coordinates.ts"],"names":[],"mappings":"AAIA,wDAAwD;AACxD,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinates.js","sourceRoot":"","sources":["../src/coordinates.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,wDAAwD;AACxD,MAAM,UAAU,IAAI,CAAC,KAAa;IAChC,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAC/B,CAAC"}
|