@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.
Files changed (105) hide show
  1. package/package.json +1 -1
  2. package/src/sap/ui/vbm/.library +1 -1
  3. package/src/sap/ui/vbm/Adapter.js +18 -15
  4. package/src/sap/ui/vbm/Adapter3D.js +2 -3
  5. package/src/sap/ui/vbm/AnalyticMap.js +1 -2
  6. package/src/sap/ui/vbm/AnalyticMapRenderer.js +1 -2
  7. package/src/sap/ui/vbm/Area.js +1 -2
  8. package/src/sap/ui/vbm/Areas.js +8 -10
  9. package/src/sap/ui/vbm/Box.js +1 -2
  10. package/src/sap/ui/vbm/Boxes.js +1 -2
  11. package/src/sap/ui/vbm/Circle.js +1 -2
  12. package/src/sap/ui/vbm/Circles.js +1 -2
  13. package/src/sap/ui/vbm/Cluster.js +5 -5
  14. package/src/sap/ui/vbm/ClusterBase.js +5 -9
  15. package/src/sap/ui/vbm/ClusterContainer.js +1 -2
  16. package/src/sap/ui/vbm/ClusterDistance.js +1 -2
  17. package/src/sap/ui/vbm/ClusterGrid.js +1 -2
  18. package/src/sap/ui/vbm/ClusterRenderer.js +1 -3
  19. package/src/sap/ui/vbm/ClusterTree.js +1 -2
  20. package/src/sap/ui/vbm/Container.js +1 -2
  21. package/src/sap/ui/vbm/Containers.js +4 -7
  22. package/src/sap/ui/vbm/DragSource.js +1 -2
  23. package/src/sap/ui/vbm/DropTarget.js +1 -2
  24. package/src/sap/ui/vbm/Feature.js +1 -2
  25. package/src/sap/ui/vbm/FeatureCollection.js +1 -2
  26. package/src/sap/ui/vbm/GeoCircle.js +1 -2
  27. package/src/sap/ui/vbm/GeoCircles.js +1 -2
  28. package/src/sap/ui/vbm/GeoJsonLayer.js +10 -12
  29. package/src/sap/ui/vbm/GeoMap.js +4 -4
  30. package/src/sap/ui/vbm/GeoMapRenderer.js +1 -2
  31. package/src/sap/ui/vbm/HeatPoint.js +1 -2
  32. package/src/sap/ui/vbm/Heatmap.js +1 -2
  33. package/src/sap/ui/vbm/Legend.js +1 -2
  34. package/src/sap/ui/vbm/LegendItem.js +1 -2
  35. package/src/sap/ui/vbm/Pie.js +1 -2
  36. package/src/sap/ui/vbm/PieItem.js +1 -2
  37. package/src/sap/ui/vbm/Pies.js +1 -2
  38. package/src/sap/ui/vbm/Region.js +1 -2
  39. package/src/sap/ui/vbm/Resource.js +1 -2
  40. package/src/sap/ui/vbm/Route.js +1 -2
  41. package/src/sap/ui/vbm/Routes.js +1 -2
  42. package/src/sap/ui/vbm/Spot.js +1 -2
  43. package/src/sap/ui/vbm/Spots.js +1 -2
  44. package/src/sap/ui/vbm/VBI.js +41 -10
  45. package/src/sap/ui/vbm/VBIRenderer.js +1 -2
  46. package/src/sap/ui/vbm/Viewport.js +7 -7
  47. package/src/sap/ui/vbm/ViewportRenderer.js +1 -2
  48. package/src/sap/ui/vbm/VoAbstract.js +1 -2
  49. package/src/sap/ui/vbm/VoAggregation.js +4 -7
  50. package/src/sap/ui/vbm/VoBase.js +1 -2
  51. package/src/sap/ui/vbm/adapter3d/ModelHandler.js +2 -3
  52. package/src/sap/ui/vbm/adapter3d/ObjectFactory.js +2 -3
  53. package/src/sap/ui/vbm/adapter3d/PolygonHandler.js +2 -3
  54. package/src/sap/ui/vbm/adapter3d/SceneBuilder.js +269 -184
  55. package/src/sap/ui/vbm/adapter3d/Utilities.js +1 -2
  56. package/src/sap/ui/vbm/adapter3d/VBIJSONParser.js +2 -3
  57. package/src/sap/ui/vbm/adapter3d/thirdparty/ColladaLoader.js +2267 -2509
  58. package/src/sap/ui/vbm/adapter3d/thirdparty/DecalGeometry.js +194 -266
  59. package/src/sap/ui/vbm/adapter3d/thirdparty/OrbitControls.js +1004 -700
  60. package/src/sap/ui/vbm/lib/sapactions.js +11 -9
  61. package/src/sap/ui/vbm/lib/sapautomations.js +11 -13
  62. package/src/sap/ui/vbm/lib/sapconfig.js +10 -3
  63. package/src/sap/ui/vbm/lib/sapdataprovider.js +10 -21
  64. package/src/sap/ui/vbm/lib/sapevents.js +10 -11
  65. package/src/sap/ui/vbm/lib/sapgeolocation.js +9 -3
  66. package/src/sap/ui/vbm/lib/sapgeomath.js +10 -4
  67. package/src/sap/ui/vbm/lib/sapgeotool.js +11 -3
  68. package/src/sap/ui/vbm/lib/sapheatmap.js +27 -25
  69. package/src/sap/ui/vbm/lib/saplabels.js +16 -11
  70. package/src/sap/ui/vbm/lib/saplassotrack.js +10 -5
  71. package/src/sap/ui/vbm/lib/sapmaplayer.js +12 -10
  72. package/src/sap/ui/vbm/lib/sapmapmanager.js +14 -5
  73. package/src/sap/ui/vbm/lib/sapmapprovider.js +10 -5
  74. package/src/sap/ui/vbm/lib/sapnavigation.js +10 -3
  75. package/src/sap/ui/vbm/lib/sapparsing.js +10 -1
  76. package/src/sap/ui/vbm/lib/sappositioning.js +11 -5
  77. package/src/sap/ui/vbm/lib/sapprojection.js +11 -5
  78. package/src/sap/ui/vbm/lib/saprecttrack.js +10 -5
  79. package/src/sap/ui/vbm/lib/sapresources.js +11 -6
  80. package/src/sap/ui/vbm/lib/sapscale.js +14 -5
  81. package/src/sap/ui/vbm/lib/sapscene.js +13 -12
  82. package/src/sap/ui/vbm/lib/saputilities.js +11 -84
  83. package/src/sap/ui/vbm/lib/sapvbcluster.js +13 -6
  84. package/src/sap/ui/vbm/lib/sapvbi.js +9 -41
  85. package/src/sap/ui/vbm/lib/sapvbicontext.js +10 -5
  86. package/src/sap/ui/vbm/lib/sapvbmenu.js +18 -13
  87. package/src/sap/ui/vbm/lib/sapvobase.js +16 -16
  88. package/src/sap/ui/vbm/lib/sapvoutils.js +13 -24
  89. package/src/sap/ui/vbm/lib/sapwindow.js +11 -12
  90. package/src/sap/ui/vbm/library.js +29 -33
  91. package/src/sap/ui/vbm/themes/base/library.source.less +1 -2
  92. package/src/sap/ui/vbm/themes/sap_belize/library.source.less +1 -2
  93. package/src/sap/ui/vbm/themes/sap_belize_hcb/library.source.less +1 -2
  94. package/src/sap/ui/vbm/themes/sap_belize_hcw/library.source.less +1 -2
  95. package/src/sap/ui/vbm/themes/sap_belize_plus/library.source.less +1 -2
  96. package/src/sap/ui/vbm/themes/sap_bluecrystal/library.source.less +1 -2
  97. package/src/sap/ui/vbm/themes/sap_fiori_3/library.source.less +1 -2
  98. package/src/sap/ui/vbm/themes/sap_fiori_3_dark/library.source.less +1 -2
  99. package/src/sap/ui/vbm/themes/sap_fiori_3_hcb/library.source.less +1 -2
  100. package/src/sap/ui/vbm/themes/sap_fiori_3_hcw/library.source.less +1 -2
  101. package/src/sap/ui/vbm/themes/sap_hcb/library.source.less +1 -2
  102. package/src/sap/ui/vbm/themes/sap_horizon/library.source.less +1 -2
  103. package/ui5.yaml +6 -5
  104. package/src/sap/ui/vbm/adapter3d/thirdparty/html2canvas.js +0 -6
  105. 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.93.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 -> 2 materials replaced with one material, dispose second material (cap material)
639
- material = cylinder.material[1]; // cap material
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]; // switch to 2 materials -> first one for sides, second for caps
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
- // 2 materials if cylinder is closed, double sided material for open cylinder
661
- cylinder = new THREE.Mesh(geometry, open ? createMaterial(true) : [createMaterial(false), createMaterial(false)]);
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.Geometry();
985
- geometry.vertices.push(p1, p3, p2, p4);
986
-
987
- geometry.faces.push(
988
- new Face3(0, 1, 2, normal), // use plane normal as normal for triangles
989
- new Face3(2, 3, 0, normal)
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.Geometry} The box geometry.
1130
+ * @returns {THREE.BufferGeometry} The box geometry.
1116
1131
  * @private
1117
1132
  */
1118
1133
  createBox = function(sixSided) {
1119
- var geometry = new THREE.Geometry();
1120
- var length = 0.1;
1134
+ var geometry = new THREE.BufferGeometry();
1121
1135
 
1122
- geometry.vertices.push(
1136
+ geometry.setAttribute("position", new THREE.Float32BufferAttribute([
1123
1137
  // Top
1124
- new Vector3( length, length, -length),
1125
- new Vector3( length, -length, -length),
1126
- new Vector3(-length, -length, -length),
1127
- new Vector3(-length, length, -length),
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
- new Vector3( length, length, length),
1131
- new Vector3(-length, length, length),
1132
- new Vector3(-length, -length, length),
1133
- new Vector3( length, -length, length),
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
- new Vector3( length, length, -length),
1137
- new Vector3( length, length, length),
1138
- new Vector3( length, -length, length),
1139
- new Vector3( length, -length, -length),
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
- new Vector3( length, -length, -length),
1143
- new Vector3( length, -length, length),
1144
- new Vector3(-length, -length, length),
1145
- new Vector3(-length, -length, -length),
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
- new Vector3(-length, -length, -length),
1149
- new Vector3(-length, -length, length),
1150
- new Vector3(-length, length, length),
1151
- new Vector3(-length, length, -length),
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
- new Vector3( length, length, length),
1155
- new Vector3( length, length, -length),
1156
- new Vector3(-length, length, -length),
1157
- new Vector3(-length, length, length)
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
- var color = new THREE.Color(0.5, 0.5, 0.5);
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
- geometry.faces.push(
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
- new Face3(0, 2, 3, new Vector3(0, 0, -1), color),
1165
- new Face3(0, 1, 2, new Vector3(0, 0, -1), color),
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
- new Face3(4, 5, 6, new Vector3(0, 0, 1), color),
1169
- new Face3(4, 6, 7, new Vector3(0, 0, 1), color),
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
- new Face3(8, 10, 11, new Vector3(1, 0, 0), color),
1173
- new Face3(8, 9, 10, new Vector3(1, 0, 0), color),
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
- new Face3(12, 14, 15, new Vector3(0, -1, 0), color),
1177
- new Face3(12, 13, 14, new Vector3(0, -1, 0), color),
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
- new Face3(16, 18, 19, new Vector3(-1, 0, 0), color),
1181
- new Face3(16, 17, 18, new Vector3(-1, 0, 0), color),
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
- new Face3(20, 22, 23, new Vector3( 0, 1, 0), color),
1185
- new Face3(20, 21, 22, new Vector3( 0, 1, 0), color)
1186
- );
1187
-
1188
- var uvs;
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
- uvs = [
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
- new Vector2(2/3, 0.5),
1194
- new Vector2(1.0, 0.5),
1195
- new Vector2(1.0, 1.0),
1196
- new Vector2(2/3, 1.0),
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
- new Vector2(2/3, 0.5),
1202
- new Vector2(2/3, 0.0),
1203
- new Vector2(1.0, 0.0),
1204
- new Vector2(1.0, 0.5),
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
- new Vector2(2/3, 0.5),
1208
- new Vector2(2/3, 1.0),
1209
- new Vector2(1/3, 1.0),
1210
- new Vector2(1/3, 0.5),
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
- new Vector2(2/3, 0.0),
1214
- new Vector2(2/3, 0.5),
1215
- new Vector2(1/3, 0.5),
1216
- new Vector2(1/3, 0.0),
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
- new Vector2(1/3, 0.5),
1220
- new Vector2(1/3, 1.0),
1221
- new Vector2(0.0, 1.0),
1222
- new Vector2(0.0, 0.5),
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
- new Vector2(0.0, 0.5),
1226
- new Vector2(0.0, 0.0),
1227
- new Vector2(1/3, 0.0),
1228
- new Vector2(1/3, 0.5)
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
- // (0,0) (1,0)
1234
- // +----------+----------+
1235
- // | BACK | FRONT |
1236
- // +----------+----------+
1237
- // |RIGHT/LEFT|TOP/BOTTOM|
1238
- // +----------+----------+
1239
- // (0,1) (1,1)
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
- uvs = [
1359
+ geometry.setAttribute("uv", new THREE.Float32BufferAttribute([
1242
1360
  // Top
1243
- new Vector2(0.5, 0.5),
1244
- new Vector2(1.0, 0.5),
1245
- new Vector2(1.0, 1.0),
1246
- new Vector2(0.5, 1.0),
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
- // VB ActiveX incorrectly defines bottom the same as right/left, though the comments say it is the same as top.
1250
- new Vector2(0.5, 0.5),
1251
- new Vector2(1.0, 0.5),
1252
- new Vector2(1.0, 1.0),
1253
- new Vector2(0.5, 1.0),
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
- new Vector2(0.5, 0.5),
1257
- new Vector2(0.5, 1.0),
1258
- new Vector2(0.0, 1.0),
1259
- new Vector2(0.0, 0.5),
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
- new Vector2(0.5, 0.5),
1263
- new Vector2(0.5, 0.0),
1264
- new Vector2(1.0, 0.0),
1265
- new Vector2(1.0, 0.5),
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
- new Vector2(0.5, 0.5),
1269
- new Vector2(0.5, 1.0),
1270
- new Vector2(0.0, 1.0),
1271
- new Vector2(0.0, 0.5),
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
- new Vector2(0.0, 0.5),
1275
- new Vector2(0.0, 0.0),
1276
- new Vector2(0.5, 0.0),
1277
- new Vector2(0.5, 0.5)
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.Geometry} The cylinder geometry.
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
- var geometry = new THREE.CylinderGeometry(radius, radius, 2 * radius, 32, 1, open);
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 the base visual object.
@@ -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.93.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 */ {