@sapui5/sap.ui.vbm 1.93.1 → 1.96.1

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