@vived/component-abb-6700 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.todo.md +13 -0
- package/README.md +122 -0
- package/dist/.gitkeep +0 -0
- package/dist/Adapters/aBB6700PMAdapter.d.ts +10 -0
- package/dist/Adapters/aBB6700PMAdapter.d.ts.map +1 -0
- package/dist/Controllers/createABB6700.d.ts +12 -0
- package/dist/Controllers/createABB6700.d.ts.map +1 -0
- package/dist/Controllers/getPose.d.ts +11 -0
- package/dist/Controllers/getPose.d.ts.map +1 -0
- package/dist/Controllers/setJointAngle.d.ts +12 -0
- package/dist/Controllers/setJointAngle.d.ts.map +1 -0
- package/dist/Controllers/setPose.d.ts +11 -0
- package/dist/Controllers/setPose.d.ts.map +1 -0
- package/dist/Entities/ABB6700Entity.d.ts +35 -0
- package/dist/Entities/ABB6700Entity.d.ts.map +1 -0
- package/dist/Entities/ABB6700Repo.d.ts +32 -0
- package/dist/Entities/ABB6700Repo.d.ts.map +1 -0
- package/dist/Factory/ABB6700FeatureFactory.d.ts +26 -0
- package/dist/Factory/ABB6700FeatureFactory.d.ts.map +1 -0
- package/dist/Mocks/MockABB6700PM.d.ts +11 -0
- package/dist/Mocks/MockABB6700PM.d.ts.map +1 -0
- package/dist/Mocks/MockSetJointAngleUC.d.ts +7 -0
- package/dist/Mocks/MockSetJointAngleUC.d.ts.map +1 -0
- package/dist/Mocks/MockSetPoseUC.d.ts +7 -0
- package/dist/Mocks/MockSetPoseUC.d.ts.map +1 -0
- package/dist/PMs/ABB6700PM.d.ts +32 -0
- package/dist/PMs/ABB6700PM.d.ts.map +1 -0
- package/dist/UCs/CalcStabilizerUC.d.ts +7 -0
- package/dist/UCs/CalcStabilizerUC.d.ts.map +1 -0
- package/dist/UCs/SetJointAngleUC.d.ts +15 -0
- package/dist/UCs/SetJointAngleUC.d.ts.map +1 -0
- package/dist/UCs/SetPoseUC.d.ts +22 -0
- package/dist/UCs/SetPoseUC.d.ts.map +1 -0
- package/dist/Views/ABB6700BabylonView.d.ts +27 -0
- package/dist/Views/ABB6700BabylonView.d.ts.map +1 -0
- package/dist/abb_6700.glb +0 -0
- package/dist/abstractAudioBus-CyBWsmuN.js +14 -0
- package/dist/animationGroup-BhNThqQe.js +1454 -0
- package/dist/basisTextureLoader-BT391BsV.js +310 -0
- package/dist/brdfTextureTools-DUyKBAXf.js +79 -0
- package/dist/bumpFragment-Dd-ojPA1.js +134 -0
- package/dist/bumpFragment-KE1_PuMl.js +287 -0
- package/dist/bumpVertex-BcdvVFVx.js +8 -0
- package/dist/bumpVertexDeclaration-B5Uvs-RS.js +8 -0
- package/dist/bumpVertexDeclaration-ixSg-yGI.js +8 -0
- package/dist/clipPlaneFragment-DJwQynjA.js +136 -0
- package/dist/clipPlaneVertex-D4Wk50XG.js +376 -0
- package/dist/clipPlaneVertex-eQ147Tn2.js +350 -0
- package/dist/component.config.d.ts +17 -0
- package/dist/component.config.d.ts.map +1 -0
- package/dist/ddsTextureLoader-DeoF3iGO.js +331 -0
- package/dist/default.fragment-DKnTR9nY.js +548 -0
- package/dist/default.fragment-rIGWrUS5.js +486 -0
- package/dist/default.vertex-Bt5y1VyA.js +212 -0
- package/dist/default.vertex-Dext1liJ.js +224 -0
- package/dist/defaultUboDeclaration-BwslQZX8.js +11 -0
- package/dist/defaultUboDeclaration-DSXACgip.js +9 -0
- package/dist/easing-BAt0SO-B.js +163 -0
- package/dist/envTextureLoader-CBiW_Q-U.js +40 -0
- package/dist/exrTextureLoader-5SC6PKIA.js +740 -0
- package/dist/flowGraphApplyForceBlock-6e8-wcaw.js +32 -0
- package/dist/flowGraphApplyImpulseBlock-B27EZQow.js +32 -0
- package/dist/flowGraphArrayIndexBlock-DIUn5e4i.js +31 -0
- package/dist/flowGraphBezierCurveEasingBlock-BJmiHk40.js +25 -0
- package/dist/flowGraphBinaryOperationBlock-Bj7TANCc.js +25 -0
- package/dist/flowGraphBranchBlock-7CRvIKWc.js +19 -0
- package/dist/flowGraphCachedOperationBlock-CP1ZiuIB.js +26 -0
- package/dist/flowGraphCancelDelayBlock-DqtgzBGm.js +20 -0
- package/dist/flowGraphCodeExecutionBlock-CaYXCGqo.js +23 -0
- package/dist/flowGraphConditionalDataBlock-DJ7evX8_.js +28 -0
- package/dist/flowGraphConsoleLogBlock-cMkpqLzO.js +68 -0
- package/dist/flowGraphConstantBlock-JWybwT0A.js +28 -0
- package/dist/flowGraphContextBlock-CFDXHcbn.js +19 -0
- package/dist/flowGraphCounterBlock-B0uPkgw9.js +24 -0
- package/dist/flowGraphDataSwitchBlock-B0GSifvJ.js +27 -0
- package/dist/flowGraphDebounceBlock-CSw8zKym.js +24 -0
- package/dist/flowGraphDebugBlock-DiSR6Ahn.js +65 -0
- package/dist/flowGraphDoNBlock-C-48oQ2H.js +24 -0
- package/dist/flowGraphEasingBlock-DKUaE7Rp.js +50 -0
- package/dist/flowGraphFlipFlopBlock-DX5BGhMV.js +20 -0
- package/dist/flowGraphForLoopBlock-Di-Qwg23.js +27 -0
- package/dist/flowGraphFunctionReferenceBlock-D8X5TFsO.js +20 -0
- package/dist/flowGraphGLTFDataProvider-C4j7nPQv.js +16 -0
- package/dist/flowGraphGetAngularVelocityBlock-Cq-yTQ4D.js +31 -0
- package/dist/flowGraphGetAssetBlock-B36eioor.js +21 -0
- package/dist/flowGraphGetLinearVelocityBlock-MdrV0eUD.js +31 -0
- package/dist/flowGraphGetPhysicsMassPropertiesBlock-wXDZP1wM.js +30 -0
- package/dist/flowGraphGetPropertyBlock-eP0badwf.js +46 -0
- package/dist/flowGraphGetSoundVolumeBlock-D3gXGHXa.js +29 -0
- package/dist/flowGraphGetVariableBlock-C7-qZAec.js +31 -0
- package/dist/flowGraphIndexOfBlock-CC5l9n9P.js +31 -0
- package/dist/flowGraphInterpolationBlock-B6922jzt.js +50 -0
- package/dist/flowGraphIsKeyPressedBlock-X_iuiUOX.js +31 -0
- package/dist/flowGraphIsSoundPlayingBlock-DONQX8N8.js +29 -0
- package/dist/flowGraphJsonPointerParserBlock-DBH_gN8I.js +95 -0
- package/dist/flowGraphKeyDownEventBlock-D5T1Uyfv.js +26 -0
- package/dist/flowGraphKeyUpEventBlock-BPY_Kgkm.js +21 -0
- package/dist/flowGraphKeyboardEventBlock-C49fx3TC.js +20 -0
- package/dist/flowGraphMathBlocks-CkvrN3VJ.js +864 -0
- package/dist/flowGraphMathCombineExtractBlocks-QSjGlnoz.js +248 -0
- package/dist/flowGraphMatrixMathBlocks-B3D7Cz9p.js +117 -0
- package/dist/flowGraphMeshPickEventBlock-BBTz-taa.js +35 -0
- package/dist/flowGraphMultiGateBlock-BhY1y5BG.js +50 -0
- package/dist/flowGraphPauseAnimationBlock-CHZZXMbg.js +19 -0
- package/dist/flowGraphPauseSoundBlock-B7hMmJ0c.js +31 -0
- package/dist/flowGraphPhysicsCollisionEventBlock-CxoPpT-q.js +56 -0
- package/dist/flowGraphPlayAnimationBlock-DVAvIFux.js +99 -0
- package/dist/flowGraphPlaySoundBlock-DjHGrqbC.js +32 -0
- package/dist/flowGraphPointerDownEventBlock-qI-H0JST.js +31 -0
- package/dist/flowGraphPointerMoveEventBlock-DAi4VUyy.js +31 -0
- package/dist/flowGraphPointerOutEventBlock-CFtj68aC.js +21 -0
- package/dist/flowGraphPointerOverEventBlock-VxdHhFuu.js +23 -0
- package/dist/flowGraphPointerUpEventBlock-DRR1f07q.js +31 -0
- package/dist/flowGraphReceiveCustomEventBlock-B3bwdB66.js +52 -0
- package/dist/flowGraphSceneReadyEventBlock-Dy6lDT3j.js +23 -0
- package/dist/flowGraphSceneTickEventBlock-Bl9BF_Xw.js +32 -0
- package/dist/flowGraphSendCustomEventBlock-BAR4PGFq.js +35 -0
- package/dist/flowGraphSequenceBlock-veqU32ZZ.js +32 -0
- package/dist/flowGraphSetAngularVelocityBlock-Dj9b-zu6.js +31 -0
- package/dist/flowGraphSetDelayBlock-CMjudtvk.js +131 -0
- package/dist/flowGraphSetLinearVelocityBlock-DVDhhJBd.js +31 -0
- package/dist/flowGraphSetPhysicsMotionTypeBlock-CL3cxNCO.js +36 -0
- package/dist/flowGraphSetPropertyBlock-D3sWL3Ss.js +47 -0
- package/dist/flowGraphSetSoundVolumeBlock-CxVk45yR.js +32 -0
- package/dist/flowGraphSetVariableBlock-D1oJiwLj.js +47 -0
- package/dist/flowGraphSoundEndedEventBlock-CubEwii0.js +47 -0
- package/dist/flowGraphStopAnimationBlock-B9inwIQx.js +48 -0
- package/dist/flowGraphStopSoundBlock-BijIX2jC.js +31 -0
- package/dist/flowGraphSwitchBlock-BMhPb4OX.js +54 -0
- package/dist/flowGraphThrottleBlock-C7vrnkb1.js +37 -0
- package/dist/flowGraphTransformCoordinatesSystemBlock-DoISqaUG.js +29 -0
- package/dist/flowGraphTypeToTypeBlocks-CSML6QWx.js +57 -0
- package/dist/flowGraphUnaryOperationBlock-B0Shf-lJ.js +24 -0
- package/dist/flowGraphVectorMathBlocks-DoTRR_E0.js +178 -0
- package/dist/flowGraphWaitAllBlock-BvmDMc24.js +54 -0
- package/dist/flowGraphWhileLoopBlock-BaIq4-K2.js +27 -0
- package/dist/geometry.fragment-Bsis3UG2.js +275 -0
- package/dist/geometry.vertex-DskQ5b8j.js +222 -0
- package/dist/harmonicsFunctions-CtNrRfir.js +193 -0
- package/dist/harmonicsFunctions-PEz6APC7.js +18 -0
- package/dist/hdrTextureLoader-D9rYxJ9q.js +112 -0
- package/dist/helperFunctions-Bt7Zfkrp.js +89 -0
- package/dist/helperFunctions-CPmRxd37.js +121 -0
- package/dist/iesTextureLoader-BGUFjVhI.js +93 -0
- package/dist/index-CS3Icp_r.js +67657 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/ktxTextureLoader-cUaGg9_L.js +459 -0
- package/dist/lightFragment-BRDibDKG.js +404 -0
- package/dist/lightFragment-DCqtGMp_.js +402 -0
- package/dist/logDepthDeclaration-Bwm-3KyB.js +16 -0
- package/dist/logDepthDeclaration-gUfeSnXX.js +20 -0
- package/dist/logDepthVertex-CKeuJ6ae.js +213 -0
- package/dist/logDepthVertex-CXkmZels.js +459 -0
- package/dist/mesh.vertexData.functions-Bc9lJlrU.js +74 -0
- package/dist/oitFragment-B8zuQigp.js +792 -0
- package/dist/oitFragment-DH3h3T6x.js +657 -0
- package/dist/openpbr.fragment-BglYS6LA.js +1405 -0
- package/dist/openpbr.fragment-DrOTZs4m.js +1553 -0
- package/dist/openpbr.vertex-B-PaLFOR.js +384 -0
- package/dist/openpbr.vertex-DMdFRTnX.js +268 -0
- package/dist/openpbrMaterial-HCU0aOca.js +2880 -0
- package/dist/openpbrMaterialLoadingAdapter-CWRAa-7S.js +1122 -0
- package/dist/openpbrTransmissionLayerData-CfDVObj5.js +352 -0
- package/dist/openpbrUboDeclaration-CA2pvSbt.js +9 -0
- package/dist/openpbrUboDeclaration-xU8VOaib.js +10 -0
- package/dist/pass.fragment-1mMP54bb.js +10 -0
- package/dist/pass.fragment-DzaUp_jk.js +10 -0
- package/dist/passCube.fragment-CQaXS7g3.js +29 -0
- package/dist/passCube.fragment-QJGPwAXI.js +29 -0
- package/dist/pbr.fragment-BnaAAGxb.js +2775 -0
- package/dist/pbr.fragment-CYZk_EGU.js +2619 -0
- package/dist/pbr.vertex-CyvdCw91.js +372 -0
- package/dist/pbr.vertex-DJMAkDxs.js +270 -0
- package/dist/pbrBRDFFunctions-EugoWm6O.js +175 -0
- package/dist/pbrDebug-Bk3sPoEG.js +719 -0
- package/dist/pbrDebug-Cdalzb1I.js +614 -0
- package/dist/pbrIBLFunctions-B0bVAXCF.js +47 -0
- package/dist/pbrIBLFunctions-C06z-ouZ.js +51 -0
- package/dist/pbrMaterial-C4FCKBZQ.js +1660 -0
- package/dist/pbrMaterialLoadingAdapter-BGHlS_ZN.js +1032 -0
- package/dist/pbrUboDeclaration-1lN5_-Bw.js +9 -0
- package/dist/pbrUboDeclaration-BJOUUOZ2.js +10 -0
- package/dist/procedural.vertex-CFPKczKj.js +14 -0
- package/dist/procedural.vertex-DUW7bYZt.js +13 -0
- package/dist/rgbdDecode.fragment-CEGgE4tL.js +8 -0
- package/dist/rgbdDecode.fragment-FT0wkgah.js +8 -0
- package/dist/rgbdEncode.fragment-CLnJJf6E.js +8 -0
- package/dist/rgbdEncode.fragment-CaAcMsY9.js +8 -0
- package/dist/sceneUboDeclaration-B6oxsfcj.js +8 -0
- package/dist/sceneUboDeclaration-JByfVKik.js +13 -0
- package/dist/setupABB6700InstanceFactory.d.ts +7 -0
- package/dist/setupABB6700InstanceFactory.d.ts.map +1 -0
- package/dist/studio.env +0 -0
- package/dist/textureProcessor.fragment-BYPw6SMQ.js +152 -0
- package/dist/textureProcessor.fragment-Ciw9-F3w.js +157 -0
- package/dist/textureTools-Cct_bGgp.js +40 -0
- package/dist/tgaTextureLoader-BJOIdnFr.js +198 -0
- package/dist/thinEngine-Bt9FW4dD.js +2425 -0
- package/dist/webAudioBus-BUzRHSxr.js +88 -0
- package/dist/webAudioMainBus-Dds1TgJG.js +49 -0
- package/package.json +49 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import { x as O, a7 as P, F as Ae, b2 as pe } from "./index-CS3Icp_r.js";
|
|
2
|
+
import { F as U, T as g } from "./textureTools-Cct_bGgp.js";
|
|
3
|
+
const ue = 542327876, q = 131072, J = 512, K = 4, Q = 64, V = 131072;
|
|
4
|
+
function H(d) {
|
|
5
|
+
return d.charCodeAt(0) + (d.charCodeAt(1) << 8) + (d.charCodeAt(2) << 16) + (d.charCodeAt(3) << 24);
|
|
6
|
+
}
|
|
7
|
+
function ye(d) {
|
|
8
|
+
return String.fromCharCode(d & 255, d >> 8 & 255, d >> 16 & 255, d >> 24 & 255);
|
|
9
|
+
}
|
|
10
|
+
const Z = H("DXT1"), $ = H("DXT3"), ee = H("DXT5"), z = H("DX10"), te = 113, re = 116, ae = 2, se = 10, Ce = 88, N = 31, Fe = 0, me = 1, oe = 2, ne = 3, S = 4, fe = 7, W = 20, ce = 21, Ge = 22, he = 23, be = 24, de = 25, Be = 26, Re = 28, _e = 32;
|
|
11
|
+
class p {
|
|
12
|
+
/**
|
|
13
|
+
* Gets DDS information from an array buffer
|
|
14
|
+
* @param data defines the array buffer view to read data from
|
|
15
|
+
* @returns the DDS information
|
|
16
|
+
*/
|
|
17
|
+
static GetDDSInfo(a) {
|
|
18
|
+
const t = new Int32Array(a.buffer, a.byteOffset, N), f = new Int32Array(a.buffer, a.byteOffset, N + 4);
|
|
19
|
+
let o = 1;
|
|
20
|
+
t[oe] & q && (o = Math.max(1, t[fe]));
|
|
21
|
+
const i = t[ce], n = i === z ? f[_e] : 0;
|
|
22
|
+
let r = 0;
|
|
23
|
+
switch (i) {
|
|
24
|
+
case te:
|
|
25
|
+
r = 2;
|
|
26
|
+
break;
|
|
27
|
+
case re:
|
|
28
|
+
r = 1;
|
|
29
|
+
break;
|
|
30
|
+
case z:
|
|
31
|
+
if (n === se) {
|
|
32
|
+
r = 2;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
if (n === ae) {
|
|
36
|
+
r = 1;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
width: t[S],
|
|
42
|
+
height: t[ne],
|
|
43
|
+
mipmapCount: o,
|
|
44
|
+
isFourCC: (t[W] & K) === K,
|
|
45
|
+
isRGB: (t[W] & Q) === Q,
|
|
46
|
+
isLuminance: (t[W] & V) === V,
|
|
47
|
+
isCube: (t[Re] & J) === J,
|
|
48
|
+
isCompressed: i === Z || i === $ || i === ee,
|
|
49
|
+
dxgiFormat: n,
|
|
50
|
+
textureType: r
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
static _GetHalfFloatAsFloatRGBAArrayBuffer(a, t, f, o, i, n) {
|
|
54
|
+
const r = new Float32Array(o), l = new Uint16Array(i, f);
|
|
55
|
+
let e = 0;
|
|
56
|
+
for (let s = 0; s < t; s++)
|
|
57
|
+
for (let A = 0; A < a; A++) {
|
|
58
|
+
const c = (A + s * a) * 4;
|
|
59
|
+
r[e] = U(l[c]), r[e + 1] = U(l[c + 1]), r[e + 2] = U(l[c + 2]), p.StoreLODInAlphaChannel ? r[e + 3] = n : r[e + 3] = U(l[c + 3]), e += 4;
|
|
60
|
+
}
|
|
61
|
+
return r;
|
|
62
|
+
}
|
|
63
|
+
static _GetHalfFloatRGBAArrayBuffer(a, t, f, o, i, n) {
|
|
64
|
+
if (p.StoreLODInAlphaChannel) {
|
|
65
|
+
const r = new Uint16Array(o), l = new Uint16Array(i, f);
|
|
66
|
+
let e = 0;
|
|
67
|
+
for (let s = 0; s < t; s++)
|
|
68
|
+
for (let A = 0; A < a; A++) {
|
|
69
|
+
const c = (A + s * a) * 4;
|
|
70
|
+
r[e] = l[c], r[e + 1] = l[c + 1], r[e + 2] = l[c + 2], r[e + 3] = g(n), e += 4;
|
|
71
|
+
}
|
|
72
|
+
return r;
|
|
73
|
+
}
|
|
74
|
+
return new Uint16Array(i, f, o);
|
|
75
|
+
}
|
|
76
|
+
static _GetFloatRGBAArrayBuffer(a, t, f, o, i, n) {
|
|
77
|
+
if (p.StoreLODInAlphaChannel) {
|
|
78
|
+
const r = new Float32Array(o), l = new Float32Array(i, f);
|
|
79
|
+
let e = 0;
|
|
80
|
+
for (let s = 0; s < t; s++)
|
|
81
|
+
for (let A = 0; A < a; A++) {
|
|
82
|
+
const c = (A + s * a) * 4;
|
|
83
|
+
r[e] = l[c], r[e + 1] = l[c + 1], r[e + 2] = l[c + 2], r[e + 3] = n, e += 4;
|
|
84
|
+
}
|
|
85
|
+
return r;
|
|
86
|
+
}
|
|
87
|
+
return new Float32Array(i, f, o);
|
|
88
|
+
}
|
|
89
|
+
static _GetFloatAsHalfFloatRGBAArrayBuffer(a, t, f, o, i, n) {
|
|
90
|
+
const r = new Uint16Array(o), l = new Float32Array(i, f);
|
|
91
|
+
let e = 0;
|
|
92
|
+
for (let s = 0; s < t; s++)
|
|
93
|
+
for (let A = 0; A < a; A++)
|
|
94
|
+
r[e] = g(l[e]), r[e + 1] = g(l[e + 1]), r[e + 2] = g(l[e + 2]), p.StoreLODInAlphaChannel ? r[e + 3] = g(n) : r[e + 3] = g(l[e + 3]), e += 4;
|
|
95
|
+
return r;
|
|
96
|
+
}
|
|
97
|
+
static _GetFloatAsUIntRGBAArrayBuffer(a, t, f, o, i, n) {
|
|
98
|
+
const r = new Uint8Array(o), l = new Float32Array(i, f);
|
|
99
|
+
let e = 0;
|
|
100
|
+
for (let s = 0; s < t; s++)
|
|
101
|
+
for (let A = 0; A < a; A++) {
|
|
102
|
+
const c = (A + s * a) * 4;
|
|
103
|
+
r[e] = O(l[c]) * 255, r[e + 1] = O(l[c + 1]) * 255, r[e + 2] = O(l[c + 2]) * 255, p.StoreLODInAlphaChannel ? r[e + 3] = n : r[e + 3] = O(l[c + 3]) * 255, e += 4;
|
|
104
|
+
}
|
|
105
|
+
return r;
|
|
106
|
+
}
|
|
107
|
+
static _GetHalfFloatAsUIntRGBAArrayBuffer(a, t, f, o, i, n) {
|
|
108
|
+
const r = new Uint8Array(o), l = new Uint16Array(i, f);
|
|
109
|
+
let e = 0;
|
|
110
|
+
for (let s = 0; s < t; s++)
|
|
111
|
+
for (let A = 0; A < a; A++) {
|
|
112
|
+
const c = (A + s * a) * 4;
|
|
113
|
+
r[e] = O(U(l[c])) * 255, r[e + 1] = O(U(l[c + 1])) * 255, r[e + 2] = O(U(l[c + 2])) * 255, p.StoreLODInAlphaChannel ? r[e + 3] = n : r[e + 3] = O(U(l[c + 3])) * 255, e += 4;
|
|
114
|
+
}
|
|
115
|
+
return r;
|
|
116
|
+
}
|
|
117
|
+
static _GetRGBAArrayBuffer(a, t, f, o, i, n, r, l, e) {
|
|
118
|
+
const s = new Uint8Array(o), A = new Uint8Array(i, f);
|
|
119
|
+
let c = 0;
|
|
120
|
+
for (let b = 0; b < t; b++)
|
|
121
|
+
for (let u = 0; u < a; u++) {
|
|
122
|
+
const y = (u + b * a) * 4;
|
|
123
|
+
s[c] = A[y + n], s[c + 1] = A[y + r], s[c + 2] = A[y + l], s[c + 3] = A[y + e], c += 4;
|
|
124
|
+
}
|
|
125
|
+
return s;
|
|
126
|
+
}
|
|
127
|
+
static _ExtractLongWordOrder(a) {
|
|
128
|
+
return a === 0 || a === 255 || a === -16777216 ? 0 : 1 + p._ExtractLongWordOrder(a >> 8);
|
|
129
|
+
}
|
|
130
|
+
static _GetRGBArrayBuffer(a, t, f, o, i, n, r, l) {
|
|
131
|
+
const e = new Uint8Array(o), s = new Uint8Array(i, f);
|
|
132
|
+
let A = 0;
|
|
133
|
+
for (let c = 0; c < t; c++)
|
|
134
|
+
for (let b = 0; b < a; b++) {
|
|
135
|
+
const u = (b + c * a) * 3;
|
|
136
|
+
e[A] = s[u + n], e[A + 1] = s[u + r], e[A + 2] = s[u + l], A += 3;
|
|
137
|
+
}
|
|
138
|
+
return e;
|
|
139
|
+
}
|
|
140
|
+
static _GetLuminanceArrayBuffer(a, t, f, o, i) {
|
|
141
|
+
const n = new Uint8Array(o), r = new Uint8Array(i, f);
|
|
142
|
+
let l = 0;
|
|
143
|
+
for (let e = 0; e < t; e++)
|
|
144
|
+
for (let s = 0; s < a; s++) {
|
|
145
|
+
const A = s + e * a;
|
|
146
|
+
n[l] = r[A], l++;
|
|
147
|
+
}
|
|
148
|
+
return n;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Uploads DDS Levels to a Babylon Texture
|
|
152
|
+
* @internal
|
|
153
|
+
*/
|
|
154
|
+
static UploadDDSLevels(a, t, f, o, i, n, r = -1, l, e = !0) {
|
|
155
|
+
let s = null;
|
|
156
|
+
o.sphericalPolynomial && (s = []);
|
|
157
|
+
const A = !!a.getCaps().s3tc;
|
|
158
|
+
t.generateMipMaps = i;
|
|
159
|
+
const c = new Int32Array(f.buffer, f.byteOffset, N);
|
|
160
|
+
let b, u, y, C = 0, G, R, E, L, k = 0, I = 1;
|
|
161
|
+
if (c[Fe] !== ue) {
|
|
162
|
+
P.Error("Invalid magic number in DDS header");
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (!o.isFourCC && !o.isRGB && !o.isLuminance) {
|
|
166
|
+
P.Error("Unsupported format, must contain a FourCC, RGB or LUMINANCE code");
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (o.isCompressed && !A) {
|
|
170
|
+
P.Error("Compressed textures are not supported on this platform.");
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
let F = c[Ge];
|
|
174
|
+
G = c[me] + 4;
|
|
175
|
+
let x = !1;
|
|
176
|
+
if (o.isFourCC)
|
|
177
|
+
switch (b = c[ce], b) {
|
|
178
|
+
case Z:
|
|
179
|
+
I = 8, k = 33777;
|
|
180
|
+
break;
|
|
181
|
+
case $:
|
|
182
|
+
I = 16, k = 33778;
|
|
183
|
+
break;
|
|
184
|
+
case ee:
|
|
185
|
+
I = 16, k = 33779;
|
|
186
|
+
break;
|
|
187
|
+
case te:
|
|
188
|
+
x = !0, F = 64;
|
|
189
|
+
break;
|
|
190
|
+
case re:
|
|
191
|
+
x = !0, F = 128;
|
|
192
|
+
break;
|
|
193
|
+
case z: {
|
|
194
|
+
G += 20;
|
|
195
|
+
let h = !1;
|
|
196
|
+
switch (o.dxgiFormat) {
|
|
197
|
+
case se:
|
|
198
|
+
x = !0, F = 64, h = !0;
|
|
199
|
+
break;
|
|
200
|
+
case ae:
|
|
201
|
+
x = !0, F = 128, h = !0;
|
|
202
|
+
break;
|
|
203
|
+
case Ce:
|
|
204
|
+
o.isRGB = !0, o.isFourCC = !1, F = 32, h = !0;
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
if (h)
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
// eslint-disable-next-line no-fallthrough
|
|
211
|
+
default:
|
|
212
|
+
P.Error(["Unsupported FourCC code:", ye(b)]);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
const v = p._ExtractLongWordOrder(c[he]), Y = p._ExtractLongWordOrder(c[be]), j = p._ExtractLongWordOrder(c[de]), le = p._ExtractLongWordOrder(c[Be]);
|
|
216
|
+
x && (k = a._getRGBABufferInternalSizedFormat(o.textureType)), E = 1, c[oe] & q && i !== !1 && (E = Math.max(1, c[fe]));
|
|
217
|
+
const ie = l || 0, M = a.getCaps();
|
|
218
|
+
for (let h = ie; h < n; h++) {
|
|
219
|
+
for (u = c[S], y = c[ne], L = 0; L < E; ++L) {
|
|
220
|
+
if (r === -1 || r === L) {
|
|
221
|
+
const m = r === -1 ? L : 0;
|
|
222
|
+
if (!o.isCompressed && o.isFourCC) {
|
|
223
|
+
t.format = 5, C = u * y * 4;
|
|
224
|
+
let B = null;
|
|
225
|
+
if (a._badOS || a._badDesktopOS || !M.textureHalfFloat && !M.textureFloat)
|
|
226
|
+
F === 128 ? (B = p._GetFloatAsUIntRGBAArrayBuffer(u, y, f.byteOffset + G, C, f.buffer, m), s && m == 0 && s.push(p._GetFloatRGBAArrayBuffer(u, y, f.byteOffset + G, C, f.buffer, m))) : F === 64 && (B = p._GetHalfFloatAsUIntRGBAArrayBuffer(u, y, f.byteOffset + G, C, f.buffer, m), s && m == 0 && s.push(p._GetHalfFloatAsFloatRGBAArrayBuffer(u, y, f.byteOffset + G, C, f.buffer, m))), t.type = 0;
|
|
227
|
+
else {
|
|
228
|
+
const D = M.textureFloat && (e && M.textureFloatLinearFiltering || !e), X = M.textureHalfFloat && (e && M.textureHalfFloatLinearFiltering || !e), T = (F === 128 || F === 64 && !X) && D ? 1 : (F === 64 || F === 128 && !D) && X ? 2 : 0;
|
|
229
|
+
let w, _ = null;
|
|
230
|
+
switch (F) {
|
|
231
|
+
case 128: {
|
|
232
|
+
switch (T) {
|
|
233
|
+
case 1:
|
|
234
|
+
w = p._GetFloatRGBAArrayBuffer, _ = null;
|
|
235
|
+
break;
|
|
236
|
+
case 2:
|
|
237
|
+
w = p._GetFloatAsHalfFloatRGBAArrayBuffer, _ = p._GetFloatRGBAArrayBuffer;
|
|
238
|
+
break;
|
|
239
|
+
case 0:
|
|
240
|
+
w = p._GetFloatAsUIntRGBAArrayBuffer, _ = p._GetFloatRGBAArrayBuffer;
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
default: {
|
|
246
|
+
switch (T) {
|
|
247
|
+
case 1:
|
|
248
|
+
w = p._GetHalfFloatAsFloatRGBAArrayBuffer, _ = null;
|
|
249
|
+
break;
|
|
250
|
+
case 2:
|
|
251
|
+
w = p._GetHalfFloatRGBAArrayBuffer, _ = p._GetHalfFloatAsFloatRGBAArrayBuffer;
|
|
252
|
+
break;
|
|
253
|
+
case 0:
|
|
254
|
+
w = p._GetHalfFloatAsUIntRGBAArrayBuffer, _ = p._GetHalfFloatAsFloatRGBAArrayBuffer;
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
t.type = T, B = w(u, y, f.byteOffset + G, C, f.buffer, m), s && m == 0 && s.push(_ ? _(u, y, f.byteOffset + G, C, f.buffer, m) : B);
|
|
261
|
+
}
|
|
262
|
+
B && a._uploadDataToTextureDirectly(t, B, h, m);
|
|
263
|
+
} else if (o.isRGB)
|
|
264
|
+
t.type = 0, F === 24 ? (t.format = 4, C = u * y * 3, R = p._GetRGBArrayBuffer(u, y, f.byteOffset + G, C, f.buffer, v, Y, j), a._uploadDataToTextureDirectly(t, R, h, m)) : (t.format = 5, C = u * y * 4, R = p._GetRGBAArrayBuffer(u, y, f.byteOffset + G, C, f.buffer, v, Y, j, le), a._uploadDataToTextureDirectly(t, R, h, m));
|
|
265
|
+
else if (o.isLuminance) {
|
|
266
|
+
const B = a._getUnpackAlignement(), D = u;
|
|
267
|
+
C = Math.floor((u + B - 1) / B) * B * (y - 1) + D, R = p._GetLuminanceArrayBuffer(u, y, f.byteOffset + G, C, f.buffer), t.format = 1, t.type = 0, a._uploadDataToTextureDirectly(t, R, h, m);
|
|
268
|
+
} else
|
|
269
|
+
C = Math.max(4, u) / 4 * Math.max(4, y) / 4 * I, R = new Uint8Array(f.buffer, f.byteOffset + G, C), t.type = 0, a._uploadCompressedDataToTextureDirectly(t, k, u, y, R, h, m);
|
|
270
|
+
}
|
|
271
|
+
G += F ? u * y * (F / 8) : C, u *= 0.5, y *= 0.5, u = Math.max(1, u), y = Math.max(1, y);
|
|
272
|
+
}
|
|
273
|
+
if (l !== void 0)
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
s && s.length > 0 ? o.sphericalPolynomial = Ae.ConvertCubeMapToSphericalPolynomial({
|
|
277
|
+
size: c[S],
|
|
278
|
+
right: s[0],
|
|
279
|
+
left: s[1],
|
|
280
|
+
up: s[2],
|
|
281
|
+
down: s[3],
|
|
282
|
+
front: s[4],
|
|
283
|
+
back: s[5],
|
|
284
|
+
format: 5,
|
|
285
|
+
type: 1,
|
|
286
|
+
gammaSpace: !1
|
|
287
|
+
}) : o.sphericalPolynomial = void 0;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
p.StoreLODInAlphaChannel = !1;
|
|
291
|
+
class we {
|
|
292
|
+
constructor() {
|
|
293
|
+
this.supportCascades = !0;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Uploads the cube texture data to the WebGL texture. It has already been bound.
|
|
297
|
+
* @param imgs contains the cube maps
|
|
298
|
+
* @param texture defines the BabylonJS internal texture
|
|
299
|
+
* @param createPolynomials will be true if polynomials have been requested
|
|
300
|
+
* @param onLoad defines the callback to trigger once the texture is ready
|
|
301
|
+
*/
|
|
302
|
+
loadCubeData(a, t, f, o) {
|
|
303
|
+
const i = t.getEngine();
|
|
304
|
+
let n, r = !1, l = 1e3;
|
|
305
|
+
if (Array.isArray(a))
|
|
306
|
+
for (let e = 0; e < a.length; e++) {
|
|
307
|
+
const s = a[e];
|
|
308
|
+
n = p.GetDDSInfo(s), t.width = n.width, t.height = n.height, r = (n.isRGB || n.isLuminance || n.mipmapCount > 1) && t.generateMipMaps, i._unpackFlipY(n.isCompressed), p.UploadDDSLevels(i, t, s, n, r, 6, -1, e), !n.isFourCC && n.mipmapCount === 1 ? i.generateMipMapsForCubemap(t) : l = n.mipmapCount - 1;
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
const e = a;
|
|
312
|
+
n = p.GetDDSInfo(e), t.width = n.width, t.height = n.height, f && (n.sphericalPolynomial = new pe()), r = (n.isRGB || n.isLuminance || n.mipmapCount > 1) && t.generateMipMaps, i._unpackFlipY(n.isCompressed), p.UploadDDSLevels(i, t, e, n, r, 6), !n.isFourCC && n.mipmapCount === 1 ? i.generateMipMapsForCubemap(t, !1) : l = n.mipmapCount - 1;
|
|
313
|
+
}
|
|
314
|
+
i._setCubeMapTextureParams(t, r, l), t.isReady = !0, t.onLoadedObservable.notifyObservers(t), t.onLoadedObservable.clear(), o && o({ isDDS: !0, width: t.width, info: n, data: a, texture: t });
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
|
|
318
|
+
* @param data contains the texture data
|
|
319
|
+
* @param texture defines the BabylonJS internal texture
|
|
320
|
+
* @param callback defines the method to call once ready to upload
|
|
321
|
+
*/
|
|
322
|
+
loadData(a, t, f) {
|
|
323
|
+
const o = p.GetDDSInfo(a), i = (o.isRGB || o.isLuminance || o.mipmapCount > 1) && t.generateMipMaps && Math.max(o.width, o.height) >> o.mipmapCount - 1 === 1;
|
|
324
|
+
f(o.width, o.height, i, o.isFourCC, () => {
|
|
325
|
+
p.UploadDDSLevels(t.getEngine(), t, a, o, i, 1);
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
export {
|
|
330
|
+
we as _DDSTextureLoader
|
|
331
|
+
};
|