@sapui5/sap.ui.vbm 1.84.8 → 1.84.9
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 +1 -1
- package/src/sap/ui/vbm/Adapter3D.js +4 -1
- package/src/sap/ui/vbm/ClusterBase.js +2 -2
- package/src/sap/ui/vbm/Viewport.js +7 -2
- package/src/sap/ui/vbm/adapter3d/ModelHandler.js +25 -14
- package/src/sap/ui/vbm/adapter3d/ObjectFactory.js +1 -1
- package/src/sap/ui/vbm/adapter3d/PolygonHandler.js +31 -25
- package/src/sap/ui/vbm/adapter3d/SceneBuilder.js +25 -16
- package/src/sap/ui/vbm/adapter3d/VBIJSONParser.js +1 -1
- package/src/sap/ui/vbm/lib/sapscene.js +17 -11
- package/src/sap/ui/vbm/lib/sapvobase.js +1 -1
- package/src/sap/ui/vbm/library.js +2 -2
package/package.json
CHANGED
package/src/sap/ui/vbm/.library
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<name>sap.ui.vbm</name>
|
|
4
4
|
<vendor>SAP SE</vendor>
|
|
5
5
|
<copyright>SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2012 SAP AG. All rights reserved</copyright>
|
|
6
|
-
<version>1.84.
|
|
6
|
+
<version>1.84.9</version>
|
|
7
7
|
|
|
8
8
|
<documentation>SAP UI library: sap.ui.vbm</documentation>
|
|
9
9
|
|
|
@@ -21,7 +21,7 @@ sap.ui.define([
|
|
|
21
21
|
* @param {string} [sId] id for the new control, generated automatically if no id is given
|
|
22
22
|
* @param {object} [mSettings] initial settings for the new object
|
|
23
23
|
* @author SAP SE
|
|
24
|
-
* @version 1.84.
|
|
24
|
+
* @version 1.84.9
|
|
25
25
|
* @extends sap.ui.core.Element
|
|
26
26
|
* @constructor
|
|
27
27
|
* @public
|
|
@@ -42,7 +42,7 @@ sap.ui.define([
|
|
|
42
42
|
* @param {string} [sId] id for the new control, generated automatically if no id is given
|
|
43
43
|
* @param {object} [mSettings] initial settings for the new object
|
|
44
44
|
* @author SAP SE
|
|
45
|
-
* @version 1.84.
|
|
45
|
+
* @version 1.84.9
|
|
46
46
|
* @extends sap.ui.core.Element
|
|
47
47
|
* @constructor
|
|
48
48
|
* @public
|
|
@@ -247,7 +247,10 @@ sap.ui.define([
|
|
|
247
247
|
this._parser = null;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
+
this._detail = null;
|
|
250
251
|
this._context = null;
|
|
252
|
+
this._raycaster = null;
|
|
253
|
+
this._hoverInstance = null;
|
|
251
254
|
|
|
252
255
|
if (basePrototype.exit) {
|
|
253
256
|
basePrototype.exit.call(this);
|
|
@@ -119,7 +119,7 @@ sap.ui.define([
|
|
|
119
119
|
clusterVos: {
|
|
120
120
|
type: "sap.ui.core.Control",
|
|
121
121
|
multiple: true,
|
|
122
|
-
|
|
122
|
+
visibility: "hidden",
|
|
123
123
|
singularName: "clusterVo"
|
|
124
124
|
},
|
|
125
125
|
/**
|
|
@@ -128,7 +128,7 @@ sap.ui.define([
|
|
|
128
128
|
clusterContainers: {
|
|
129
129
|
type: "sap.ui.vbm.ClusterContainer",
|
|
130
130
|
multiple: true,
|
|
131
|
-
|
|
131
|
+
visibility: "hidden",
|
|
132
132
|
singularName: "clusterContainer"
|
|
133
133
|
}
|
|
134
134
|
|
|
@@ -25,7 +25,7 @@ sap.ui.define([
|
|
|
25
25
|
*
|
|
26
26
|
* @public
|
|
27
27
|
* @author SAP SE
|
|
28
|
-
* @version 1.84.
|
|
28
|
+
* @version 1.84.9
|
|
29
29
|
* @extends sap.ui.core.Control
|
|
30
30
|
* @alias sap.ui.vbm.Viewport
|
|
31
31
|
*/
|
|
@@ -190,9 +190,14 @@ sap.ui.define([
|
|
|
190
190
|
}
|
|
191
191
|
this._stopRenderLoop();
|
|
192
192
|
|
|
193
|
+
this._cameraController.dispose();
|
|
194
|
+
this._cameraController = null;
|
|
195
|
+
|
|
196
|
+
this._renderer.dispose();
|
|
197
|
+
this._renderer = null;
|
|
198
|
+
|
|
193
199
|
this._scene = null;
|
|
194
200
|
this._camera = null;
|
|
195
|
-
this._renderer = null;
|
|
196
201
|
|
|
197
202
|
if (basePrototype.exit) {
|
|
198
203
|
basePrototype.exit.call(this);
|
|
@@ -31,9 +31,9 @@ sap.ui.define([
|
|
|
31
31
|
*
|
|
32
32
|
* @private
|
|
33
33
|
* @author SAP SE
|
|
34
|
-
* @version 1.84.
|
|
34
|
+
* @version 1.84.9
|
|
35
35
|
* @alias sap.ui.vbm.adapter3d.ModelHandler
|
|
36
|
-
*/
|
|
36
|
+
*/
|
|
37
37
|
var ModelHandler = BaseObject.extend("sap.ui.vbm.adapter3d.ModelHandler", /** @lends sap.ui.vbm.adapter3d.ModelHandler.prototype */ {
|
|
38
38
|
|
|
39
39
|
constructor: function(resources, textures, scene, root) {
|
|
@@ -96,11 +96,14 @@ sap.ui.define([
|
|
|
96
96
|
this._textures = null;
|
|
97
97
|
this._scene = null;
|
|
98
98
|
this._root = null;
|
|
99
|
+
this._hotInstance = null;
|
|
99
100
|
|
|
100
101
|
// destroy 'meta' meshes
|
|
101
|
-
this._meshes.forEach(function(
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
this._meshes.forEach(function(array) {
|
|
103
|
+
array.forEach(function(item) {
|
|
104
|
+
item.objects3D.forEach(function(object) {
|
|
105
|
+
this._deleteObject3D(object);
|
|
106
|
+
}, this);
|
|
104
107
|
}, this);
|
|
105
108
|
}, this);
|
|
106
109
|
|
|
@@ -110,15 +113,23 @@ sap.ui.define([
|
|
|
110
113
|
subRef(instance.texture);
|
|
111
114
|
}
|
|
112
115
|
});
|
|
113
|
-
|
|
116
|
+
|
|
114
117
|
// destroy models
|
|
115
118
|
this._models.forEach(function(model, resource) {
|
|
116
119
|
this._deleteModel(model);
|
|
117
120
|
}, this);
|
|
118
121
|
|
|
119
122
|
this._meshes.clear();
|
|
123
|
+
this._meshes = null;
|
|
124
|
+
|
|
120
125
|
this._instances.clear();
|
|
126
|
+
this._instances = null;
|
|
127
|
+
|
|
121
128
|
this._models.clear();
|
|
129
|
+
this._models = null;
|
|
130
|
+
|
|
131
|
+
this._glTFLoader = null;
|
|
132
|
+
this._colladaLoader = null;
|
|
122
133
|
|
|
123
134
|
BaseObject.prototype.destroy.call(this);
|
|
124
135
|
};
|
|
@@ -148,7 +159,7 @@ sap.ui.define([
|
|
|
148
159
|
* @param {object} instance Model instance.
|
|
149
160
|
* @public
|
|
150
161
|
*/
|
|
151
|
-
ModelHandler.prototype.updateInstance = function(instance) {
|
|
162
|
+
ModelHandler.prototype.updateInstance = function(instance) {
|
|
152
163
|
var data = this._instances.get(instance), update = false, hot = this._hotInstance && this._hotInstance === instance;
|
|
153
164
|
if (data) {
|
|
154
165
|
var normalized = Utilities.toBoolean(instance.normalize);
|
|
@@ -187,7 +198,7 @@ sap.ui.define([
|
|
|
187
198
|
}
|
|
188
199
|
update = true;
|
|
189
200
|
}
|
|
190
|
-
|
|
201
|
+
|
|
191
202
|
// when model normalization changed -> update model properties -> reset instance model matrices
|
|
192
203
|
if (propertyChanged(instance, ["normalize", "model"])) {
|
|
193
204
|
this._updateModel(data.model, normalized);
|
|
@@ -219,9 +230,9 @@ sap.ui.define([
|
|
|
219
230
|
if (data.matrices.length === 0) {
|
|
220
231
|
var world = this._root.matrixWorld.clone(); // start from the _root
|
|
221
232
|
world.multiply(data.world); // apply instance world matrix
|
|
222
|
-
|
|
233
|
+
|
|
223
234
|
// if instance normalized -> apply normalized model root matrix as otherwise (non normalized case) model root has identity matrix
|
|
224
|
-
if (normalized) {
|
|
235
|
+
if (normalized) {
|
|
225
236
|
world.multiply(data.model.normalized.world);
|
|
226
237
|
}
|
|
227
238
|
// apply individual mesh matrices from the model at last
|
|
@@ -255,7 +266,7 @@ sap.ui.define([
|
|
|
255
266
|
this._instances.delete(instance);
|
|
256
267
|
this._removeInstanceFromMesh(data);
|
|
257
268
|
instance._last = {}; // reset all LRU variables at once
|
|
258
|
-
|
|
269
|
+
|
|
259
270
|
if (data.model) {
|
|
260
271
|
subRef(data.model); // model can be null if removing 'broken' instance
|
|
261
272
|
}
|
|
@@ -430,7 +441,7 @@ sap.ui.define([
|
|
|
430
441
|
ModelHandler.prototype._postprocess = function(model, content) {
|
|
431
442
|
// mirror on Z axis entire collada root which is effectively the same as collada processing with baking transformations and inverting Z coordinates in ActiveX
|
|
432
443
|
model.scene.scale.set(1,1,-1);
|
|
433
|
-
|
|
444
|
+
|
|
434
445
|
var meshes = [], materials = new Set(), marked = "_sapUsed";
|
|
435
446
|
// collect meshes only + calculate world matrix, mark used materials & maps
|
|
436
447
|
model.scene.traverse(function(object) {
|
|
@@ -560,7 +571,7 @@ sap.ui.define([
|
|
|
560
571
|
// remove instanced mesh from scene
|
|
561
572
|
if (object.parent) {
|
|
562
573
|
object.parent.remove(object);
|
|
563
|
-
}
|
|
574
|
+
}
|
|
564
575
|
// geometries are shared -> cannot dispose
|
|
565
576
|
Utilities.toArray(object.material).forEach(function(material) {
|
|
566
577
|
material.dispose(); // materials are cloned -> can be disposed, maps are shared -> don't touch, cannot be disposes
|
|
@@ -584,7 +595,7 @@ sap.ui.define([
|
|
|
584
595
|
// target has to be added to _root to mimic original model and must have same world matrix as original model
|
|
585
596
|
// so we calculate world matrix for target which will be under _root and not under _scene as instance mesh
|
|
586
597
|
var world = data.world.clone(); // use instance world as starting point
|
|
587
|
-
if (data.model.normalized) {
|
|
598
|
+
if (data.model.normalized) {
|
|
588
599
|
world.multiply(data.model.normalized.world);
|
|
589
600
|
}
|
|
590
601
|
world.multiply(data.model.root.children[0].matrixWorld);
|
|
@@ -378,7 +378,7 @@ sap.ui.define([
|
|
|
378
378
|
*
|
|
379
379
|
* @private
|
|
380
380
|
* @author SAP SE
|
|
381
|
-
* @version 1.84.
|
|
381
|
+
* @version 1.84.9
|
|
382
382
|
* @alias sap.ui.vbm.adapter3d.ObjectFactory
|
|
383
383
|
*/
|
|
384
384
|
var ObjectFactory = BaseObject.extend("sap.ui.vbm.adapter3d.ObjectFactory", /** @lends sap.ui.vbm.adapter3d.ObjectFactory.prototype */ {});
|
|
@@ -34,9 +34,9 @@ sap.ui.define([
|
|
|
34
34
|
*
|
|
35
35
|
* @private
|
|
36
36
|
* @author SAP SE
|
|
37
|
-
* @version 1.84.
|
|
37
|
+
* @version 1.84.9
|
|
38
38
|
* @alias sap.ui.vbm.adapter3d.PolygonHandler
|
|
39
|
-
*/
|
|
39
|
+
*/
|
|
40
40
|
var PolygonHandler = BaseObject.extend("sap.ui.vbm.adapter3d.PolygonHandler", /** @lends sap.ui.vbm.adapter3d.PolygonHandler.prototype */ {
|
|
41
41
|
|
|
42
42
|
constructor: function(root) {
|
|
@@ -99,7 +99,7 @@ sap.ui.define([
|
|
|
99
99
|
PolygonHandler.prototype.destroy = function() {
|
|
100
100
|
// Reset references to shared objects.
|
|
101
101
|
this._root = null;
|
|
102
|
-
this.
|
|
102
|
+
this._hotInstance = null;
|
|
103
103
|
|
|
104
104
|
// destroy 'meta' meshes
|
|
105
105
|
this._meshes.forEach(function(key, array) {
|
|
@@ -114,10 +114,16 @@ sap.ui.define([
|
|
|
114
114
|
this._deleteObject3D(border.object3D);
|
|
115
115
|
}, this);
|
|
116
116
|
}, this);
|
|
117
|
-
|
|
117
|
+
|
|
118
118
|
// clear
|
|
119
|
+
this._instances.clear();
|
|
120
|
+
this._instances = null;
|
|
121
|
+
|
|
119
122
|
this._meshes.clear();
|
|
123
|
+
this._meshes = null;
|
|
124
|
+
|
|
120
125
|
this._borders.clear();
|
|
126
|
+
this._borders = null;
|
|
121
127
|
|
|
122
128
|
BaseObject.prototype.destroy.call(this);
|
|
123
129
|
};
|
|
@@ -137,11 +143,11 @@ sap.ui.define([
|
|
|
137
143
|
|
|
138
144
|
/**
|
|
139
145
|
* Adds polygon instance to polygon handler.
|
|
140
|
-
*
|
|
146
|
+
*
|
|
141
147
|
* @param {object} instance Polygon instance.
|
|
142
148
|
* @public
|
|
143
149
|
*/
|
|
144
|
-
PolygonHandler.prototype.addInstance = function(instance) {
|
|
150
|
+
PolygonHandler.prototype.addInstance = function(instance) {
|
|
145
151
|
this._instances.set(instance, {
|
|
146
152
|
instance : instance,
|
|
147
153
|
indices: [],
|
|
@@ -161,11 +167,11 @@ sap.ui.define([
|
|
|
161
167
|
|
|
162
168
|
/**
|
|
163
169
|
* Updates polygon instance in polygon handler
|
|
164
|
-
*
|
|
170
|
+
*
|
|
165
171
|
* @param {object} instance Polygon instance.
|
|
166
172
|
* @public
|
|
167
173
|
*/
|
|
168
|
-
PolygonHandler.prototype.updateInstance = function(instance) {
|
|
174
|
+
PolygonHandler.prototype.updateInstance = function(instance) {
|
|
169
175
|
var data = this._instances.get(instance), updateMesh = false, updateBorder = false;
|
|
170
176
|
if (data) {
|
|
171
177
|
// position, rotation, scale [mandatory attributes] when change -> recalculate matrix
|
|
@@ -188,7 +194,7 @@ sap.ui.define([
|
|
|
188
194
|
}
|
|
189
195
|
|
|
190
196
|
// if any property which affects polygon color changed -> check if polygon color actually changed
|
|
191
|
-
// then update polygon color and remove polygon from current 'meta' mesh if it exists
|
|
197
|
+
// then update polygon color and remove polygon from current 'meta' mesh if it exists
|
|
192
198
|
// and put it into another 'meta' mesh according to polygon updated color
|
|
193
199
|
// color, selectColor, VB:s [mandatory attributes]
|
|
194
200
|
if (propertyChanged(instance, ["color", "selectColor", "VB:s"])) {
|
|
@@ -329,13 +335,13 @@ sap.ui.define([
|
|
|
329
335
|
// create 3 or 2 groups, depends on where hot instance geometry is within 'meta' mesh geometry
|
|
330
336
|
geometry.addGroup(range.start, data.indices.length, 1); // use hot material with index #1
|
|
331
337
|
|
|
332
|
-
if (range.start !== 0) {
|
|
338
|
+
if (range.start !== 0) {
|
|
333
339
|
geometry.addGroup(0, range.start, 0); // use original material with index #0
|
|
334
340
|
}
|
|
335
341
|
if (range.start + data.indices.length < geometry.index.count) {
|
|
336
342
|
geometry.addGroup(range.start + data.indices.length, geometry.index.count - range.start - data.indices.length, 0); // use original material with index #0
|
|
337
343
|
}
|
|
338
|
-
}
|
|
344
|
+
}
|
|
339
345
|
}
|
|
340
346
|
if (data.border) { // apply hover on polygon border geometry
|
|
341
347
|
material = data.border.material;
|
|
@@ -365,13 +371,13 @@ sap.ui.define([
|
|
|
365
371
|
var vertexCount = data.lines.length/3;
|
|
366
372
|
geometry.addGroup(range.start, vertexCount, 1); // use hot material with index #1
|
|
367
373
|
|
|
368
|
-
if (range.start !== 0) {
|
|
374
|
+
if (range.start !== 0) {
|
|
369
375
|
geometry.addGroup(0, range.start, 0); // use original material with index #0
|
|
370
376
|
}
|
|
371
377
|
if (range.start + vertexCount < positions.count) {
|
|
372
378
|
geometry.addGroup(range.start + vertexCount, positions.count - range.start - vertexCount, 0); // use original material with index #0
|
|
373
379
|
}
|
|
374
|
-
}
|
|
380
|
+
}
|
|
375
381
|
}
|
|
376
382
|
} else {
|
|
377
383
|
log.error("Unable to find polygon instance data", "", thisModule);
|
|
@@ -430,7 +436,7 @@ sap.ui.define([
|
|
|
430
436
|
|
|
431
437
|
/**
|
|
432
438
|
* Updates 'meta' meshes requested for rebuild by combining geometry of all instances with the same color into one mesh.
|
|
433
|
-
*
|
|
439
|
+
*
|
|
434
440
|
* @returns {boolean} True if hot instance 'meta' mesh has been recreated.
|
|
435
441
|
* @private
|
|
436
442
|
*/
|
|
@@ -441,11 +447,11 @@ sap.ui.define([
|
|
|
441
447
|
for (var i = 0; i < array.length;) {
|
|
442
448
|
if (array[i].dirty) {
|
|
443
449
|
var j, instance, base, indices = [], vertices = [], normals = [], data = array[i];
|
|
444
|
-
|
|
450
|
+
|
|
445
451
|
this._deleteObject3D(data.object3D);
|
|
446
452
|
data.object3D = null;
|
|
447
453
|
data.hitInfo.length = 0; // erase hitInfo
|
|
448
|
-
|
|
454
|
+
|
|
449
455
|
data.instances.forEach(function(range, key) {
|
|
450
456
|
instance = key; // to access instance outside forEach
|
|
451
457
|
|
|
@@ -481,24 +487,24 @@ sap.ui.define([
|
|
|
481
487
|
|
|
482
488
|
if (indices.length) {
|
|
483
489
|
var geometry = new THREE.BufferGeometry();
|
|
484
|
-
|
|
490
|
+
|
|
485
491
|
geometry.setIndex(indices);
|
|
486
492
|
geometry.setAttribute("position", new THREE.Float32BufferAttribute(vertices, 3));
|
|
487
493
|
geometry.setAttribute("normal", new THREE.Float32BufferAttribute(normals, 3));
|
|
488
494
|
geometry.computeBoundingBox(); // needed for ray casting
|
|
489
495
|
geometry.computeBoundingSphere(); // needed for ray casting
|
|
490
|
-
|
|
496
|
+
|
|
491
497
|
var material = createMaterial(true);
|
|
492
498
|
material.color.copy(instance.color.rgb);
|
|
493
499
|
material.opacity = instance.color.opacity;
|
|
494
500
|
material.transparent = material.opacity < 1;
|
|
495
501
|
material.needsUpdate = true;
|
|
496
|
-
|
|
502
|
+
|
|
497
503
|
data.object3D = new THREE.Mesh(geometry, material);
|
|
498
504
|
data.object3D.matrixAutoUpdate = false;
|
|
499
505
|
data.object3D.layers.set(0); // put it to layer #0 to enable raycasting
|
|
500
506
|
this._root.add(data.object3D);
|
|
501
|
-
|
|
507
|
+
|
|
502
508
|
data.object3D._instanceHitTest = this._instanceHitTest.bind(data); // helper function to return instance based on hit test info
|
|
503
509
|
data.triangleCount = indices.length/3; // update triangle count on full rebuild
|
|
504
510
|
}
|
|
@@ -529,7 +535,7 @@ sap.ui.define([
|
|
|
529
535
|
|
|
530
536
|
/**
|
|
531
537
|
* Updates 'meta' borders requested for rebuild by combining geometry of all instances with the same color into one mesh.
|
|
532
|
-
*
|
|
538
|
+
*
|
|
533
539
|
* @returns {boolean} True if hot instance 'meta' border has been recreated.
|
|
534
540
|
* @private
|
|
535
541
|
*/
|
|
@@ -567,13 +573,13 @@ sap.ui.define([
|
|
|
567
573
|
var geometry = new THREE.BufferGeometry();
|
|
568
574
|
geometry.setAttribute("position", new THREE.Float32BufferAttribute(vertices, 3));
|
|
569
575
|
geometry.computeBoundingBox();
|
|
570
|
-
|
|
576
|
+
|
|
571
577
|
var material = createLineMaterial();
|
|
572
578
|
material.color.copy(instance.colorBorder.rgb);
|
|
573
579
|
material.opacity = instance.colorBorder.opacity;
|
|
574
580
|
material.transparent = material.opacity < 1;
|
|
575
581
|
material.needsUpdate = true;
|
|
576
|
-
|
|
582
|
+
|
|
577
583
|
data.object3D = new THREE.LineSegments(geometry, material);
|
|
578
584
|
data.object3D.matrixAutoUpdate = false;
|
|
579
585
|
data.object3D.layers.set(1); // put it to layer #1 to disable hit test
|
|
@@ -741,10 +747,10 @@ sap.ui.define([
|
|
|
741
747
|
if (object) {
|
|
742
748
|
if (object.parent) {
|
|
743
749
|
object.parent.remove(object);
|
|
744
|
-
}
|
|
750
|
+
}
|
|
745
751
|
if (object.geometry) {
|
|
746
752
|
object.geometry.dispose();
|
|
747
|
-
}
|
|
753
|
+
}
|
|
748
754
|
Utilities.toArray(object.material).forEach(function(material) {
|
|
749
755
|
material.dispose(); // no maps to dispose
|
|
750
756
|
});
|
|
@@ -9,7 +9,7 @@ sap.ui.define([
|
|
|
9
9
|
"sap/ui/base/Object",
|
|
10
10
|
"./Utilities",
|
|
11
11
|
"./PolygonHandler",
|
|
12
|
-
"./ModelHandler",
|
|
12
|
+
"./ModelHandler",
|
|
13
13
|
"./thirdparty/three",
|
|
14
14
|
"./thirdparty/DecalGeometry",
|
|
15
15
|
"./thirdparty/html2canvas"],
|
|
@@ -50,7 +50,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
50
50
|
*
|
|
51
51
|
* @private
|
|
52
52
|
* @author SAP SE
|
|
53
|
-
* @version 1.84.
|
|
53
|
+
* @version 1.84.9
|
|
54
54
|
* @alias sap.ui.vbm.adapter3d.SceneBuilder
|
|
55
55
|
*/
|
|
56
56
|
var SceneBuilder = BaseObject.extend("sap.ui.vbm.adapter3d.SceneBuilder", /** @lends sap.ui.vbm.adapter3d.SceneBuilder.prototype */ {
|
|
@@ -107,9 +107,11 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
107
107
|
this._scene = null;
|
|
108
108
|
this._viewport = null;
|
|
109
109
|
this._context = null;
|
|
110
|
+
this._hotInstance = null;
|
|
111
|
+
|
|
110
112
|
|
|
111
113
|
if (this._box4) {
|
|
112
|
-
this.
|
|
114
|
+
this._box4.dispose();
|
|
113
115
|
}
|
|
114
116
|
if (this._box6) {
|
|
115
117
|
this._box6.dispose();
|
|
@@ -125,15 +127,22 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
125
127
|
this._decalHelper.material.dispose();
|
|
126
128
|
this._decalHelper.geometry.dispose();
|
|
127
129
|
this._scene.remove(this._decalHelper);
|
|
130
|
+
this._decalHelper = null;
|
|
128
131
|
}
|
|
129
132
|
|
|
130
133
|
this._polygonHandler.destroy();
|
|
134
|
+
this._polygonHandler = null;
|
|
135
|
+
|
|
131
136
|
this._modelHandler.destroy();
|
|
137
|
+
this._modelHandler = null;
|
|
132
138
|
|
|
133
139
|
this._textures.forEach(function(texture) {
|
|
134
140
|
texture.dispose();
|
|
135
141
|
});
|
|
136
142
|
|
|
143
|
+
this._targets.clear();
|
|
144
|
+
this._targets = null;
|
|
145
|
+
|
|
137
146
|
BaseObject.prototype.destroy.call(this);
|
|
138
147
|
};
|
|
139
148
|
|
|
@@ -194,7 +203,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
194
203
|
[].concat(toAdd, toUpdate).forEach(function(instance) {
|
|
195
204
|
if (instance.isModel) {
|
|
196
205
|
that._modelHandler.addModel(instance);
|
|
197
|
-
}
|
|
206
|
+
}
|
|
198
207
|
if (instance.texture && propertyChanged(instance, "texture")) {
|
|
199
208
|
addTexture(instance.texture);
|
|
200
209
|
}
|
|
@@ -313,7 +322,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
313
322
|
var state = {
|
|
314
323
|
zoom: 1.0,
|
|
315
324
|
// convert from left handed (DirectX) to right handed (OpenGL)
|
|
316
|
-
target: new Vector3(-camTarget.x, -camTarget.z, camTarget.y),
|
|
325
|
+
target: new Vector3(-camTarget.x, -camTarget.z, camTarget.y),
|
|
317
326
|
position: new Vector3(-pos.x, -pos.z, pos.y)
|
|
318
327
|
};
|
|
319
328
|
|
|
@@ -580,7 +589,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
580
589
|
// var timestamp = performance.now();
|
|
581
590
|
this._polygonHandler.updateHotInstance(instance);
|
|
582
591
|
this._modelHandler.updateHotInstance(instance);
|
|
583
|
-
|
|
592
|
+
|
|
584
593
|
// perform pending updates if any
|
|
585
594
|
this._polygonHandler.update();
|
|
586
595
|
this._modelHandler.update();
|
|
@@ -592,7 +601,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
592
601
|
if (instance) {
|
|
593
602
|
this._updateHotStatus(instance, true);
|
|
594
603
|
}
|
|
595
|
-
|
|
604
|
+
|
|
596
605
|
this._hotInstance = instance;
|
|
597
606
|
// DEBUG
|
|
598
607
|
// log.info("update hover took " + (performance.now() - timestamp) + " milliseconds", "", thisModule);
|
|
@@ -615,9 +624,9 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
615
624
|
box.layers.set(0); // put it to layer #0 to enable raycasting
|
|
616
625
|
box._sapInstance = instance; // keep reference to instance
|
|
617
626
|
instance.object3D.add(box);
|
|
618
|
-
}
|
|
627
|
+
}
|
|
619
628
|
}
|
|
620
|
-
|
|
629
|
+
|
|
621
630
|
// update properties after processing is done
|
|
622
631
|
updateProperty(instance, "texture6");
|
|
623
632
|
|
|
@@ -666,7 +675,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
666
675
|
cylinder.layers.set(0); // put it to layer #0 to enable raycasting
|
|
667
676
|
cylinder._sapInstance = instance; // keep reference to instance
|
|
668
677
|
instance.object3D.add(cylinder);
|
|
669
|
-
}
|
|
678
|
+
}
|
|
670
679
|
}
|
|
671
680
|
|
|
672
681
|
if (propertyChanged(instance, "textureCap") || updateTextureCap) {
|
|
@@ -689,12 +698,12 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
689
698
|
}
|
|
690
699
|
}
|
|
691
700
|
}
|
|
692
|
-
|
|
701
|
+
|
|
693
702
|
// update cylinder properties after processing is done
|
|
694
703
|
updateProperty(instance, ["isOpen", "testureCap"]);
|
|
695
704
|
|
|
696
705
|
// handle common properties
|
|
697
|
-
this._assignProperties(instance, hot);
|
|
706
|
+
this._assignProperties(instance, hot);
|
|
698
707
|
};
|
|
699
708
|
|
|
700
709
|
SceneBuilder.prototype._assignProperties = function(instance, hot) {
|
|
@@ -818,9 +827,9 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
818
827
|
Utilities.subRef(material.map); // release current texture in use
|
|
819
828
|
material.map = null;
|
|
820
829
|
}
|
|
821
|
-
|
|
830
|
+
|
|
822
831
|
material.map = this._textures.get(instance.text ? this._getDecalTextKey(instance) : instance.texture);
|
|
823
|
-
|
|
832
|
+
|
|
824
833
|
if (material.map) {
|
|
825
834
|
material.map.flipY = true;
|
|
826
835
|
material.needsUpdate = true; // required by threeJS
|
|
@@ -829,7 +838,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
829
838
|
log.error("Unable to apply texture, texture not found", instance.texture, thisModule);
|
|
830
839
|
}
|
|
831
840
|
}
|
|
832
|
-
|
|
841
|
+
|
|
833
842
|
// update properties after processing is done
|
|
834
843
|
updateProperty(instance, ["position", "direction", "size", "rotation", "target", "texture", "text", "planeOrigin", "planeNormal"]);
|
|
835
844
|
};
|
|
@@ -996,7 +1005,7 @@ function(jQuery, BaseObject, Utilities, PolygonHandler, ModelHandler, THREE, Dec
|
|
|
996
1005
|
|
|
997
1006
|
SceneBuilder.prototype._getDecalTarget = function(instance) {
|
|
998
1007
|
if (instance.target) {
|
|
999
|
-
var target = this._targets.get(instance.target);
|
|
1008
|
+
var target = this._targets.get(instance.target);
|
|
1000
1009
|
if (target) {
|
|
1001
1010
|
if (target.isBox || target.isCylinder) {
|
|
1002
1011
|
return target.object3D.children[0]; // object3d is a group node, where its first child is actual mesh
|
|
@@ -58,7 +58,7 @@ sap.ui.define([
|
|
|
58
58
|
*
|
|
59
59
|
* @private
|
|
60
60
|
* @author SAP SE
|
|
61
|
-
* @version 1.84.
|
|
61
|
+
* @version 1.84.9
|
|
62
62
|
* @alias sap.ui.vbm.adapter3d.VBIJSONParser
|
|
63
63
|
*/
|
|
64
64
|
var VBIJSONParser = BaseObject.extend("sap.ui.vbm.adapter3d.VBIJSONParser", /** @lends sap.ui.vbm.adapter3d.VBIJSONParser.prototype */ {
|
|
@@ -673,18 +673,24 @@ VBI.Scene = function(target) {
|
|
|
673
673
|
}
|
|
674
674
|
// standard case - click on single object
|
|
675
675
|
if (event.hitTests.length > 0) {
|
|
676
|
-
event.hitCached = event.hitTests[0];
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
676
|
+
event.hitCached = event.hitTests[0]; // cache first hit test
|
|
677
|
+
delete event.hitTests; // has to be deleted to avoid collecting hits information again
|
|
678
|
+
// if there is a VO then pass event to it
|
|
679
|
+
if (event.hitCached.m_Vo) {
|
|
680
|
+
return event.hitCached.m_Vo["on" + eventType].call(event.hitCached.m_Vo, event);
|
|
681
|
+
} else {
|
|
682
|
+
delete event.hitCached; // remove it to keep things going "old" way
|
|
683
|
+
}
|
|
684
|
+
} else {
|
|
685
|
+
return false; // not handled
|
|
680
686
|
}
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
687
|
+
}
|
|
688
|
+
// "old" approach -> process from last to first which corresponds to the rendering order (from topmost to last)
|
|
689
|
+
for (var i = scene.m_VOS.length - 1; i >= 0; --i) {
|
|
690
|
+
if ((func = scene.m_VOS[i]["on" + eventType]) && typeof (func) == 'function') {
|
|
691
|
+
// call the handler with the context set to corresponded visual object
|
|
692
|
+
if (func.call(scene.m_VOS[i], event)) {
|
|
693
|
+
return true; // handled
|
|
688
694
|
}
|
|
689
695
|
}
|
|
690
696
|
}
|
|
@@ -1220,7 +1220,7 @@ VBI.VisualObjects = function() {
|
|
|
1220
1220
|
}
|
|
1221
1221
|
// check for design handle context menu subscription.............//
|
|
1222
1222
|
var action, actions = scene.m_Ctx.m_Actions;
|
|
1223
|
-
if (actions && ocb.m_Design && ocb.m_Handle > -1) {
|
|
1223
|
+
if (actions && ocb.m_Design && (ocb.m_Handle > -1 || ocb.m_Hit === VBI.HTBOX)) {
|
|
1224
1224
|
// the action is raised whenever a design action has stopped..//
|
|
1225
1225
|
// for the instanced type.....................................//
|
|
1226
1226
|
// is it a HandleMoved or a HandleClick action ...............//
|
|
@@ -17,7 +17,7 @@ sap.ui.define([
|
|
|
17
17
|
* @namespace
|
|
18
18
|
* @name sap.ui.vbm
|
|
19
19
|
* @author SAP SE
|
|
20
|
-
* @version 1.84.
|
|
20
|
+
* @version 1.84.9
|
|
21
21
|
* @public
|
|
22
22
|
*/
|
|
23
23
|
|
|
@@ -47,7 +47,7 @@ sap.ui.define([
|
|
|
47
47
|
"sap.ui.vbm.ClusterBase", "sap.ui.vbm.ClusterTree", "sap.ui.vbm.ClusterGrid", "sap.ui.vbm.ClusterDistance", "sap.ui.vbm.Heatmap",
|
|
48
48
|
"sap.ui.vbm.HeatPoint", "sap.ui.vbm.ClusterContainer", "sap.ui.vbm.Adapter", "sap.ui.vbm.Adapter3D"
|
|
49
49
|
],
|
|
50
|
-
version: "1.84.
|
|
50
|
+
version: "1.84.9"
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
jQuery.sap.registerModuleShims({
|