@antv/g-lite 1.3.0-next.6 → 1.3.0-next.7
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/dist/index.esm.js +173 -112
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +173 -112
- package/dist/index.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/services/SceneGraphService.d.ts +12 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7831,92 +7831,118 @@ function toFontString(attributes) {
|
|
|
7831
7831
|
return "".concat(fontStyle, " ").concat(fontVariant, " ").concat(fontWeight, " ").concat(fontSizeString, " ").concat(fontFamilies.join(','));
|
|
7832
7832
|
}
|
|
7833
7833
|
|
|
7834
|
-
|
|
7834
|
+
function createSkewMatrix(skewMatrix, skewX, skewY) {
|
|
7835
|
+
// Create an identity matrix
|
|
7836
|
+
glMatrix.mat4.identity(skewMatrix);
|
|
7837
|
+
// Apply skew to the matrix
|
|
7838
|
+
skewMatrix[4] = Math.tan(skewX); // Skew Y axis in X direction
|
|
7839
|
+
skewMatrix[1] = Math.tan(skewY); // Skew X axis in Y direction
|
|
7840
|
+
return skewMatrix;
|
|
7841
|
+
}
|
|
7842
|
+
var tmpMat1 = glMatrix.mat4.create();
|
|
7843
|
+
var tmpMat2 = glMatrix.mat4.create();
|
|
7835
7844
|
function parsedTransformToMat4(transform, object) {
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7845
|
+
if (transform.length) {
|
|
7846
|
+
var m_1 = glMatrix.mat4.identity(tmpMat1);
|
|
7847
|
+
transform.forEach(function (parsed) {
|
|
7848
|
+
var t = parsed.t, d = parsed.d;
|
|
7849
|
+
if (t === 'scale') {
|
|
7850
|
+
// scale(1) scale(1, 1)
|
|
7851
|
+
var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1, 1];
|
|
7852
|
+
glMatrix.mat4.fromScaling(tmpMat2, [newScale[0], newScale[1], 1]);
|
|
7853
|
+
}
|
|
7854
|
+
else if (t === 'scalex') {
|
|
7855
|
+
var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];
|
|
7856
|
+
glMatrix.mat4.fromScaling(tmpMat2, [newScale[0], 1, 1]);
|
|
7857
|
+
}
|
|
7858
|
+
else if (t === 'scaley') {
|
|
7859
|
+
var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];
|
|
7860
|
+
glMatrix.mat4.fromScaling(tmpMat2, [1, newScale[0], 1]);
|
|
7861
|
+
}
|
|
7862
|
+
else if (t === 'scalez') {
|
|
7863
|
+
var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];
|
|
7864
|
+
glMatrix.mat4.fromScaling(tmpMat2, [1, 1, newScale[0]]);
|
|
7865
|
+
}
|
|
7866
|
+
else if (t === 'scale3d') {
|
|
7867
|
+
var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1, 1, 1];
|
|
7868
|
+
glMatrix.mat4.fromScaling(tmpMat2, [newScale[0], newScale[1], newScale[2]]);
|
|
7869
|
+
}
|
|
7870
|
+
else if (t === 'translate') {
|
|
7871
|
+
var newTranslation = d || [Opx, Opx];
|
|
7872
|
+
glMatrix.mat4.fromTranslation(tmpMat2, [
|
|
7873
|
+
newTranslation[0].value,
|
|
7874
|
+
newTranslation[1].value,
|
|
7875
|
+
0,
|
|
7876
|
+
]);
|
|
7877
|
+
}
|
|
7878
|
+
else if (t === 'translatex') {
|
|
7879
|
+
var newTranslation = d || [Opx];
|
|
7880
|
+
glMatrix.mat4.fromTranslation(tmpMat2, [newTranslation[0].value, 0, 0]);
|
|
7881
|
+
}
|
|
7882
|
+
else if (t === 'translatey') {
|
|
7883
|
+
var newTranslation = d || [Opx];
|
|
7884
|
+
glMatrix.mat4.fromTranslation(tmpMat2, [0, newTranslation[0].value, 0]);
|
|
7885
|
+
}
|
|
7886
|
+
else if (t === 'translatez') {
|
|
7887
|
+
var newTranslation = d || [Opx];
|
|
7888
|
+
glMatrix.mat4.fromTranslation(tmpMat2, [0, 0, newTranslation[0].value]);
|
|
7889
|
+
}
|
|
7890
|
+
else if (t === 'translate3d') {
|
|
7891
|
+
var newTranslation = d || [Opx, Opx, Opx];
|
|
7892
|
+
glMatrix.mat4.fromTranslation(tmpMat2, [
|
|
7893
|
+
newTranslation[0].value,
|
|
7894
|
+
newTranslation[1].value,
|
|
7895
|
+
newTranslation[2].value,
|
|
7896
|
+
]);
|
|
7897
|
+
}
|
|
7898
|
+
else if (t === 'rotate') {
|
|
7899
|
+
var newAngles = d || [Odeg];
|
|
7900
|
+
glMatrix.mat4.fromZRotation(tmpMat2, deg2rad(convertAngleUnit(newAngles[0])));
|
|
7901
|
+
}
|
|
7902
|
+
else if (t === 'rotatex') {
|
|
7903
|
+
var newAngles = d || [Odeg];
|
|
7904
|
+
glMatrix.mat4.fromXRotation(tmpMat2, deg2rad(convertAngleUnit(newAngles[0])));
|
|
7905
|
+
}
|
|
7906
|
+
else if (t === 'rotatey') {
|
|
7907
|
+
var newAngles = d || [Odeg];
|
|
7908
|
+
glMatrix.mat4.fromYRotation(tmpMat2, deg2rad(convertAngleUnit(newAngles[0])));
|
|
7909
|
+
}
|
|
7910
|
+
else if (t === 'rotatez') {
|
|
7911
|
+
var newAngles = d || [Odeg];
|
|
7912
|
+
glMatrix.mat4.fromZRotation(tmpMat2, deg2rad(convertAngleUnit(newAngles[0])));
|
|
7913
|
+
}
|
|
7914
|
+
else if (t === 'rotate3d') {
|
|
7915
|
+
var newAngles = d || [Opx, Opx, Opx, Odeg];
|
|
7916
|
+
glMatrix.mat4.fromRotation(tmpMat2, deg2rad(convertAngleUnit(newAngles[3])), [
|
|
7917
|
+
newAngles[0].value,
|
|
7918
|
+
newAngles[1].value,
|
|
7919
|
+
newAngles[2].value,
|
|
7920
|
+
]);
|
|
7921
|
+
}
|
|
7922
|
+
else if (t === 'skew') {
|
|
7923
|
+
var newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [0, 0];
|
|
7924
|
+
createSkewMatrix(tmpMat2, deg2rad(newSkew[0]), deg2rad(newSkew[1]));
|
|
7925
|
+
}
|
|
7926
|
+
else if (t === 'skewx') {
|
|
7927
|
+
var newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [0];
|
|
7928
|
+
createSkewMatrix(tmpMat2, deg2rad(newSkew[0]), 0);
|
|
7929
|
+
}
|
|
7930
|
+
else if (t === 'skewy') {
|
|
7931
|
+
var newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [0];
|
|
7932
|
+
createSkewMatrix(tmpMat2, 0, deg2rad(newSkew[0]));
|
|
7933
|
+
}
|
|
7934
|
+
else if (t === 'matrix') {
|
|
7935
|
+
var _a = tslib.__read(d.map(function (s) { return s.value; }), 6), a = _a[0], b = _a[1], c = _a[2], dd = _a[3], tx = _a[4], ty = _a[5];
|
|
7936
|
+
glMatrix.mat4.set(tmpMat2, a, b, 0, 0, c, dd, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1);
|
|
7937
|
+
}
|
|
7938
|
+
else if (t === 'matrix3d') {
|
|
7939
|
+
// @ts-ignore
|
|
7940
|
+
glMatrix.mat4.set.apply(glMatrix.mat4, tslib.__spreadArray([tmpMat2], tslib.__read(d.map(function (s) { return s.value; })), false));
|
|
7941
|
+
}
|
|
7942
|
+
glMatrix.mat4.mul(m_1, m_1, tmpMat2);
|
|
7943
|
+
});
|
|
7944
|
+
object.setLocalTransform(m_1);
|
|
7945
|
+
}
|
|
7920
7946
|
return object.getLocalTransform();
|
|
7921
7947
|
}
|
|
7922
7948
|
|
|
@@ -10339,9 +10365,10 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10339
10365
|
*/
|
|
10340
10366
|
this.rotate = (function () {
|
|
10341
10367
|
var parentInvertRotation = glMatrix.quat.create();
|
|
10342
|
-
return function (element, degrees, y, z) {
|
|
10368
|
+
return function (element, degrees, y, z, dirtify) {
|
|
10343
10369
|
if (y === void 0) { y = 0; }
|
|
10344
10370
|
if (z === void 0) { z = 0; }
|
|
10371
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10345
10372
|
if (typeof degrees === 'number') {
|
|
10346
10373
|
degrees = glMatrix.vec3.fromValues(degrees, y, z);
|
|
10347
10374
|
}
|
|
@@ -10360,7 +10387,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10360
10387
|
glMatrix.quat.multiply(rotation, parentInvertRotation, rotation);
|
|
10361
10388
|
glMatrix.quat.multiply(transform.localRotation, rotation, rot);
|
|
10362
10389
|
glMatrix.quat.normalize(transform.localRotation, transform.localRotation);
|
|
10363
|
-
|
|
10390
|
+
if (dirtify) {
|
|
10391
|
+
_this.dirtifyLocal(element, transform);
|
|
10392
|
+
}
|
|
10364
10393
|
}
|
|
10365
10394
|
};
|
|
10366
10395
|
})();
|
|
@@ -10370,16 +10399,19 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10370
10399
|
*/
|
|
10371
10400
|
this.rotateLocal = (function () {
|
|
10372
10401
|
var rotation = glMatrix.quat.create();
|
|
10373
|
-
return function (element, degrees, y, z) {
|
|
10402
|
+
return function (element, degrees, y, z, dirtify) {
|
|
10374
10403
|
if (y === void 0) { y = 0; }
|
|
10375
10404
|
if (z === void 0) { z = 0; }
|
|
10405
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10376
10406
|
if (typeof degrees === 'number') {
|
|
10377
10407
|
degrees = glMatrix.vec3.fromValues(degrees, y, z);
|
|
10378
10408
|
}
|
|
10379
10409
|
var transform = element.transformable;
|
|
10380
10410
|
glMatrix.quat.fromEuler(rotation, degrees[0], degrees[1], degrees[2]);
|
|
10381
10411
|
glMatrix.quat.mul(transform.localRotation, transform.localRotation, rotation);
|
|
10382
|
-
|
|
10412
|
+
if (dirtify) {
|
|
10413
|
+
_this.dirtifyLocal(element, transform);
|
|
10414
|
+
}
|
|
10383
10415
|
};
|
|
10384
10416
|
})();
|
|
10385
10417
|
/**
|
|
@@ -10387,9 +10419,10 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10387
10419
|
*/
|
|
10388
10420
|
this.setEulerAngles = (function () {
|
|
10389
10421
|
var invParentRot = glMatrix.quat.create();
|
|
10390
|
-
return function (element, degrees, y, z) {
|
|
10422
|
+
return function (element, degrees, y, z, dirtify) {
|
|
10391
10423
|
if (y === void 0) { y = 0; }
|
|
10392
10424
|
if (z === void 0) { z = 0; }
|
|
10425
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10393
10426
|
if (typeof degrees === 'number') {
|
|
10394
10427
|
degrees = glMatrix.vec3.fromValues(degrees, y, z);
|
|
10395
10428
|
}
|
|
@@ -10403,7 +10436,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10403
10436
|
var parentRotation = _this.getRotation(element.parentNode);
|
|
10404
10437
|
glMatrix.quat.copy(invParentRot, glMatrix.quat.invert(glMatrix.quat.create(), parentRotation));
|
|
10405
10438
|
glMatrix.quat.mul(transform.localRotation, transform.localRotation, invParentRot);
|
|
10406
|
-
|
|
10439
|
+
if (dirtify) {
|
|
10440
|
+
_this.dirtifyLocal(element, transform);
|
|
10441
|
+
}
|
|
10407
10442
|
}
|
|
10408
10443
|
};
|
|
10409
10444
|
})();
|
|
@@ -10417,9 +10452,10 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10417
10452
|
* ```
|
|
10418
10453
|
*/
|
|
10419
10454
|
this.translateLocal = (function () {
|
|
10420
|
-
return function (element, translation, y, z) {
|
|
10455
|
+
return function (element, translation, y, z, dirtify) {
|
|
10421
10456
|
if (y === void 0) { y = 0; }
|
|
10422
10457
|
if (z === void 0) { z = 0; }
|
|
10458
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10423
10459
|
if (typeof translation === 'number') {
|
|
10424
10460
|
translation = glMatrix.vec3.fromValues(translation, y, z);
|
|
10425
10461
|
}
|
|
@@ -10429,7 +10465,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10429
10465
|
}
|
|
10430
10466
|
glMatrix.vec3.transformQuat(translation, translation, transform.localRotation);
|
|
10431
10467
|
glMatrix.vec3.add(transform.localPosition, transform.localPosition, translation);
|
|
10432
|
-
|
|
10468
|
+
if (dirtify) {
|
|
10469
|
+
_this.dirtifyLocal(element, transform);
|
|
10470
|
+
}
|
|
10433
10471
|
};
|
|
10434
10472
|
})();
|
|
10435
10473
|
/**
|
|
@@ -10441,7 +10479,8 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10441
10479
|
this.setPosition = (function () {
|
|
10442
10480
|
var parentInvertMatrix = glMatrix.mat4.create();
|
|
10443
10481
|
var tmpPosition = glMatrix.vec3.create();
|
|
10444
|
-
return function (element, position) {
|
|
10482
|
+
return function (element, position, dirtify) {
|
|
10483
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10445
10484
|
var transform = element.transformable;
|
|
10446
10485
|
tmpPosition[0] = position[0];
|
|
10447
10486
|
tmpPosition[1] = position[1];
|
|
@@ -10460,7 +10499,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10460
10499
|
glMatrix.mat4.invert(parentInvertMatrix, parentInvertMatrix);
|
|
10461
10500
|
glMatrix.vec3.transformMat4(transform.localPosition, tmpPosition, parentInvertMatrix);
|
|
10462
10501
|
}
|
|
10463
|
-
|
|
10502
|
+
if (dirtify) {
|
|
10503
|
+
_this.dirtifyLocal(element, transform);
|
|
10504
|
+
}
|
|
10464
10505
|
};
|
|
10465
10506
|
})();
|
|
10466
10507
|
/**
|
|
@@ -10468,7 +10509,8 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10468
10509
|
*/
|
|
10469
10510
|
this.setLocalPosition = (function () {
|
|
10470
10511
|
var tmpPosition = glMatrix.vec3.create();
|
|
10471
|
-
return function (element, position) {
|
|
10512
|
+
return function (element, position, dirtify) {
|
|
10513
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10472
10514
|
var transform = element.transformable;
|
|
10473
10515
|
tmpPosition[0] = position[0];
|
|
10474
10516
|
tmpPosition[1] = position[1];
|
|
@@ -10477,7 +10519,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10477
10519
|
return;
|
|
10478
10520
|
}
|
|
10479
10521
|
glMatrix.vec3.copy(transform.localPosition, tmpPosition);
|
|
10480
|
-
|
|
10522
|
+
if (dirtify) {
|
|
10523
|
+
_this.dirtifyLocal(element, transform);
|
|
10524
|
+
}
|
|
10481
10525
|
};
|
|
10482
10526
|
})();
|
|
10483
10527
|
/**
|
|
@@ -10496,9 +10540,10 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10496
10540
|
var zeroVec3 = glMatrix.vec3.create();
|
|
10497
10541
|
var tmpVec3 = glMatrix.vec3.create();
|
|
10498
10542
|
var tr = glMatrix.vec3.create();
|
|
10499
|
-
return function (element, translation, y, z) {
|
|
10543
|
+
return function (element, translation, y, z, dirtify) {
|
|
10500
10544
|
if (y === void 0) { y = 0; }
|
|
10501
10545
|
if (z === void 0) { z = 0; }
|
|
10546
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10502
10547
|
if (typeof translation === 'number') {
|
|
10503
10548
|
translation = glMatrix.vec3.set(tmpVec3, translation, y, z);
|
|
10504
10549
|
}
|
|
@@ -10506,12 +10551,13 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10506
10551
|
return;
|
|
10507
10552
|
}
|
|
10508
10553
|
glMatrix.vec3.add(tr, _this.getPosition(element), translation);
|
|
10509
|
-
_this.setPosition(element, tr);
|
|
10554
|
+
_this.setPosition(element, tr, dirtify);
|
|
10510
10555
|
};
|
|
10511
10556
|
})();
|
|
10512
10557
|
this.setRotation = function () {
|
|
10513
10558
|
var parentInvertRotation = glMatrix.quat.create();
|
|
10514
|
-
return function (element, rotation, y, z, w) {
|
|
10559
|
+
return function (element, rotation, y, z, w, dirtify) {
|
|
10560
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10515
10561
|
var transform = element.transformable;
|
|
10516
10562
|
if (typeof rotation === 'number') {
|
|
10517
10563
|
rotation = glMatrix.quat.fromValues(rotation, y, z, w);
|
|
@@ -10526,7 +10572,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10526
10572
|
glMatrix.quat.invert(parentInvertRotation, parentInvertRotation);
|
|
10527
10573
|
glMatrix.quat.multiply(transform.localRotation, parentInvertRotation, rotation);
|
|
10528
10574
|
glMatrix.quat.normalize(transform.localRotation, transform.localRotation);
|
|
10529
|
-
|
|
10575
|
+
if (dirtify) {
|
|
10576
|
+
_this.dirtifyLocal(element, transform);
|
|
10577
|
+
}
|
|
10530
10578
|
}
|
|
10531
10579
|
};
|
|
10532
10580
|
};
|
|
@@ -10668,40 +10716,52 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10668
10716
|
/**
|
|
10669
10717
|
* set euler angles(degrees) in local space
|
|
10670
10718
|
*/
|
|
10671
|
-
DefaultSceneGraphService.prototype.setLocalEulerAngles = function (element, degrees, y, z) {
|
|
10719
|
+
DefaultSceneGraphService.prototype.setLocalEulerAngles = function (element, degrees, y, z, dirtify) {
|
|
10672
10720
|
if (y === void 0) { y = 0; }
|
|
10673
10721
|
if (z === void 0) { z = 0; }
|
|
10722
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10674
10723
|
if (typeof degrees === 'number') {
|
|
10675
10724
|
degrees = glMatrix.vec3.fromValues(degrees, y, z);
|
|
10676
10725
|
}
|
|
10677
10726
|
var transform = element.transformable;
|
|
10678
10727
|
glMatrix.quat.fromEuler(transform.localRotation, degrees[0], degrees[1], degrees[2]);
|
|
10679
|
-
|
|
10728
|
+
if (dirtify) {
|
|
10729
|
+
this.dirtifyLocal(element, transform);
|
|
10730
|
+
}
|
|
10680
10731
|
};
|
|
10681
10732
|
/**
|
|
10682
10733
|
* scale in local space
|
|
10683
10734
|
*/
|
|
10684
|
-
DefaultSceneGraphService.prototype.scaleLocal = function (element, scaling) {
|
|
10735
|
+
DefaultSceneGraphService.prototype.scaleLocal = function (element, scaling, dirtify) {
|
|
10736
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10685
10737
|
var transform = element.transformable;
|
|
10686
10738
|
glMatrix.vec3.multiply(transform.localScale, transform.localScale, glMatrix.vec3.fromValues(scaling[0], scaling[1], scaling[2] || 1));
|
|
10687
|
-
|
|
10739
|
+
if (dirtify) {
|
|
10740
|
+
this.dirtifyLocal(element, transform);
|
|
10741
|
+
}
|
|
10688
10742
|
};
|
|
10689
|
-
DefaultSceneGraphService.prototype.setLocalScale = function (element, scaling) {
|
|
10743
|
+
DefaultSceneGraphService.prototype.setLocalScale = function (element, scaling, dirtify) {
|
|
10744
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10690
10745
|
var transform = element.transformable;
|
|
10691
10746
|
var updatedScaling = glMatrix.vec3.fromValues(scaling[0], scaling[1], scaling[2] || transform.localScale[2]);
|
|
10692
10747
|
if (glMatrix.vec3.equals(updatedScaling, transform.localScale)) {
|
|
10693
10748
|
return;
|
|
10694
10749
|
}
|
|
10695
10750
|
glMatrix.vec3.copy(transform.localScale, updatedScaling);
|
|
10696
|
-
|
|
10751
|
+
if (dirtify) {
|
|
10752
|
+
this.dirtifyLocal(element, transform);
|
|
10753
|
+
}
|
|
10697
10754
|
};
|
|
10698
|
-
DefaultSceneGraphService.prototype.setLocalRotation = function (element, rotation, y, z, w) {
|
|
10755
|
+
DefaultSceneGraphService.prototype.setLocalRotation = function (element, rotation, y, z, w, dirtify) {
|
|
10756
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10699
10757
|
if (typeof rotation === 'number') {
|
|
10700
10758
|
rotation = glMatrix.quat.fromValues(rotation, y, z, w);
|
|
10701
10759
|
}
|
|
10702
10760
|
var transform = element.transformable;
|
|
10703
10761
|
glMatrix.quat.copy(transform.localRotation, rotation);
|
|
10704
|
-
|
|
10762
|
+
if (dirtify) {
|
|
10763
|
+
this.dirtifyLocal(element, transform);
|
|
10764
|
+
}
|
|
10705
10765
|
};
|
|
10706
10766
|
DefaultSceneGraphService.prototype.setLocalSkew = function (element, skew, y) {
|
|
10707
10767
|
if (typeof skew === 'number') {
|
|
@@ -10865,9 +10925,10 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10865
10925
|
var t = glMatrix.mat4.getTranslation(glMatrix.vec3.create(), transform);
|
|
10866
10926
|
var r = glMatrix.mat4.getRotation(glMatrix.quat.create(), transform);
|
|
10867
10927
|
var s = glMatrix.mat4.getScaling(glMatrix.vec3.create(), transform);
|
|
10868
|
-
this.setLocalScale(element, s);
|
|
10869
|
-
this.setLocalPosition(element, t);
|
|
10870
|
-
this.setLocalRotation(element, r);
|
|
10928
|
+
this.setLocalScale(element, s, false);
|
|
10929
|
+
this.setLocalPosition(element, t, false);
|
|
10930
|
+
this.setLocalRotation(element, r, undefined, undefined, undefined, false);
|
|
10931
|
+
this.dirtifyLocal(element, element.transformable);
|
|
10871
10932
|
};
|
|
10872
10933
|
DefaultSceneGraphService.prototype.resetLocalTransform = function (element) {
|
|
10873
10934
|
this.setLocalScale(element, [1, 1, 1]);
|