@sapui5/sap.ui.vbm 1.93.1 → 1.97.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/package.json +1 -1
- package/src/sap/ui/vbm/.library +1 -1
- package/src/sap/ui/vbm/Adapter.js +18 -15
- package/src/sap/ui/vbm/Adapter3D.js +2 -3
- package/src/sap/ui/vbm/AnalyticMap.js +1 -2
- package/src/sap/ui/vbm/AnalyticMapRenderer.js +1 -2
- package/src/sap/ui/vbm/Area.js +1 -2
- package/src/sap/ui/vbm/Areas.js +8 -10
- package/src/sap/ui/vbm/Box.js +1 -2
- package/src/sap/ui/vbm/Boxes.js +1 -2
- package/src/sap/ui/vbm/Circle.js +1 -2
- package/src/sap/ui/vbm/Circles.js +1 -2
- package/src/sap/ui/vbm/Cluster.js +5 -5
- package/src/sap/ui/vbm/ClusterBase.js +5 -9
- package/src/sap/ui/vbm/ClusterContainer.js +1 -2
- package/src/sap/ui/vbm/ClusterDistance.js +1 -2
- package/src/sap/ui/vbm/ClusterGrid.js +1 -2
- package/src/sap/ui/vbm/ClusterRenderer.js +1 -3
- package/src/sap/ui/vbm/ClusterTree.js +1 -2
- package/src/sap/ui/vbm/Container.js +1 -2
- package/src/sap/ui/vbm/Containers.js +4 -7
- package/src/sap/ui/vbm/DragSource.js +1 -2
- package/src/sap/ui/vbm/DropTarget.js +1 -2
- package/src/sap/ui/vbm/Feature.js +1 -2
- package/src/sap/ui/vbm/FeatureCollection.js +1 -2
- package/src/sap/ui/vbm/GeoCircle.js +1 -2
- package/src/sap/ui/vbm/GeoCircles.js +1 -2
- package/src/sap/ui/vbm/GeoJsonLayer.js +10 -12
- package/src/sap/ui/vbm/GeoMap.js +4 -4
- package/src/sap/ui/vbm/GeoMapRenderer.js +1 -2
- package/src/sap/ui/vbm/HeatPoint.js +1 -2
- package/src/sap/ui/vbm/Heatmap.js +1 -2
- package/src/sap/ui/vbm/Legend.js +1 -2
- package/src/sap/ui/vbm/LegendItem.js +1 -2
- package/src/sap/ui/vbm/Pie.js +1 -2
- package/src/sap/ui/vbm/PieItem.js +1 -2
- package/src/sap/ui/vbm/Pies.js +1 -2
- package/src/sap/ui/vbm/Region.js +1 -2
- package/src/sap/ui/vbm/Resource.js +1 -2
- package/src/sap/ui/vbm/Route.js +1 -2
- package/src/sap/ui/vbm/Routes.js +1 -2
- package/src/sap/ui/vbm/Spot.js +1 -2
- package/src/sap/ui/vbm/Spots.js +1 -2
- package/src/sap/ui/vbm/VBI.js +41 -10
- package/src/sap/ui/vbm/VBIRenderer.js +1 -2
- package/src/sap/ui/vbm/Viewport.js +7 -7
- package/src/sap/ui/vbm/ViewportRenderer.js +1 -2
- package/src/sap/ui/vbm/VoAbstract.js +1 -2
- package/src/sap/ui/vbm/VoAggregation.js +4 -7
- package/src/sap/ui/vbm/VoBase.js +1 -2
- package/src/sap/ui/vbm/adapter3d/ModelHandler.js +2 -3
- package/src/sap/ui/vbm/adapter3d/ObjectFactory.js +2 -3
- package/src/sap/ui/vbm/adapter3d/PolygonHandler.js +2 -3
- package/src/sap/ui/vbm/adapter3d/SceneBuilder.js +269 -184
- package/src/sap/ui/vbm/adapter3d/Utilities.js +1 -2
- package/src/sap/ui/vbm/adapter3d/VBIJSONParser.js +2 -3
- package/src/sap/ui/vbm/adapter3d/thirdparty/ColladaLoader.js +2267 -2509
- package/src/sap/ui/vbm/adapter3d/thirdparty/DecalGeometry.js +194 -266
- package/src/sap/ui/vbm/adapter3d/thirdparty/OrbitControls.js +1004 -700
- package/src/sap/ui/vbm/lib/sapactions.js +11 -9
- package/src/sap/ui/vbm/lib/sapautomations.js +11 -13
- package/src/sap/ui/vbm/lib/sapconfig.js +10 -3
- package/src/sap/ui/vbm/lib/sapdataprovider.js +10 -21
- package/src/sap/ui/vbm/lib/sapevents.js +10 -11
- package/src/sap/ui/vbm/lib/sapgeolocation.js +9 -3
- package/src/sap/ui/vbm/lib/sapgeomath.js +10 -4
- package/src/sap/ui/vbm/lib/sapgeotool.js +11 -3
- package/src/sap/ui/vbm/lib/sapheatmap.js +27 -25
- package/src/sap/ui/vbm/lib/saplabels.js +16 -11
- package/src/sap/ui/vbm/lib/saplassotrack.js +10 -5
- package/src/sap/ui/vbm/lib/sapmaplayer.js +12 -10
- package/src/sap/ui/vbm/lib/sapmapmanager.js +14 -5
- package/src/sap/ui/vbm/lib/sapmapprovider.js +10 -5
- package/src/sap/ui/vbm/lib/sapnavigation.js +10 -3
- package/src/sap/ui/vbm/lib/sapparsing.js +10 -1
- package/src/sap/ui/vbm/lib/sappositioning.js +11 -5
- package/src/sap/ui/vbm/lib/sapprojection.js +11 -5
- package/src/sap/ui/vbm/lib/saprecttrack.js +10 -5
- package/src/sap/ui/vbm/lib/sapresources.js +11 -6
- package/src/sap/ui/vbm/lib/sapscale.js +14 -5
- package/src/sap/ui/vbm/lib/sapscene.js +13 -12
- package/src/sap/ui/vbm/lib/saputilities.js +11 -84
- package/src/sap/ui/vbm/lib/sapvbcluster.js +13 -6
- package/src/sap/ui/vbm/lib/sapvbi.js +9 -41
- package/src/sap/ui/vbm/lib/sapvbicontext.js +10 -5
- package/src/sap/ui/vbm/lib/sapvbmenu.js +18 -13
- package/src/sap/ui/vbm/lib/sapvobase.js +16 -16
- package/src/sap/ui/vbm/lib/sapvoutils.js +13 -24
- package/src/sap/ui/vbm/lib/sapwindow.js +11 -12
- package/src/sap/ui/vbm/library.js +29 -33
- package/src/sap/ui/vbm/themes/base/library.source.less +1 -2
- package/src/sap/ui/vbm/themes/sap_belize/library.source.less +1 -2
- package/src/sap/ui/vbm/themes/sap_belize_hcb/library.source.less +1 -2
- package/src/sap/ui/vbm/themes/sap_belize_hcw/library.source.less +1 -2
- package/src/sap/ui/vbm/themes/sap_belize_plus/library.source.less +1 -2
- package/src/sap/ui/vbm/themes/sap_bluecrystal/library.source.less +1 -2
- package/src/sap/ui/vbm/themes/sap_fiori_3/library.source.less +1 -2
- package/src/sap/ui/vbm/themes/sap_fiori_3_dark/library.source.less +1 -2
- package/src/sap/ui/vbm/themes/sap_fiori_3_hcb/library.source.less +1 -2
- package/src/sap/ui/vbm/themes/sap_fiori_3_hcw/library.source.less +1 -2
- package/src/sap/ui/vbm/themes/sap_hcb/library.source.less +1 -2
- package/src/sap/ui/vbm/themes/sap_horizon/library.source.less +1 -2
- package/ui5.yaml +6 -5
- package/src/sap/ui/vbm/adapter3d/thirdparty/html2canvas.js +0 -6
- package/src/sap/ui/vbm/themes/sap_mvi/empty.less +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SAPUI5
|
|
3
|
-
* (c) Copyright 2009-2021 SAP SE. All rights reserved.
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2012 SAP AG. All rights reserved
|
|
4
3
|
*/
|
|
5
4
|
|
|
6
5
|
// Provides the base visual object.
|
|
@@ -8,7 +7,7 @@ sap.ui.define([
|
|
|
8
7
|
"sap/ui/base/Object",
|
|
9
8
|
"./Utilities",
|
|
10
9
|
"./PolygonHandler",
|
|
11
|
-
"./ModelHandler",
|
|
10
|
+
"./ModelHandler",
|
|
12
11
|
"./thirdparty/three",
|
|
13
12
|
"./thirdparty/DecalGeometry",
|
|
14
13
|
"./thirdparty/html2canvas",
|
|
@@ -17,9 +16,7 @@ sap.ui.define([
|
|
|
17
16
|
"use strict";
|
|
18
17
|
|
|
19
18
|
var thisModule = "sap.ui.vbm.adapter3d.SceneBuilder";
|
|
20
|
-
var Face3 = THREE.Face3;
|
|
21
19
|
var Matrix4 = THREE.Matrix4;
|
|
22
|
-
var Vector2 = THREE.Vector2;
|
|
23
20
|
var Vector3 = THREE.Vector3;
|
|
24
21
|
var degToRad = THREE.Math.degToRad;
|
|
25
22
|
var toArray = Utilities.toArray;
|
|
@@ -49,7 +46,7 @@ sap.ui.define([
|
|
|
49
46
|
*
|
|
50
47
|
* @private
|
|
51
48
|
* @author SAP SE
|
|
52
|
-
* @version 1.
|
|
49
|
+
* @version 1.97.0
|
|
53
50
|
* @alias sap.ui.vbm.adapter3d.SceneBuilder
|
|
54
51
|
*/
|
|
55
52
|
var SceneBuilder = BaseObject.extend("sap.ui.vbm.adapter3d.SceneBuilder", /** @lends sap.ui.vbm.adapter3d.SceneBuilder.prototype */ {
|
|
@@ -193,7 +190,7 @@ sap.ui.define([
|
|
|
193
190
|
[].concat(toAdd, toUpdate).forEach(function(instance) {
|
|
194
191
|
if (instance.isModel) {
|
|
195
192
|
that._modelHandler.addModel(instance);
|
|
196
|
-
}
|
|
193
|
+
}
|
|
197
194
|
if (instance.texture && propertyChanged(instance, "texture")) {
|
|
198
195
|
addTexture(instance.texture);
|
|
199
196
|
}
|
|
@@ -312,7 +309,7 @@ sap.ui.define([
|
|
|
312
309
|
var state = {
|
|
313
310
|
zoom: 1.0,
|
|
314
311
|
// convert from left handed (DirectX) to right handed (OpenGL)
|
|
315
|
-
target: new Vector3(-camTarget.x, -camTarget.z, camTarget.y),
|
|
312
|
+
target: new Vector3(-camTarget.x, -camTarget.z, camTarget.y),
|
|
316
313
|
position: new Vector3(-pos.x, -pos.z, pos.y)
|
|
317
314
|
};
|
|
318
315
|
|
|
@@ -577,7 +574,7 @@ sap.ui.define([
|
|
|
577
574
|
// var timestamp = performance.now();
|
|
578
575
|
this._polygonHandler.updateHotInstance(instance);
|
|
579
576
|
this._modelHandler.updateHotInstance(instance);
|
|
580
|
-
|
|
577
|
+
|
|
581
578
|
// perform pending updates if any
|
|
582
579
|
this._polygonHandler.update();
|
|
583
580
|
this._modelHandler.update();
|
|
@@ -589,7 +586,7 @@ sap.ui.define([
|
|
|
589
586
|
if (instance) {
|
|
590
587
|
this._updateHotStatus(instance, true);
|
|
591
588
|
}
|
|
592
|
-
|
|
589
|
+
|
|
593
590
|
this._hotInstance = instance;
|
|
594
591
|
// DEBUG
|
|
595
592
|
// Log.info("update hover took " + (performance.now() - timestamp) + " milliseconds", "", thisModule);
|
|
@@ -612,9 +609,9 @@ sap.ui.define([
|
|
|
612
609
|
box.layers.set(0); // put it to layer #0 to enable raycasting
|
|
613
610
|
box._sapInstance = instance; // keep reference to instance
|
|
614
611
|
instance.object3D.add(box);
|
|
615
|
-
}
|
|
612
|
+
}
|
|
616
613
|
}
|
|
617
|
-
|
|
614
|
+
|
|
618
615
|
// update properties after processing is done
|
|
619
616
|
updateProperty(instance, "texture6");
|
|
620
617
|
|
|
@@ -635,8 +632,8 @@ sap.ui.define([
|
|
|
635
632
|
cylinder.geometry = geometry;
|
|
636
633
|
|
|
637
634
|
if (open) {
|
|
638
|
-
// cylinder was closed -> now open ->
|
|
639
|
-
material = cylinder.material[1]; //
|
|
635
|
+
// cylinder was closed -> now open -> 3 materials replaced with one material, dispose second material (caps material)
|
|
636
|
+
material = cylinder.material[1]; // caps material, shared between caps
|
|
640
637
|
if (material.map) {
|
|
641
638
|
Utilities.subRef(material.map);
|
|
642
639
|
material.dispose();
|
|
@@ -647,8 +644,8 @@ sap.ui.define([
|
|
|
647
644
|
} else {
|
|
648
645
|
// cylinder was open -> now closed -> need to add one more material and assign texture if 'textureCap' is present
|
|
649
646
|
material = cylinder.material.clone();
|
|
650
|
-
material.map = null; // reset map as we don't need sides texture on caps
|
|
651
|
-
cylinder.material = [cylinder.material, material]; //
|
|
647
|
+
material.map = null; // reset map as we don't need sides texture on caps at this stage
|
|
648
|
+
cylinder.material = [cylinder.material, material, material]; // define 3 materials -> first one for sides, second one for both caps (shared between caps)
|
|
652
649
|
// update both materials acoordingly
|
|
653
650
|
cylinder.material.forEach(function(mat) {
|
|
654
651
|
mat.needsUpdate = true;
|
|
@@ -657,13 +654,18 @@ sap.ui.define([
|
|
|
657
654
|
updateTextureCap = true;
|
|
658
655
|
}
|
|
659
656
|
} else {
|
|
660
|
-
|
|
661
|
-
|
|
657
|
+
if (open) {
|
|
658
|
+
cylinder = new THREE.Mesh(geometry, createMaterial(true)); // one double sided material for open cylinder
|
|
659
|
+
} else {
|
|
660
|
+
material = createMaterial(false);
|
|
661
|
+
cylinder = new THREE.Mesh(geometry, [createMaterial(false), material, material]); // 3 materials if cylinder is closed, one material for sides, one for both caps (shared)
|
|
662
|
+
}
|
|
663
|
+
|
|
662
664
|
cylinder.matrixAutoUpdate = false;
|
|
663
665
|
cylinder.layers.set(0); // put it to layer #0 to enable raycasting
|
|
664
666
|
cylinder._sapInstance = instance; // keep reference to instance
|
|
665
667
|
instance.object3D.add(cylinder);
|
|
666
|
-
}
|
|
668
|
+
}
|
|
667
669
|
}
|
|
668
670
|
|
|
669
671
|
if (propertyChanged(instance, "textureCap") || updateTextureCap) {
|
|
@@ -686,12 +688,12 @@ sap.ui.define([
|
|
|
686
688
|
}
|
|
687
689
|
}
|
|
688
690
|
}
|
|
689
|
-
|
|
691
|
+
|
|
690
692
|
// update cylinder properties after processing is done
|
|
691
693
|
updateProperty(instance, ["isOpen", "testureCap"]);
|
|
692
694
|
|
|
693
695
|
// handle common properties
|
|
694
|
-
this._assignProperties(instance, hot);
|
|
696
|
+
this._assignProperties(instance, hot);
|
|
695
697
|
};
|
|
696
698
|
|
|
697
699
|
SceneBuilder.prototype._assignProperties = function(instance, hot) {
|
|
@@ -815,9 +817,9 @@ sap.ui.define([
|
|
|
815
817
|
Utilities.subRef(material.map); // release current texture in use
|
|
816
818
|
material.map = null;
|
|
817
819
|
}
|
|
818
|
-
|
|
820
|
+
|
|
819
821
|
material.map = this._textures.get(instance.text ? this._getDecalTextKey(instance) : instance.texture);
|
|
820
|
-
|
|
822
|
+
|
|
821
823
|
if (material.map) {
|
|
822
824
|
material.map.flipY = true;
|
|
823
825
|
material.needsUpdate = true; // required by threeJS
|
|
@@ -826,7 +828,7 @@ sap.ui.define([
|
|
|
826
828
|
Log.error("Unable to apply texture, texture not found", instance.texture, thisModule);
|
|
827
829
|
}
|
|
828
830
|
}
|
|
829
|
-
|
|
831
|
+
|
|
830
832
|
// update properties after processing is done
|
|
831
833
|
updateProperty(instance, ["position", "direction", "size", "rotation", "target", "texture", "text", "planeOrigin", "planeNormal"]);
|
|
832
834
|
};
|
|
@@ -981,13 +983,26 @@ sap.ui.define([
|
|
|
981
983
|
var p4 = origin.clone().sub(dir2);
|
|
982
984
|
|
|
983
985
|
// create plane mesh consisting of 2 triangles
|
|
984
|
-
var geometry = new THREE.
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
986
|
+
var geometry = new THREE.BufferGeometry();
|
|
987
|
+
|
|
988
|
+
geometry.setAttribute("position", new THREE.Float32BufferAttribute([
|
|
989
|
+
p1.x, p1.y, p1.z,
|
|
990
|
+
p3.x, p3.y, p3.z,
|
|
991
|
+
p2.x, p2.y, p2.z,
|
|
992
|
+
p2.x, p2.y, p2.z,
|
|
993
|
+
p4.x, p4.y, p4.z,
|
|
994
|
+
p1.x, p1.y, p1.z
|
|
995
|
+
], 3));
|
|
996
|
+
|
|
997
|
+
// use plane normal as normal for triangles
|
|
998
|
+
geometry.setAttribute("normal", new THREE.Float32BufferAttribute([
|
|
999
|
+
normal.x, normal.y, normal.z,
|
|
1000
|
+
normal.x, normal.y, normal.z,
|
|
1001
|
+
normal.x, normal.y, normal.z,
|
|
1002
|
+
normal.x, normal.y, normal.z,
|
|
1003
|
+
normal.x, normal.y, normal.z,
|
|
1004
|
+
normal.x, normal.y, normal.z
|
|
1005
|
+
], 3));
|
|
991
1006
|
|
|
992
1007
|
var plane = new THREE.Mesh(geometry);
|
|
993
1008
|
parent.add(plane);
|
|
@@ -997,7 +1012,7 @@ sap.ui.define([
|
|
|
997
1012
|
|
|
998
1013
|
SceneBuilder.prototype._getDecalTarget = function(instance) {
|
|
999
1014
|
if (instance.target) {
|
|
1000
|
-
var target = this._targets.get(instance.target);
|
|
1015
|
+
var target = this._targets.get(instance.target);
|
|
1001
1016
|
if (target) {
|
|
1002
1017
|
if (target.isBox || target.isCylinder) {
|
|
1003
1018
|
return target.object3D.children[0]; // object3d is a group node, where its first child is actual mesh
|
|
@@ -1112,197 +1127,286 @@ sap.ui.define([
|
|
|
1112
1127
|
* The geometry is generated according to the algorithm in the legacy VB ActiveX control.
|
|
1113
1128
|
*
|
|
1114
1129
|
* @param {boolean} sixSided If equals <code>true</code> assign UV coordinates for 6-sided texture, otherwise for 4-sided texture.
|
|
1115
|
-
* @returns {THREE.
|
|
1130
|
+
* @returns {THREE.BufferGeometry} The box geometry.
|
|
1116
1131
|
* @private
|
|
1117
1132
|
*/
|
|
1118
1133
|
createBox = function(sixSided) {
|
|
1119
|
-
var geometry = new THREE.
|
|
1120
|
-
var length = 0.1;
|
|
1134
|
+
var geometry = new THREE.BufferGeometry();
|
|
1121
1135
|
|
|
1122
|
-
geometry.
|
|
1136
|
+
geometry.setAttribute("position", new THREE.Float32BufferAttribute([
|
|
1123
1137
|
// Top
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1138
|
+
0.1, 0.1, -0.1,
|
|
1139
|
+
-0.1, -0.1, -0.1,
|
|
1140
|
+
-0.1, 0.1, -0.1,
|
|
1141
|
+
0.1, 0.1, -0.1,
|
|
1142
|
+
0.1, -0.1, -0.1,
|
|
1143
|
+
-0.1, -0.1, -0.1,
|
|
1128
1144
|
|
|
1129
1145
|
// Bottom
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1146
|
+
0.1, 0.1, 0.1,
|
|
1147
|
+
-0.1, 0.1, 0.1,
|
|
1148
|
+
-0.1, -0.1, 0.1,
|
|
1149
|
+
0.1, 0.1, 0.1,
|
|
1150
|
+
-0.1, -0.1, 0.1,
|
|
1151
|
+
0.1, -0.1, 0.1,
|
|
1134
1152
|
|
|
1135
1153
|
// Right
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1154
|
+
0.1, 0.1, -0.1,
|
|
1155
|
+
0.1, -0.1, 0.1,
|
|
1156
|
+
0.1, -0.1, -0.1,
|
|
1157
|
+
0.1, 0.1, -0.1,
|
|
1158
|
+
0.1, 0.1, 0.1,
|
|
1159
|
+
0.1, -0.1, 0.1,
|
|
1140
1160
|
|
|
1141
1161
|
// Front
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1162
|
+
0.1, -0.1, -0.1,
|
|
1163
|
+
-0.1, -0.1, 0.1,
|
|
1164
|
+
-0.1, -0.1, -0.1,
|
|
1165
|
+
0.1, -0.1, -0.1,
|
|
1166
|
+
0.1, -0.1, 0.1,
|
|
1167
|
+
-0.1, -0.1, 0.1,
|
|
1146
1168
|
|
|
1147
1169
|
// Left
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1170
|
+
-0.1, -0.1, -0.1,
|
|
1171
|
+
-0.1, 0.1, 0.1,
|
|
1172
|
+
-0.1, 0.1, -0.1,
|
|
1173
|
+
-0.1, -0.1, -0.1,
|
|
1174
|
+
-0.1, -0.1, 0.1,
|
|
1175
|
+
-0.1, 0.1, 0.1,
|
|
1152
1176
|
|
|
1153
1177
|
// Back
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1178
|
+
0.1, 0.1, 0.1,
|
|
1179
|
+
-0.1, 0.1, -0.1,
|
|
1180
|
+
-0.1, 0.1, 0.1,
|
|
1181
|
+
0.1, 0.1, 0.1,
|
|
1182
|
+
0.1, 0.1, -0.1,
|
|
1183
|
+
-0.1, 0.1, -0.1
|
|
1184
|
+
], 3));
|
|
1185
|
+
|
|
1186
|
+
geometry.setAttribute("normal", new THREE.Float32BufferAttribute([
|
|
1187
|
+
// Top
|
|
1188
|
+
0, 0, -1,
|
|
1189
|
+
0, 0, -1,
|
|
1190
|
+
0, 0, -1,
|
|
1191
|
+
0, 0, -1,
|
|
1192
|
+
0, 0, -1,
|
|
1193
|
+
0, 0, -1,
|
|
1194
|
+
|
|
1195
|
+
// Bottom
|
|
1196
|
+
0, 0, 1,
|
|
1197
|
+
0, 0, 1,
|
|
1198
|
+
0, 0, 1,
|
|
1199
|
+
0, 0, 1,
|
|
1200
|
+
0, 0, 1,
|
|
1201
|
+
0, 0, 1,
|
|
1202
|
+
|
|
1203
|
+
// Right
|
|
1204
|
+
1, 0, 0,
|
|
1205
|
+
1, 0, 0,
|
|
1206
|
+
1, 0, 0,
|
|
1207
|
+
1, 0, 0,
|
|
1208
|
+
1, 0, 0,
|
|
1209
|
+
1, 0, 0,
|
|
1210
|
+
|
|
1211
|
+
// Front
|
|
1212
|
+
0, -1, 0,
|
|
1213
|
+
0, -1, 0,
|
|
1214
|
+
0, -1, 0,
|
|
1215
|
+
0, -1, 0,
|
|
1216
|
+
0, -1, 0,
|
|
1217
|
+
0, -1, 0,
|
|
1159
1218
|
|
|
1160
|
-
|
|
1219
|
+
// Left
|
|
1220
|
+
-1, 0, 0,
|
|
1221
|
+
-1, 0, 0,
|
|
1222
|
+
-1, 0, 0,
|
|
1223
|
+
-1, 0, 0,
|
|
1224
|
+
-1, 0, 0,
|
|
1225
|
+
-1, 0, 0,
|
|
1161
1226
|
|
|
1162
|
-
|
|
1227
|
+
// Back
|
|
1228
|
+
0, 1, 0,
|
|
1229
|
+
0, 1, 0,
|
|
1230
|
+
0, 1, 0,
|
|
1231
|
+
0, 1, 0,
|
|
1232
|
+
0, 1, 0,
|
|
1233
|
+
0, 1, 0
|
|
1234
|
+
], 3));
|
|
1235
|
+
|
|
1236
|
+
geometry.setAttribute("color", new THREE.Float32BufferAttribute([
|
|
1163
1237
|
// Top
|
|
1164
|
-
|
|
1165
|
-
|
|
1238
|
+
0.5, 0.5, 0.5,
|
|
1239
|
+
0.5, 0.5, 0.5,
|
|
1240
|
+
0.5, 0.5, 0.5,
|
|
1241
|
+
0.5, 0.5, 0.5,
|
|
1242
|
+
0.5, 0.5, 0.5,
|
|
1243
|
+
0.5, 0.5, 0.5,
|
|
1166
1244
|
|
|
1167
1245
|
// Bottom
|
|
1168
|
-
|
|
1169
|
-
|
|
1246
|
+
0.5, 0.5, 0.5,
|
|
1247
|
+
0.5, 0.5, 0.5,
|
|
1248
|
+
0.5, 0.5, 0.5,
|
|
1249
|
+
0.5, 0.5, 0.5,
|
|
1250
|
+
0.5, 0.5, 0.5,
|
|
1251
|
+
0.5, 0.5, 0.5,
|
|
1170
1252
|
|
|
1171
1253
|
// Right
|
|
1172
|
-
|
|
1173
|
-
|
|
1254
|
+
0.5, 0.5, 0.5,
|
|
1255
|
+
0.5, 0.5, 0.5,
|
|
1256
|
+
0.5, 0.5, 0.5,
|
|
1257
|
+
0.5, 0.5, 0.5,
|
|
1258
|
+
0.5, 0.5, 0.5,
|
|
1259
|
+
0.5, 0.5, 0.5,
|
|
1174
1260
|
|
|
1175
1261
|
// Front
|
|
1176
|
-
|
|
1177
|
-
|
|
1262
|
+
0.5, 0.5, 0.5,
|
|
1263
|
+
0.5, 0.5, 0.5,
|
|
1264
|
+
0.5, 0.5, 0.5,
|
|
1265
|
+
0.5, 0.5, 0.5,
|
|
1266
|
+
0.5, 0.5, 0.5,
|
|
1267
|
+
0.5, 0.5, 0.5,
|
|
1178
1268
|
|
|
1179
1269
|
// Left
|
|
1180
|
-
|
|
1181
|
-
|
|
1270
|
+
0.5, 0.5, 0.5,
|
|
1271
|
+
0.5, 0.5, 0.5,
|
|
1272
|
+
0.5, 0.5, 0.5,
|
|
1273
|
+
0.5, 0.5, 0.5,
|
|
1274
|
+
0.5, 0.5, 0.5,
|
|
1275
|
+
0.5, 0.5, 0.5,
|
|
1182
1276
|
|
|
1183
1277
|
// Back
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1278
|
+
0.5, 0.5, 0.5,
|
|
1279
|
+
0.5, 0.5, 0.5,
|
|
1280
|
+
0.5, 0.5, 0.5,
|
|
1281
|
+
0.5, 0.5, 0.5,
|
|
1282
|
+
0.5, 0.5, 0.5,
|
|
1283
|
+
0.5, 0.5, 0.5
|
|
1284
|
+
], 3));
|
|
1189
1285
|
|
|
1190
1286
|
if (sixSided) {
|
|
1191
|
-
|
|
1287
|
+
// Use the Direct3D texture coordinate space where the origin is in the top left corner.
|
|
1288
|
+
// If there is a texture with the following quadrants
|
|
1289
|
+
// (0,0) (1/3,0) (2/3,0) (1,0)
|
|
1290
|
+
// +----------+----------+----------+
|
|
1291
|
+
// | BACK | FRONT | BOTTOM |
|
|
1292
|
+
// +----------+----------|----------+ (1,0.5)
|
|
1293
|
+
// | LEFT | RIGHT | TOP |
|
|
1294
|
+
// +----------+----------|----------+
|
|
1295
|
+
// (0,1) (1,1)
|
|
1296
|
+
// then those quadrants should map to faces as in the comments below.
|
|
1297
|
+
geometry.setAttribute("uv", new THREE.Float32BufferAttribute([
|
|
1192
1298
|
// Top
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1299
|
+
2/3, 0.5,
|
|
1300
|
+
1.0, 1.0,
|
|
1301
|
+
2/3, 1.0,
|
|
1302
|
+
2/3, 0.5,
|
|
1303
|
+
1.0, 0.5,
|
|
1304
|
+
1.0, 1.0,
|
|
1197
1305
|
|
|
1198
1306
|
// Bottom
|
|
1199
1307
|
// VB ActiveX incorrectly defines bottom the same as right/left, though the comments say it is the same as top.
|
|
1200
1308
|
// same botton orientation as in ActiveX, cross oriented to the top face
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1309
|
+
2/3, 0.0,
|
|
1310
|
+
1.0, 0.0,
|
|
1311
|
+
1.0, 0.5,
|
|
1312
|
+
2/3, 0.0,
|
|
1313
|
+
1.0, 0.5,
|
|
1314
|
+
2/3, 0.5,
|
|
1205
1315
|
|
|
1206
1316
|
// Right
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1317
|
+
2/3, 0.5,
|
|
1318
|
+
1/3, 1.0,
|
|
1319
|
+
1/3, 0.5,
|
|
1320
|
+
2/3, 0.5,
|
|
1321
|
+
2/3, 1.0,
|
|
1322
|
+
1/3, 1.0,
|
|
1211
1323
|
|
|
1212
1324
|
// Front
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1325
|
+
2/3, 0.0,
|
|
1326
|
+
1/3, 0.5,
|
|
1327
|
+
1/3, 0.0,
|
|
1328
|
+
2/3, 0.0,
|
|
1329
|
+
2/3, 0.5,
|
|
1330
|
+
1/3, 0.5,
|
|
1217
1331
|
|
|
1218
1332
|
// Left
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1333
|
+
1/3, 0.5,
|
|
1334
|
+
0.0, 1.0,
|
|
1335
|
+
0.0, 0.5,
|
|
1336
|
+
1/3, 0.5,
|
|
1337
|
+
1/3, 1.0,
|
|
1338
|
+
0.0, 1.0,
|
|
1223
1339
|
|
|
1224
1340
|
// Back
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1341
|
+
0.0, 0.5,
|
|
1342
|
+
1/3, 0.0,
|
|
1343
|
+
1/3, 0.5,
|
|
1344
|
+
0.0, 0.5,
|
|
1345
|
+
0.0, 0.0,
|
|
1346
|
+
1/3, 0.0
|
|
1347
|
+
], 2));
|
|
1230
1348
|
} else {
|
|
1231
1349
|
// Use the Direct3D texture coordinate space where the origin is in the top left corner.
|
|
1232
1350
|
// If there is a texture with the following quadrants
|
|
1233
|
-
//
|
|
1234
|
-
//
|
|
1235
|
-
//
|
|
1236
|
-
//
|
|
1237
|
-
//
|
|
1238
|
-
//
|
|
1239
|
-
//
|
|
1351
|
+
// (0,0) (1,0)
|
|
1352
|
+
// +----------+----------+
|
|
1353
|
+
// | BACK | FRONT |
|
|
1354
|
+
// +----------+----------+ (1,0.5)
|
|
1355
|
+
// |RIGHT/LEFT|TOP/BOTTOM|
|
|
1356
|
+
// +----------+----------+
|
|
1357
|
+
// (0,1) (1,1)
|
|
1240
1358
|
// then those quadrants should map to faces as in the comments below.
|
|
1241
|
-
|
|
1359
|
+
geometry.setAttribute("uv", new THREE.Float32BufferAttribute([
|
|
1242
1360
|
// Top
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1361
|
+
0.5, 0.5,
|
|
1362
|
+
1.0, 1.0,
|
|
1363
|
+
0.5, 1.0,
|
|
1364
|
+
0.5, 0.5,
|
|
1365
|
+
1.0, 0.5,
|
|
1366
|
+
1.0, 1.0,
|
|
1247
1367
|
|
|
1248
1368
|
// Bottom
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1369
|
+
1.0, 0.5,
|
|
1370
|
+
1.0, 1.0,
|
|
1371
|
+
0.5, 1.0,
|
|
1372
|
+
1.0, 0.5,
|
|
1373
|
+
0.5, 1.0,
|
|
1374
|
+
0.5, 0.5,
|
|
1254
1375
|
|
|
1255
1376
|
// Right
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1377
|
+
0.5, 0.5,
|
|
1378
|
+
0.0, 1.0,
|
|
1379
|
+
0.0, 0.5,
|
|
1380
|
+
0.5, 0.5,
|
|
1381
|
+
0.5, 1.0,
|
|
1382
|
+
0.0, 1.0,
|
|
1260
1383
|
|
|
1261
1384
|
// Front
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1385
|
+
0.5, 0.5,
|
|
1386
|
+
1.0, 0.0,
|
|
1387
|
+
1.0, 0.5,
|
|
1388
|
+
0.5, 0.5,
|
|
1389
|
+
0.5, 0.0,
|
|
1390
|
+
1.0, 0.0,
|
|
1266
1391
|
|
|
1267
1392
|
// Left
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1393
|
+
0.5, 0.5,
|
|
1394
|
+
0.0, 1.0,
|
|
1395
|
+
0.0, 0.5,
|
|
1396
|
+
0.5, 0.5,
|
|
1397
|
+
0.5, 1.0,
|
|
1398
|
+
0.0, 1.0,
|
|
1272
1399
|
|
|
1273
1400
|
// Back
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1401
|
+
0.0, 0.5,
|
|
1402
|
+
0.5, 0.0,
|
|
1403
|
+
0.5, 0.5,
|
|
1404
|
+
0.0, 0.5,
|
|
1405
|
+
0.0, 0.0,
|
|
1406
|
+
0.5, 0.0
|
|
1407
|
+
], 2));
|
|
1279
1408
|
}
|
|
1280
1409
|
|
|
1281
|
-
geometry.faceVertexUvs[0].push(
|
|
1282
|
-
// Top
|
|
1283
|
-
[uvs[0], uvs[2], uvs[3]],
|
|
1284
|
-
[uvs[0], uvs[1], uvs[2]],
|
|
1285
|
-
|
|
1286
|
-
// Bottom
|
|
1287
|
-
[uvs[5], uvs[6], uvs[7]],
|
|
1288
|
-
[uvs[5], uvs[7], uvs[4]],
|
|
1289
|
-
|
|
1290
|
-
// Right
|
|
1291
|
-
[uvs[8], uvs[10], uvs[11]],
|
|
1292
|
-
[uvs[8], uvs[9], uvs[10]],
|
|
1293
|
-
|
|
1294
|
-
// Front
|
|
1295
|
-
[uvs[12], uvs[14], uvs[15]],
|
|
1296
|
-
[uvs[12], uvs[13], uvs[14]],
|
|
1297
|
-
|
|
1298
|
-
// Left
|
|
1299
|
-
[uvs[16], uvs[18], uvs[19]],
|
|
1300
|
-
[uvs[16], uvs[17], uvs[18]],
|
|
1301
|
-
|
|
1302
|
-
// Back
|
|
1303
|
-
[uvs[20], uvs[22], uvs[23]],
|
|
1304
|
-
[uvs[20], uvs[21], uvs[22]]
|
|
1305
|
-
);
|
|
1306
1410
|
return geometry;
|
|
1307
1411
|
};
|
|
1308
1412
|
|
|
@@ -1313,31 +1417,12 @@ sap.ui.define([
|
|
|
1313
1417
|
*
|
|
1314
1418
|
*
|
|
1315
1419
|
* @param {boolean} open If equals <code>true</code> will create a hollow cylinder / pipe.
|
|
1316
|
-
* @returns {THREE.
|
|
1420
|
+
* @returns {THREE.BufferGeometry} The cylinder geometry.
|
|
1317
1421
|
* @private
|
|
1318
1422
|
*/
|
|
1319
1423
|
createCylinder = function(open) {
|
|
1320
1424
|
var radius = 0.1; // Initial radius for cylinder
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
if (!open) {
|
|
1324
|
-
// Apply correct UV coordinates & material index based on cylinder geometry
|
|
1325
|
-
for (var i = 0; i < geometry.faces.length; ++i) {
|
|
1326
|
-
var face = geometry.faces[i];
|
|
1327
|
-
if (face.normal.y !== 0) {
|
|
1328
|
-
geometry.faceVertexUvs[0][i][0].u = (geometry.vertices[face.a].x + radius/2) / radius;
|
|
1329
|
-
geometry.faceVertexUvs[0][i][0].v = (geometry.vertices[face.a].z + radius/2) / radius;
|
|
1330
|
-
geometry.faceVertexUvs[0][i][1].u = (geometry.vertices[face.b].x + radius/2) / radius;
|
|
1331
|
-
geometry.faceVertexUvs[0][i][1].v = (geometry.vertices[face.b].z + radius/2) / radius;
|
|
1332
|
-
geometry.faceVertexUvs[0][i][2].u = (geometry.vertices[face.c].x + radius/2) / radius;
|
|
1333
|
-
geometry.faceVertexUvs[0][i][2].v = (geometry.vertices[face.c].z + radius/2) / radius;
|
|
1334
|
-
face.materialIndex = 1;
|
|
1335
|
-
} else {
|
|
1336
|
-
face.materialIndex = 0;
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1339
|
-
}
|
|
1340
|
-
return geometry;
|
|
1425
|
+
return new THREE.CylinderGeometry(radius, radius, 2 * radius, 24, 1, open);
|
|
1341
1426
|
};
|
|
1342
1427
|
|
|
1343
1428
|
return SceneBuilder;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
* (c) Copyright 2009-2021 SAP SE. All rights reserved.
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2012 SAP AG. All rights reserved
|
|
4
3
|
*/
|
|
5
4
|
|
|
6
5
|
// Provides class sap.ui.vbm.adapter3d.VBIJSONParser
|
|
@@ -57,7 +56,7 @@ sap.ui.define([
|
|
|
57
56
|
*
|
|
58
57
|
* @private
|
|
59
58
|
* @author SAP SE
|
|
60
|
-
* @version 1.
|
|
59
|
+
* @version 1.97.0
|
|
61
60
|
* @alias sap.ui.vbm.adapter3d.VBIJSONParser
|
|
62
61
|
*/
|
|
63
62
|
var VBIJSONParser = BaseObject.extend("sap.ui.vbm.adapter3d.VBIJSONParser", /** @lends sap.ui.vbm.adapter3d.VBIJSONParser.prototype */ {
|