@luma.gl/engine 10.0.0-alpha.2 → 10.0.0-alpha.4
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/dist/compute/computation.d.ts +2 -0
- package/dist/compute/computation.d.ts.map +1 -1
- package/dist/compute/computation.js +5 -1
- package/dist/compute/computation.js.map +1 -1
- package/dist/dist.dev.js +1033 -1320
- package/dist/dist.min.js +23 -23
- package/dist/geometry/edge-geometry.d.ts +17 -0
- package/dist/geometry/edge-geometry.d.ts.map +1 -0
- package/dist/geometry/edge-geometry.js +160 -0
- package/dist/geometry/edge-geometry.js.map +1 -0
- package/dist/geometry/geometry-primitives.d.ts +54 -0
- package/dist/geometry/geometry-primitives.d.ts.map +1 -0
- package/dist/geometry/geometry-primitives.js +153 -0
- package/dist/geometry/geometry-primitives.js.map +1 -0
- package/dist/geometry/geometry-utils.d.ts +7 -15
- package/dist/geometry/geometry-utils.d.ts.map +1 -1
- package/dist/geometry/geometry-utils.js +9 -55
- package/dist/geometry/geometry-utils.js.map +1 -1
- package/dist/geometry/geometry.d.ts +9 -69
- package/dist/geometry/geometry.d.ts.map +1 -1
- package/dist/geometry/geometry.js +27 -93
- package/dist/geometry/geometry.js.map +1 -1
- package/dist/geometry/gpu-geometry.d.ts +4 -2
- package/dist/geometry/gpu-geometry.d.ts.map +1 -1
- package/dist/geometry/gpu-geometry.js +3 -3
- package/dist/geometry/gpu-geometry.js.map +1 -1
- package/dist/geometry/stroke-geometry.d.ts +15 -0
- package/dist/geometry/stroke-geometry.d.ts.map +1 -0
- package/dist/geometry/stroke-geometry.js +168 -0
- package/dist/geometry/stroke-geometry.js.map +1 -0
- package/dist/index.cjs +554 -1309
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +17 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/model/model.d.ts +6 -1
- package/dist/model/model.d.ts.map +1 -1
- package/dist/model/model.js +11 -4
- package/dist/model/model.js.map +1 -1
- package/dist/models/clip-space.d.ts +4 -1
- package/dist/models/clip-space.d.ts.map +1 -1
- package/dist/models/clip-space.js +16 -13
- package/dist/models/clip-space.js.map +1 -1
- package/dist/models/directional-light-model.js +1 -1
- package/dist/models/directional-light-model.js.map +1 -1
- package/dist/models/point-light-model.js +1 -1
- package/dist/models/point-light-model.js.map +1 -1
- package/dist/models/spot-light-model.js +1 -1
- package/dist/models/spot-light-model.js.map +1 -1
- package/package.json +7 -6
- package/src/compute/computation.ts +7 -0
- package/src/geometry/edge-geometry.ts +208 -0
- package/src/geometry/geometry-primitives.ts +215 -0
- package/src/geometry/geometry-utils.ts +16 -71
- package/src/geometry/geometry.ts +36 -163
- package/src/geometry/gpu-geometry.ts +9 -4
- package/src/geometry/stroke-geometry.ts +236 -0
- package/src/index.ts +21 -14
- package/src/model/model.ts +19 -6
- package/src/models/clip-space.ts +21 -14
- package/src/models/directional-light-model.ts +1 -1
- package/src/models/point-light-model.ts +1 -1
- package/src/models/spot-light-model.ts +1 -1
- package/dist/geometries/cone-geometry.d.ts +0 -12
- package/dist/geometries/cone-geometry.d.ts.map +0 -1
- package/dist/geometries/cone-geometry.js +0 -19
- package/dist/geometries/cone-geometry.js.map +0 -1
- package/dist/geometries/cube-geometry.d.ts +0 -14
- package/dist/geometries/cube-geometry.d.ts.map +0 -1
- package/dist/geometries/cube-geometry.js +0 -222
- package/dist/geometries/cube-geometry.js.map +0 -1
- package/dist/geometries/cylinder-geometry.d.ts +0 -11
- package/dist/geometries/cylinder-geometry.d.ts.map +0 -1
- package/dist/geometries/cylinder-geometry.js +0 -17
- package/dist/geometries/cylinder-geometry.js.map +0 -1
- package/dist/geometries/ico-sphere-geometry.d.ts +0 -11
- package/dist/geometries/ico-sphere-geometry.d.ts.map +0 -1
- package/dist/geometries/ico-sphere-geometry.js +0 -158
- package/dist/geometries/ico-sphere-geometry.js.map +0 -1
- package/dist/geometries/plane-geometry.d.ts +0 -20
- package/dist/geometries/plane-geometry.d.ts.map +0 -1
- package/dist/geometries/plane-geometry.js +0 -106
- package/dist/geometries/plane-geometry.js.map +0 -1
- package/dist/geometries/sphere-geometry.d.ts +0 -12
- package/dist/geometries/sphere-geometry.d.ts.map +0 -1
- package/dist/geometries/sphere-geometry.js +0 -88
- package/dist/geometries/sphere-geometry.js.map +0 -1
- package/dist/geometries/truncated-cone-geometry.d.ts +0 -23
- package/dist/geometries/truncated-cone-geometry.d.ts.map +0 -1
- package/dist/geometries/truncated-cone-geometry.js +0 -112
- package/dist/geometries/truncated-cone-geometry.js.map +0 -1
- package/src/geometries/cone-geometry.ts +0 -31
- package/src/geometries/cube-geometry.ts +0 -258
- package/src/geometries/cylinder-geometry.ts +0 -28
- package/src/geometries/ico-sphere-geometry.ts +0 -193
- package/src/geometries/plane-geometry.ts +0 -142
- package/src/geometries/sphere-geometry.ts +0 -113
- package/src/geometries/truncated-cone-geometry.ts +0 -145
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
// luma.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { Geometry } from "../geometry/geometry.js";
|
|
5
|
-
import { unpackIndexedGeometry } from "../geometry/geometry-utils.js";
|
|
6
|
-
import { uid } from "../utils/uid.js";
|
|
7
|
-
// Primitives inspired by TDL http://code.google.com/p/webglsamples/,
|
|
8
|
-
// copyright 2011 Google Inc. new BSD License
|
|
9
|
-
// (http://www.opensource.org/licenses/bsd-license.php).
|
|
10
|
-
export class PlaneGeometry extends Geometry {
|
|
11
|
-
constructor(props = {}) {
|
|
12
|
-
const { id = uid('plane-geometry') } = props;
|
|
13
|
-
const { indices, attributes } = tesselatePlane(props);
|
|
14
|
-
super({
|
|
15
|
-
...props,
|
|
16
|
-
id,
|
|
17
|
-
topology: 'triangle-list',
|
|
18
|
-
indices,
|
|
19
|
-
attributes: { ...attributes, ...props.attributes }
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
/* eslint-disable complexity, max-statements */
|
|
24
|
-
function tesselatePlane(props) {
|
|
25
|
-
const { type = 'x,y', offset = 0, flipCull = false, unpack = false } = props;
|
|
26
|
-
const coords = type.split(',');
|
|
27
|
-
// width, height
|
|
28
|
-
let c1len = props[`${coords[0]}len`] || 1;
|
|
29
|
-
const c2len = props[`${coords[1]}len`] || 1;
|
|
30
|
-
// subdivisionsWidth, subdivisionsDepth
|
|
31
|
-
const subdivisions1 = props[`n${coords[0]}`] || 1;
|
|
32
|
-
const subdivisions2 = props[`n${coords[1]}`] || 1;
|
|
33
|
-
const numVertices = (subdivisions1 + 1) * (subdivisions2 + 1);
|
|
34
|
-
const positions = new Float32Array(numVertices * 3);
|
|
35
|
-
const normals = new Float32Array(numVertices * 3);
|
|
36
|
-
const texCoords = new Float32Array(numVertices * 2);
|
|
37
|
-
if (flipCull) {
|
|
38
|
-
c1len = -c1len;
|
|
39
|
-
}
|
|
40
|
-
let i2 = 0;
|
|
41
|
-
let i3 = 0;
|
|
42
|
-
for (let z = 0; z <= subdivisions2; z++) {
|
|
43
|
-
for (let x = 0; x <= subdivisions1; x++) {
|
|
44
|
-
const u = x / subdivisions1;
|
|
45
|
-
const v = z / subdivisions2;
|
|
46
|
-
texCoords[i2 + 0] = flipCull ? 1 - u : u;
|
|
47
|
-
texCoords[i2 + 1] = v;
|
|
48
|
-
switch (type) {
|
|
49
|
-
case 'x,y':
|
|
50
|
-
positions[i3 + 0] = c1len * u - c1len * 0.5;
|
|
51
|
-
positions[i3 + 1] = c2len * v - c2len * 0.5;
|
|
52
|
-
positions[i3 + 2] = offset;
|
|
53
|
-
normals[i3 + 0] = 0;
|
|
54
|
-
normals[i3 + 1] = 0;
|
|
55
|
-
normals[i3 + 2] = flipCull ? 1 : -1;
|
|
56
|
-
break;
|
|
57
|
-
case 'x,z':
|
|
58
|
-
positions[i3 + 0] = c1len * u - c1len * 0.5;
|
|
59
|
-
positions[i3 + 1] = offset;
|
|
60
|
-
positions[i3 + 2] = c2len * v - c2len * 0.5;
|
|
61
|
-
normals[i3 + 0] = 0;
|
|
62
|
-
normals[i3 + 1] = flipCull ? 1 : -1;
|
|
63
|
-
normals[i3 + 2] = 0;
|
|
64
|
-
break;
|
|
65
|
-
case 'y,z':
|
|
66
|
-
positions[i3 + 0] = offset;
|
|
67
|
-
positions[i3 + 1] = c1len * u - c1len * 0.5;
|
|
68
|
-
positions[i3 + 2] = c2len * v - c2len * 0.5;
|
|
69
|
-
normals[i3 + 0] = flipCull ? 1 : -1;
|
|
70
|
-
normals[i3 + 1] = 0;
|
|
71
|
-
normals[i3 + 2] = 0;
|
|
72
|
-
break;
|
|
73
|
-
default:
|
|
74
|
-
throw new Error('PlaneGeometry: unknown type');
|
|
75
|
-
}
|
|
76
|
-
i2 += 2;
|
|
77
|
-
i3 += 3;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
const numVertsAcross = subdivisions1 + 1;
|
|
81
|
-
const indices = new Uint16Array(subdivisions1 * subdivisions2 * 6);
|
|
82
|
-
for (let z = 0; z < subdivisions2; z++) {
|
|
83
|
-
for (let x = 0; x < subdivisions1; x++) {
|
|
84
|
-
const index = (z * subdivisions1 + x) * 6;
|
|
85
|
-
// Make triangle 1 of quad.
|
|
86
|
-
indices[index + 0] = (z + 0) * numVertsAcross + x;
|
|
87
|
-
indices[index + 1] = (z + 1) * numVertsAcross + x;
|
|
88
|
-
indices[index + 2] = (z + 0) * numVertsAcross + x + 1;
|
|
89
|
-
// Make triangle 2 of quad.
|
|
90
|
-
indices[index + 3] = (z + 1) * numVertsAcross + x;
|
|
91
|
-
indices[index + 4] = (z + 1) * numVertsAcross + x + 1;
|
|
92
|
-
indices[index + 5] = (z + 0) * numVertsAcross + x + 1;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
const geometry = {
|
|
96
|
-
indices: { size: 1, value: indices },
|
|
97
|
-
attributes: {
|
|
98
|
-
POSITION: { size: 3, value: positions },
|
|
99
|
-
NORMAL: { size: 3, value: normals },
|
|
100
|
-
TEXCOORD_0: { size: 2, value: texCoords }
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
// Optionally, unpack indexed geometry
|
|
104
|
-
return unpack ? unpackIndexedGeometry(geometry) : geometry;
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=plane-geometry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plane-geometry.js","sourceRoot":"","sources":["../../src/geometries/plane-geometry.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAC9C,OAAO,EAAC,qBAAqB,EAAC,sCAAmC;AACjE,OAAO,EAAC,GAAG,EAAC,wBAAqB;AAkBjC,qEAAqE;AACrE,6CAA6C;AAC7C,wDAAwD;AACxD,MAAM,OAAO,aAAc,SAAQ,QAAQ;IACzC,YAAY,QAA4B,EAAE;QACxC,MAAM,EAAC,EAAE,GAAG,GAAG,CAAC,gBAAgB,CAAC,EAAC,GAAG,KAAK,CAAC;QAE3C,MAAM,EAAC,OAAO,EAAE,UAAU,EAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;QACpD,KAAK,CAAC;YACJ,GAAG,KAAK;YACR,EAAE;YACF,QAAQ,EAAE,eAAe;YACzB,OAAO;YACP,UAAU,EAAE,EAAC,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC,UAAU,EAAC;SACjD,CAAC,CAAC;IACL,CAAC;CACF;AAED,+CAA+C;AAC/C,SAAS,cAAc,CAAC,KAAU;IAChC,MAAM,EAAC,IAAI,GAAG,KAAK,EAAE,MAAM,GAAG,CAAC,EAAE,QAAQ,GAAG,KAAK,EAAE,MAAM,GAAG,KAAK,EAAC,GAAG,KAAK,CAAC;IAE3E,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/B,gBAAgB;IAChB,IAAI,K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G,CAAC,CAAC;YAClD,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,cAAc,GAAG,CAAC,GAAG,CAAC,CAAC;YAEtD,2BAA2B;YAC3B,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,cAAc,GAAG,CAAC,CAAC;YAClD,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,cAAc,GAAG,CAAC,GAAG,CAAC,CAAC;YACtD,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,cAAc,GAAG,CAAC,GAAG,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,MAAM,QAAQ,GAAG;QACf,OAAO,EAAE,EAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAC;QAClC,UAAU,EAAE;YACV,QAAQ,EAAE,EAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAC;YACrC,MAAM,EAAE,EAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAC;YACjC,UAAU,EAAE,EAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAC;SACxC;KACF,CAAC;IAEF,sCAAsC;IACtC,OAAO,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC7D,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Geometry } from "../geometry/geometry.js";
|
|
2
|
-
export type SphereGeometryProps = {
|
|
3
|
-
id?: string;
|
|
4
|
-
radius?: number;
|
|
5
|
-
nlat?: number;
|
|
6
|
-
nlong?: number;
|
|
7
|
-
attributes?: any;
|
|
8
|
-
};
|
|
9
|
-
export declare class SphereGeometry extends Geometry {
|
|
10
|
-
constructor(props?: SphereGeometryProps);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=sphere-geometry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sphere-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/sphere-geometry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAG9C,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB,CAAC;AAKF,qBAAa,cAAe,SAAQ,QAAQ;gBAC9B,KAAK,GAAE,mBAAwB;CAW5C"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// luma.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { Geometry } from "../geometry/geometry.js";
|
|
5
|
-
import { uid } from "../utils/uid.js";
|
|
6
|
-
// Primitives inspired by TDL http://code.google.com/p/webglsamples/,
|
|
7
|
-
// copyright 2011 Google Inc. new BSD License
|
|
8
|
-
// (http://www.opensource.org/licenses/bsd-license.php).
|
|
9
|
-
export class SphereGeometry extends Geometry {
|
|
10
|
-
constructor(props = {}) {
|
|
11
|
-
const { id = uid('sphere-geometry') } = props;
|
|
12
|
-
const { indices, attributes } = tesselateSphere(props);
|
|
13
|
-
super({
|
|
14
|
-
...props,
|
|
15
|
-
id,
|
|
16
|
-
topology: 'triangle-list',
|
|
17
|
-
indices,
|
|
18
|
-
attributes: { ...attributes, ...props.attributes }
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
/* eslint-disable max-statements, complexity */
|
|
23
|
-
function tesselateSphere(props) {
|
|
24
|
-
const { nlat = 10, nlong = 10 } = props;
|
|
25
|
-
const startLat = 0;
|
|
26
|
-
const endLat = Math.PI;
|
|
27
|
-
const latRange = endLat - startLat;
|
|
28
|
-
const startLong = 0;
|
|
29
|
-
const endLong = 2 * Math.PI;
|
|
30
|
-
const longRange = endLong - startLong;
|
|
31
|
-
const numVertices = (nlat + 1) * (nlong + 1);
|
|
32
|
-
const radius = (n1, n2, n3, u, v) => props.radius || 1;
|
|
33
|
-
const positions = new Float32Array(numVertices * 3);
|
|
34
|
-
const normals = new Float32Array(numVertices * 3);
|
|
35
|
-
const texCoords = new Float32Array(numVertices * 2);
|
|
36
|
-
const IndexType = numVertices > 0xffff ? Uint32Array : Uint16Array;
|
|
37
|
-
const indices = new IndexType(nlat * nlong * 6);
|
|
38
|
-
// Create positions, normals and texCoords
|
|
39
|
-
for (let y = 0; y <= nlat; y++) {
|
|
40
|
-
for (let x = 0; x <= nlong; x++) {
|
|
41
|
-
const u = x / nlong;
|
|
42
|
-
const v = y / nlat;
|
|
43
|
-
const index = x + y * (nlong + 1);
|
|
44
|
-
const i2 = index * 2;
|
|
45
|
-
const i3 = index * 3;
|
|
46
|
-
const theta = longRange * u;
|
|
47
|
-
const phi = latRange * v;
|
|
48
|
-
const sinTheta = Math.sin(theta);
|
|
49
|
-
const cosTheta = Math.cos(theta);
|
|
50
|
-
const sinPhi = Math.sin(phi);
|
|
51
|
-
const cosPhi = Math.cos(phi);
|
|
52
|
-
const ux = cosTheta * sinPhi;
|
|
53
|
-
const uy = cosPhi;
|
|
54
|
-
const uz = sinTheta * sinPhi;
|
|
55
|
-
const r = radius(ux, uy, uz, u, v);
|
|
56
|
-
positions[i3 + 0] = r * ux;
|
|
57
|
-
positions[i3 + 1] = r * uy;
|
|
58
|
-
positions[i3 + 2] = r * uz;
|
|
59
|
-
normals[i3 + 0] = ux;
|
|
60
|
-
normals[i3 + 1] = uy;
|
|
61
|
-
normals[i3 + 2] = uz;
|
|
62
|
-
texCoords[i2 + 0] = u;
|
|
63
|
-
texCoords[i2 + 1] = 1 - v;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
// Create indices
|
|
67
|
-
const numVertsAround = nlong + 1;
|
|
68
|
-
for (let x = 0; x < nlong; x++) {
|
|
69
|
-
for (let y = 0; y < nlat; y++) {
|
|
70
|
-
const index = (x * nlat + y) * 6;
|
|
71
|
-
indices[index + 0] = y * numVertsAround + x;
|
|
72
|
-
indices[index + 1] = y * numVertsAround + x + 1;
|
|
73
|
-
indices[index + 2] = (y + 1) * numVertsAround + x;
|
|
74
|
-
indices[index + 3] = (y + 1) * numVertsAround + x;
|
|
75
|
-
indices[index + 4] = y * numVertsAround + x + 1;
|
|
76
|
-
indices[index + 5] = (y + 1) * numVertsAround + x + 1;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
indices: { size: 1, value: indices },
|
|
81
|
-
attributes: {
|
|
82
|
-
POSITION: { size: 3, value: positions },
|
|
83
|
-
NORMAL: { size: 3, value: normals },
|
|
84
|
-
TEXCOORD_0: { size: 2, value: texCoords }
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=sphere-geometry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sphere-geometry.js","sourceRoot":"","sources":["../../src/geometries/sphere-geometry.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAC9C,OAAO,EAAC,GAAG,EAAC,wBAAqB;AAUjC,qEAAqE;AACrE,6CAA6C;AAC7C,wDAAwD;AACxD,MAAM,OAAO,cAAe,SAAQ,QAAQ;IAC1C,YAAY,QAA6B,EAAE;QACzC,MAAM,EAAC,EAAE,GAAG,GAAG,CAAC,iBAAiB,CAAC,EAAC,GAAG,KAAK,CAAC;QAC5C,MAAM,EAAC,OAAO,EAAE,UAAU,EAAC,GAAG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,cAAc,GAAG,CAAC,GAAG,CAAC,CAAC;YAChD,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,cAAc,GAAG,CAAC,GAAG,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE,EAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAC;QAClC,UAAU,EAAE;YACV,QAAQ,EAAE,EAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAC;YACrC,MAAM,EAAE,EAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAC;YACjC,UAAU,EAAE,EAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAC;SACxC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Geometry } from "../geometry/geometry.js";
|
|
2
|
-
export type TruncatedConeGeometryProps = {
|
|
3
|
-
topRadius?: number;
|
|
4
|
-
bottomRadius?: number;
|
|
5
|
-
topCap?: boolean;
|
|
6
|
-
bottomCap?: boolean;
|
|
7
|
-
height?: number;
|
|
8
|
-
nradial?: number;
|
|
9
|
-
nvertical?: number;
|
|
10
|
-
verticalAxis?: 'x' | 'y' | 'z';
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Primitives inspired by TDL http://code.google.com/p/webglsamples/,
|
|
14
|
-
* copyright 2011 Google Inc. new BSD License
|
|
15
|
-
* (http://www.opensource.org/licenses/bsd-license.php).
|
|
16
|
-
*/
|
|
17
|
-
export declare class TruncatedConeGeometry extends Geometry {
|
|
18
|
-
constructor(props?: TruncatedConeGeometryProps & {
|
|
19
|
-
id?: string;
|
|
20
|
-
attributes?: any;
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=truncated-cone-geometry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"truncated-cone-geometry.d.ts","sourceRoot":"","sources":["../../src/geometries/truncated-cone-geometry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAS9C,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAChC,CAAC;AAEF;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,QAAQ;gBACrC,KAAK,GAAE,0BAA0B,GAAG;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,GAAG,CAAA;KAAM;CAgBrF"}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
// luma.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { Geometry } from "../geometry/geometry.js";
|
|
5
|
-
import { uid } from "../utils/uid.js";
|
|
6
|
-
const INDEX_OFFSETS = {
|
|
7
|
-
x: [2, 0, 1],
|
|
8
|
-
y: [0, 1, 2],
|
|
9
|
-
z: [1, 2, 0]
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Primitives inspired by TDL http://code.google.com/p/webglsamples/,
|
|
13
|
-
* copyright 2011 Google Inc. new BSD License
|
|
14
|
-
* (http://www.opensource.org/licenses/bsd-license.php).
|
|
15
|
-
*/
|
|
16
|
-
export class TruncatedConeGeometry extends Geometry {
|
|
17
|
-
constructor(props = {}) {
|
|
18
|
-
const { id = uid('truncated-code-geometry') } = props;
|
|
19
|
-
const { indices, attributes } = tesselateTruncatedCone(props);
|
|
20
|
-
super({
|
|
21
|
-
...props,
|
|
22
|
-
id,
|
|
23
|
-
topology: 'triangle-list',
|
|
24
|
-
indices,
|
|
25
|
-
attributes: {
|
|
26
|
-
POSITION: { size: 3, value: attributes.POSITION },
|
|
27
|
-
NORMAL: { size: 3, value: attributes.NORMAL },
|
|
28
|
-
TEXCOORD_0: { size: 2, value: attributes.TEXCOORD_0 },
|
|
29
|
-
...props.attributes
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/* eslint-disable max-statements, complexity */
|
|
35
|
-
function tesselateTruncatedCone(props = {}) {
|
|
36
|
-
const { bottomRadius = 0, topRadius = 0, height = 1, nradial = 10, nvertical = 10, verticalAxis = 'y', topCap = false, bottomCap = false } = props;
|
|
37
|
-
const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);
|
|
38
|
-
const numVertices = (nradial + 1) * (nvertical + 1 + extra);
|
|
39
|
-
const slant = Math.atan2(bottomRadius - topRadius, height);
|
|
40
|
-
const msin = Math.sin;
|
|
41
|
-
const mcos = Math.cos;
|
|
42
|
-
const mpi = Math.PI;
|
|
43
|
-
const cosSlant = mcos(slant);
|
|
44
|
-
const sinSlant = msin(slant);
|
|
45
|
-
const start = topCap ? -2 : 0;
|
|
46
|
-
const end = nvertical + (bottomCap ? 2 : 0);
|
|
47
|
-
const vertsAroundEdge = nradial + 1;
|
|
48
|
-
const indices = new Uint16Array(nradial * (nvertical + extra) * 6);
|
|
49
|
-
const indexOffset = INDEX_OFFSETS[verticalAxis];
|
|
50
|
-
const positions = new Float32Array(numVertices * 3);
|
|
51
|
-
const normals = new Float32Array(numVertices * 3);
|
|
52
|
-
const texCoords = new Float32Array(numVertices * 2);
|
|
53
|
-
let i3 = 0;
|
|
54
|
-
let i2 = 0;
|
|
55
|
-
for (let i = start; i <= end; i++) {
|
|
56
|
-
let v = i / nvertical;
|
|
57
|
-
let y = height * v;
|
|
58
|
-
let ringRadius;
|
|
59
|
-
if (i < 0) {
|
|
60
|
-
y = 0;
|
|
61
|
-
v = 1;
|
|
62
|
-
ringRadius = bottomRadius;
|
|
63
|
-
}
|
|
64
|
-
else if (i > nvertical) {
|
|
65
|
-
y = height;
|
|
66
|
-
v = 1;
|
|
67
|
-
ringRadius = topRadius;
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
ringRadius = bottomRadius + (topRadius - bottomRadius) * (i / nvertical);
|
|
71
|
-
}
|
|
72
|
-
if (i === -2 || i === nvertical + 2) {
|
|
73
|
-
ringRadius = 0;
|
|
74
|
-
v = 0;
|
|
75
|
-
}
|
|
76
|
-
y -= height / 2;
|
|
77
|
-
for (let j = 0; j < vertsAroundEdge; j++) {
|
|
78
|
-
const sin = msin((j * mpi * 2) / nradial);
|
|
79
|
-
const cos = mcos((j * mpi * 2) / nradial);
|
|
80
|
-
positions[i3 + indexOffset[0]] = sin * ringRadius;
|
|
81
|
-
positions[i3 + indexOffset[1]] = y;
|
|
82
|
-
positions[i3 + indexOffset[2]] = cos * ringRadius;
|
|
83
|
-
normals[i3 + indexOffset[0]] = i < 0 || i > nvertical ? 0 : sin * cosSlant;
|
|
84
|
-
normals[i3 + indexOffset[1]] = i < 0 ? -1 : i > nvertical ? 1 : sinSlant;
|
|
85
|
-
normals[i3 + indexOffset[2]] = i < 0 || i > nvertical ? 0 : cos * cosSlant;
|
|
86
|
-
texCoords[i2 + 0] = j / nradial;
|
|
87
|
-
texCoords[i2 + 1] = v;
|
|
88
|
-
i2 += 2;
|
|
89
|
-
i3 += 3;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
for (let i = 0; i < nvertical + extra; i++) {
|
|
93
|
-
for (let j = 0; j < nradial; j++) {
|
|
94
|
-
const index = (i * nradial + j) * 6;
|
|
95
|
-
indices[index + 0] = vertsAroundEdge * (i + 0) + 0 + j;
|
|
96
|
-
indices[index + 1] = vertsAroundEdge * (i + 0) + 1 + j;
|
|
97
|
-
indices[index + 2] = vertsAroundEdge * (i + 1) + 1 + j;
|
|
98
|
-
indices[index + 3] = vertsAroundEdge * (i + 0) + 0 + j;
|
|
99
|
-
indices[index + 4] = vertsAroundEdge * (i + 1) + 1 + j;
|
|
100
|
-
indices[index + 5] = vertsAroundEdge * (i + 1) + 0 + j;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
indices,
|
|
105
|
-
attributes: {
|
|
106
|
-
POSITION: positions,
|
|
107
|
-
NORMAL: normals,
|
|
108
|
-
TEXCOORD_0: texCoords
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
//# sourceMappingURL=truncated-cone-geometry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"truncated-cone-geometry.js","sourceRoot":"","sources":["../../src/geometries/truncated-cone-geometry.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAC9C,OAAO,EAAC,GAAG,EAAC,wBAAqB;AAEjC,MAAM,aAAa,GAAG;IACpB,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACZ,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACZ,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;CACb,CAAC;AAaF;;;;GAIG;AACH,MAAM,OAAO,qBAAsB,SAAQ,QAAQ;IACjD,YAAY,QAAsE,EAAE;QAClF,MAAM,EAAC,EAAE,GAAG,GAAG,CAAC,yBAAyB,CAAC,EAAC,GAAG,KAAK,CAAC;QACpD,MAAM,EAAC,OAAO,EAAE,UAAU,EAAC,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;QAC5D,KAAK,CAAC;YACJ,GAAG,KAAK;YACR,EAAE;YACF,QAAQ,EAAE,eAAe;YACzB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CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACvD,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,eAAe,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO;QACP,UAAU,EAAE;YACV,QAAQ,EAAE,SAAS;YACnB,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,SAAS;SACtB;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// luma.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
-
|
|
5
|
-
import type {TruncatedConeGeometryProps} from './truncated-cone-geometry';
|
|
6
|
-
import {TruncatedConeGeometry} from './truncated-cone-geometry';
|
|
7
|
-
import {uid} from '../utils/uid';
|
|
8
|
-
|
|
9
|
-
export type ConeGeometryProps = Omit<
|
|
10
|
-
TruncatedConeGeometryProps,
|
|
11
|
-
'topRadius' | 'bottomRadius' | 'topCap' | 'bottomCap'
|
|
12
|
-
> & {
|
|
13
|
-
id?: string;
|
|
14
|
-
radius?: number;
|
|
15
|
-
cap?: boolean;
|
|
16
|
-
attributes?: any;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export class ConeGeometry extends TruncatedConeGeometry {
|
|
20
|
-
constructor(props: ConeGeometryProps = {}) {
|
|
21
|
-
const {id = uid('cone-geometry'), radius = 1, cap = true} = props;
|
|
22
|
-
super({
|
|
23
|
-
...props,
|
|
24
|
-
id,
|
|
25
|
-
topRadius: 0,
|
|
26
|
-
topCap: Boolean(cap),
|
|
27
|
-
bottomCap: Boolean(cap),
|
|
28
|
-
bottomRadius: radius
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
// luma.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
-
|
|
5
|
-
import {Geometry} from '../geometry/geometry';
|
|
6
|
-
import {uid} from '../utils/uid';
|
|
7
|
-
// import type {GeometryType} from '../geometry/geometry-type';
|
|
8
|
-
|
|
9
|
-
export type CubeGeometryProps = {
|
|
10
|
-
id?: string;
|
|
11
|
-
indices?: boolean;
|
|
12
|
-
attributes?: any;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export class CubeGeometry extends Geometry {
|
|
16
|
-
constructor(props: CubeGeometryProps = {}) {
|
|
17
|
-
const {id = uid('cube-geometry'), indices = true} = props;
|
|
18
|
-
super(
|
|
19
|
-
indices
|
|
20
|
-
? {
|
|
21
|
-
...props,
|
|
22
|
-
id,
|
|
23
|
-
topology: 'triangle-list',
|
|
24
|
-
indices: {size: 1, value: CUBE_INDICES},
|
|
25
|
-
attributes: {...ATTRIBUTES, ...props.attributes}
|
|
26
|
-
}
|
|
27
|
-
: {
|
|
28
|
-
...props,
|
|
29
|
-
id,
|
|
30
|
-
topology: 'triangle-list',
|
|
31
|
-
indices: undefined,
|
|
32
|
-
attributes: {...NON_INDEXED_ATTRIBUTES, ...props.attributes}
|
|
33
|
-
}
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// biome-ignore format: preserve layout
|
|
39
|
-
const CUBE_INDICES = new Uint16Array([
|
|
40
|
-
0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13,
|
|
41
|
-
14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23
|
|
42
|
-
]);
|
|
43
|
-
|
|
44
|
-
// biome-ignore format: preserve layout
|
|
45
|
-
const CUBE_POSITIONS = new Float32Array([
|
|
46
|
-
-1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1,
|
|
47
|
-
-1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1,
|
|
48
|
-
-1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1,
|
|
49
|
-
-1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1,
|
|
50
|
-
1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1,
|
|
51
|
-
-1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1
|
|
52
|
-
]);
|
|
53
|
-
|
|
54
|
-
// TODO - could be Uint8
|
|
55
|
-
// biome-ignore format: preserve layout
|
|
56
|
-
const CUBE_NORMALS = new Float32Array([
|
|
57
|
-
// Front face
|
|
58
|
-
0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1,
|
|
59
|
-
// Back face
|
|
60
|
-
0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1,
|
|
61
|
-
// Top face
|
|
62
|
-
0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0,
|
|
63
|
-
// Bottom face
|
|
64
|
-
0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0,
|
|
65
|
-
// Right face
|
|
66
|
-
1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0,
|
|
67
|
-
// Left face
|
|
68
|
-
-1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0
|
|
69
|
-
]);
|
|
70
|
-
|
|
71
|
-
// biome-ignore format: preserve layout
|
|
72
|
-
const CUBE_TEX_COORDS = new Float32Array([
|
|
73
|
-
// Front face
|
|
74
|
-
0, 0, 1, 0, 1, 1, 0, 1,
|
|
75
|
-
// Back face
|
|
76
|
-
1, 0, 1, 1, 0, 1, 0, 0,
|
|
77
|
-
// Top face
|
|
78
|
-
0, 1, 0, 0, 1, 0, 1, 1,
|
|
79
|
-
// Bottom face
|
|
80
|
-
1, 1, 0, 1, 0, 0, 1, 0,
|
|
81
|
-
// Right face
|
|
82
|
-
1, 0, 1, 1, 0, 1, 0, 0,
|
|
83
|
-
// Left face
|
|
84
|
-
0, 0, 1, 0, 1, 1, 0, 1
|
|
85
|
-
]);
|
|
86
|
-
|
|
87
|
-
// biome-ignore format: preserve layout
|
|
88
|
-
const CUBE_FACE_INDICES = new Uint32Array([
|
|
89
|
-
0, 0, 0, 0,
|
|
90
|
-
1, 1, 1, 1,
|
|
91
|
-
2, 2, 2, 2,
|
|
92
|
-
3, 3, 3, 3,
|
|
93
|
-
4, 4, 4, 4,
|
|
94
|
-
5, 5, 5, 5
|
|
95
|
-
]);
|
|
96
|
-
|
|
97
|
-
// float4 position
|
|
98
|
-
// biome-ignore format: preserve layout
|
|
99
|
-
export const CUBE_NON_INDEXED_POSITIONS = new Float32Array([
|
|
100
|
-
1, -1, 1,
|
|
101
|
-
-1, -1, 1,
|
|
102
|
-
-1, -1, -1,
|
|
103
|
-
1, -1, -1,
|
|
104
|
-
1, -1, 1,
|
|
105
|
-
-1, -1, -1,
|
|
106
|
-
|
|
107
|
-
1, 1, 1,
|
|
108
|
-
1, -1, 1,
|
|
109
|
-
1, -1, -1,
|
|
110
|
-
1, 1, -1,
|
|
111
|
-
1, 1, 1,
|
|
112
|
-
1, -1, -1,
|
|
113
|
-
|
|
114
|
-
-1, 1, 1,
|
|
115
|
-
1, 1, 1,
|
|
116
|
-
1, 1, -1,
|
|
117
|
-
-1, 1, -1,
|
|
118
|
-
-1, 1, 1,
|
|
119
|
-
1, 1, -1,
|
|
120
|
-
|
|
121
|
-
-1, -1, 1,
|
|
122
|
-
-1, 1, 1,
|
|
123
|
-
-1, 1, -1,
|
|
124
|
-
-1, -1, -1,
|
|
125
|
-
-1, -1, 1,
|
|
126
|
-
-1, 1, -1,
|
|
127
|
-
|
|
128
|
-
1, 1, 1,
|
|
129
|
-
-1, 1, 1,
|
|
130
|
-
-1, -1, 1,
|
|
131
|
-
-1, -1, 1,
|
|
132
|
-
1, -1, 1,
|
|
133
|
-
1, 1, 1,
|
|
134
|
-
|
|
135
|
-
1, -1, -1,
|
|
136
|
-
-1, -1, -1,
|
|
137
|
-
-1, 1, -1,
|
|
138
|
-
1, 1, -1,
|
|
139
|
-
1, -1, -1,
|
|
140
|
-
-1, 1, -1,
|
|
141
|
-
]);
|
|
142
|
-
|
|
143
|
-
// float2 uv,
|
|
144
|
-
// biome-ignore format: preserve layout
|
|
145
|
-
export const CUBE_NON_INDEXED_TEX_COORDS = new Float32Array([
|
|
146
|
-
1, 1,
|
|
147
|
-
0, 1,
|
|
148
|
-
0, 0,
|
|
149
|
-
1, 0,
|
|
150
|
-
1, 1,
|
|
151
|
-
0, 0,
|
|
152
|
-
|
|
153
|
-
1, 1,
|
|
154
|
-
0, 1,
|
|
155
|
-
0, 0,
|
|
156
|
-
1, 0,
|
|
157
|
-
1, 1,
|
|
158
|
-
0, 0,
|
|
159
|
-
|
|
160
|
-
1, 1,
|
|
161
|
-
0, 1,
|
|
162
|
-
0, 0,
|
|
163
|
-
1, 0,
|
|
164
|
-
1, 1,
|
|
165
|
-
0, 0,
|
|
166
|
-
|
|
167
|
-
1, 1,
|
|
168
|
-
0, 1,
|
|
169
|
-
0, 0,
|
|
170
|
-
1, 0,
|
|
171
|
-
1, 1,
|
|
172
|
-
0, 0,
|
|
173
|
-
|
|
174
|
-
1, 1,
|
|
175
|
-
0, 1,
|
|
176
|
-
0, 0,
|
|
177
|
-
0, 0,
|
|
178
|
-
1, 0,
|
|
179
|
-
1, 1,
|
|
180
|
-
|
|
181
|
-
1, 1,
|
|
182
|
-
0, 1,
|
|
183
|
-
0, 0,
|
|
184
|
-
1, 0,
|
|
185
|
-
1, 1,
|
|
186
|
-
0, 0,
|
|
187
|
-
]);
|
|
188
|
-
|
|
189
|
-
// float4 color
|
|
190
|
-
// biome-ignore format: preserve layout
|
|
191
|
-
export const CUBE_NON_INDEXED_COLORS = new Float32Array([
|
|
192
|
-
1, 0, 1, 1,
|
|
193
|
-
0, 0, 1, 1,
|
|
194
|
-
0, 0, 0, 1,
|
|
195
|
-
1, 0, 0, 1,
|
|
196
|
-
1, 0, 1, 1,
|
|
197
|
-
0, 0, 0, 1,
|
|
198
|
-
|
|
199
|
-
1, 1, 1, 1,
|
|
200
|
-
1, 0, 1, 1,
|
|
201
|
-
1, 0, 0, 1,
|
|
202
|
-
1, 1, 0, 1,
|
|
203
|
-
1, 1, 1, 1,
|
|
204
|
-
1, 0, 0, 1,
|
|
205
|
-
|
|
206
|
-
0, 1, 1, 1,
|
|
207
|
-
1, 1, 1, 1,
|
|
208
|
-
1, 1, 0, 1,
|
|
209
|
-
0, 1, 0, 1,
|
|
210
|
-
0, 1, 1, 1,
|
|
211
|
-
1, 1, 0, 1,
|
|
212
|
-
|
|
213
|
-
0, 0, 1, 1,
|
|
214
|
-
0, 1, 1, 1,
|
|
215
|
-
0, 1, 0, 1,
|
|
216
|
-
0, 0, 0, 1,
|
|
217
|
-
0, 0, 1, 1,
|
|
218
|
-
0, 1, 0, 1,
|
|
219
|
-
|
|
220
|
-
1, 1, 1, 1,
|
|
221
|
-
0, 1, 1, 1,
|
|
222
|
-
0, 0, 1, 1,
|
|
223
|
-
0, 0, 1, 1,
|
|
224
|
-
1, 0, 1, 1,
|
|
225
|
-
1, 1, 1, 1,
|
|
226
|
-
|
|
227
|
-
1, 0, 0, 1,
|
|
228
|
-
0, 0, 0, 1,
|
|
229
|
-
0, 1, 0, 1,
|
|
230
|
-
1, 1, 0, 1,
|
|
231
|
-
1, 0, 0, 1,
|
|
232
|
-
0, 1, 0, 1,
|
|
233
|
-
]);
|
|
234
|
-
|
|
235
|
-
// biome-ignore format: preserve layout
|
|
236
|
-
export const CUBE_NON_INDEXED_FACE_INDICES = new Uint32Array([
|
|
237
|
-
3, 3, 3, 3, 3, 3,
|
|
238
|
-
4, 4, 4, 4, 4, 4,
|
|
239
|
-
2, 2, 2, 2, 2, 2,
|
|
240
|
-
5, 5, 5, 5, 5, 5,
|
|
241
|
-
0, 0, 0, 0, 0, 0,
|
|
242
|
-
1, 1, 1, 1, 1, 1
|
|
243
|
-
]);
|
|
244
|
-
|
|
245
|
-
const ATTRIBUTES = {
|
|
246
|
-
POSITION: {size: 3, value: CUBE_POSITIONS},
|
|
247
|
-
NORMAL: {size: 3, value: CUBE_NORMALS},
|
|
248
|
-
TEXCOORD_0: {size: 2, value: CUBE_TEX_COORDS},
|
|
249
|
-
faceIndex: {size: 1, value: CUBE_FACE_INDICES}
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
const NON_INDEXED_ATTRIBUTES = {
|
|
253
|
-
POSITION: {size: 3, value: CUBE_NON_INDEXED_POSITIONS},
|
|
254
|
-
// NORMAL: {size: 3, value: CUBE_NON_INDEXED_NORMALS},
|
|
255
|
-
TEXCOORD_0: {size: 2, value: CUBE_NON_INDEXED_TEX_COORDS},
|
|
256
|
-
COLOR_0: {size: 3, value: CUBE_NON_INDEXED_COLORS},
|
|
257
|
-
faceIndex: {size: 1, value: CUBE_NON_INDEXED_FACE_INDICES}
|
|
258
|
-
};
|