@galacean/engine-core 1.4.0 → 1.4.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.
- package/dist/main.js +32 -20
- package/dist/main.js.map +1 -1
- package/dist/module.js +32 -20
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/physics/joint/HingeJoint.d.ts +2 -1
- package/types/physics/joint/Joint.d.ts +1 -1
package/dist/main.js
CHANGED
|
@@ -21841,9 +21841,9 @@ exports.Joint = /*#__PURE__*/ function(Component) {
|
|
|
21841
21841
|
_this = Component.call(this, entity) || this, _this._colliderInfo = new JointColliderInfo(), _this._connectedColliderInfo = new JointColliderInfo(), _this._force = Infinity, _this._torque = Infinity, _this._automaticConnectedAnchor = true;
|
|
21842
21842
|
//@ts-ignore
|
|
21843
21843
|
_this._colliderInfo.anchor._onValueChanged = _this._updateActualAnchor.bind(_this, 1);
|
|
21844
|
-
_this.
|
|
21844
|
+
_this._handleConnectedAnchorChanged = _this._handleConnectedAnchorChanged.bind(_this);
|
|
21845
21845
|
//@ts-ignore
|
|
21846
|
-
_this._connectedColliderInfo.anchor._onValueChanged = _this.
|
|
21846
|
+
_this._connectedColliderInfo.anchor._onValueChanged = _this._handleConnectedAnchorChanged.bind(_this);
|
|
21847
21847
|
_this._onSelfTransformChanged = _this._onSelfTransformChanged.bind(_this);
|
|
21848
21848
|
_this._onConnectedTransformChanged = _this._onConnectedTransformChanged.bind(_this);
|
|
21849
21849
|
// @ts-ignore
|
|
@@ -21889,6 +21889,8 @@ exports.Joint = /*#__PURE__*/ function(Component) {
|
|
|
21889
21889
|
var connectedAnchor = connectedColliderInfo.anchor;
|
|
21890
21890
|
var connectedActualAnchor = connectedColliderInfo.actualAnchor;
|
|
21891
21891
|
var connectedCollider = connectedColliderInfo.collider;
|
|
21892
|
+
// @ts-ignore
|
|
21893
|
+
connectedAnchor._onValueChanged = null;
|
|
21892
21894
|
if (connectedCollider) {
|
|
21893
21895
|
var _connectedCollider_entity_transform = connectedCollider.entity.transform, connectedPos = _connectedCollider_entity_transform.worldPosition, connectedWorldScale = _connectedCollider_entity_transform.lossyWorldScale;
|
|
21894
21896
|
engineMath.Vector3.subtract(selfPos, connectedPos, Joint._tempVector3);
|
|
@@ -21898,6 +21900,16 @@ exports.Joint = /*#__PURE__*/ function(Component) {
|
|
|
21898
21900
|
engineMath.Vector3.add(selfPos, selfActualAnchor, connectedActualAnchor);
|
|
21899
21901
|
connectedAnchor.copyFrom(connectedActualAnchor);
|
|
21900
21902
|
}
|
|
21903
|
+
// @ts-ignore
|
|
21904
|
+
connectedAnchor._onValueChanged = this._handleConnectedAnchorChanged;
|
|
21905
|
+
this._updateActualAnchor(2);
|
|
21906
|
+
};
|
|
21907
|
+
_proto._handleConnectedAnchorChanged = function _handleConnectedAnchorChanged() {
|
|
21908
|
+
if (this._automaticConnectedAnchor) {
|
|
21909
|
+
console.warn("Cannot set connectedAnchor when automaticConnectedAnchor is true.");
|
|
21910
|
+
} else {
|
|
21911
|
+
this._updateActualAnchor(2);
|
|
21912
|
+
}
|
|
21901
21913
|
};
|
|
21902
21914
|
_proto._onSelfTransformChanged = function _onSelfTransformChanged(type) {
|
|
21903
21915
|
if (type & TransformModifyFlags.WorldScale) {
|
|
@@ -21977,25 +21989,12 @@ exports.Joint = /*#__PURE__*/ function(Component) {
|
|
|
21977
21989
|
* @remarks If connectedCollider is set, this anchor is relative offset, or the anchor is world position.
|
|
21978
21990
|
* The connectedAnchor is automatically calculated, if you want to set it manually, please set automaticConnectedAnchor to false
|
|
21979
21991
|
*/ function get() {
|
|
21980
|
-
|
|
21981
|
-
if (this._automaticConnectedAnchor) {
|
|
21982
|
-
//@ts-ignore
|
|
21983
|
-
connectedColliderAnchor._onValueChanged = null;
|
|
21984
|
-
this._calculateConnectedAnchor();
|
|
21985
|
-
//@ts-ignore
|
|
21986
|
-
connectedColliderAnchor._onValueChanged = this._updateConnectedActualAnchor;
|
|
21987
|
-
}
|
|
21988
|
-
return connectedColliderAnchor;
|
|
21992
|
+
return this._connectedColliderInfo.anchor;
|
|
21989
21993
|
},
|
|
21990
21994
|
set: function set(value) {
|
|
21991
|
-
if (this._automaticConnectedAnchor) {
|
|
21992
|
-
console.warn("Cannot set connectedAnchor when automaticConnectedAnchor is true.");
|
|
21993
|
-
return;
|
|
21994
|
-
}
|
|
21995
21995
|
var connectedAnchor = this._connectedColliderInfo.anchor;
|
|
21996
21996
|
if (value !== connectedAnchor) {
|
|
21997
21997
|
connectedAnchor.copyFrom(value);
|
|
21998
|
-
this._updateActualAnchor(2);
|
|
21999
21998
|
}
|
|
22000
21999
|
}
|
|
22001
22000
|
},
|
|
@@ -22116,7 +22115,7 @@ __decorate([
|
|
|
22116
22115
|
], exports.Joint.prototype, "_nativeJoint", void 0);
|
|
22117
22116
|
__decorate([
|
|
22118
22117
|
ignoreClone
|
|
22119
|
-
], exports.Joint.prototype, "
|
|
22118
|
+
], exports.Joint.prototype, "_handleConnectedAnchorChanged", null);
|
|
22120
22119
|
__decorate([
|
|
22121
22120
|
ignoreClone
|
|
22122
22121
|
], exports.Joint.prototype, "_onSelfTransformChanged", null);
|
|
@@ -22178,6 +22177,9 @@ __decorate([
|
|
|
22178
22177
|
_this = Joint.call(this, entity) || this, _this._axis = new engineMath.Vector3(1, 0, 0), _this._hingeFlags = HingeJointFlag.None, _this._useSpring = false, _this._angle = 0, _this._velocity = 0;
|
|
22179
22178
|
_this._onMotorChanged = _this._onMotorChanged.bind(_this);
|
|
22180
22179
|
_this._onLimitsChanged = _this._onLimitsChanged.bind(_this);
|
|
22180
|
+
_this._onAxisChanged = _this._onAxisChanged.bind(_this);
|
|
22181
|
+
//@ts-ignore
|
|
22182
|
+
_this._axis._onValueChanged = _this._onAxisChanged;
|
|
22181
22183
|
return _this;
|
|
22182
22184
|
}
|
|
22183
22185
|
var _proto = HingeJoint.prototype;
|
|
@@ -22226,20 +22228,27 @@ __decorate([
|
|
|
22226
22228
|
}
|
|
22227
22229
|
}
|
|
22228
22230
|
};
|
|
22231
|
+
_proto._onAxisChanged = function _onAxisChanged() {
|
|
22232
|
+
var _this__nativeJoint;
|
|
22233
|
+
//@ts-ignore
|
|
22234
|
+
this._axis._onValueChanged = null;
|
|
22235
|
+
this._axis.normalize();
|
|
22236
|
+
(_this__nativeJoint = this._nativeJoint) == null ? void 0 : _this__nativeJoint.setAxis(this._axis);
|
|
22237
|
+
//@ts-ignore
|
|
22238
|
+
this._axis._onValueChanged = this._onAxisChanged;
|
|
22239
|
+
};
|
|
22229
22240
|
_create_class(HingeJoint, [
|
|
22230
22241
|
{
|
|
22231
22242
|
key: "axis",
|
|
22232
22243
|
get: /**
|
|
22233
|
-
* The
|
|
22244
|
+
* The Direction of the axis around which the hingeJoint.
|
|
22234
22245
|
*/ function get() {
|
|
22235
22246
|
return this._axis;
|
|
22236
22247
|
},
|
|
22237
22248
|
set: function set(value) {
|
|
22238
22249
|
var axis = this._axis;
|
|
22239
22250
|
if (value !== axis) {
|
|
22240
|
-
var _this__nativeJoint;
|
|
22241
22251
|
axis.copyFrom(value);
|
|
22242
|
-
(_this__nativeJoint = this._nativeJoint) == null ? void 0 : _this__nativeJoint.setAxis(axis);
|
|
22243
22252
|
}
|
|
22244
22253
|
}
|
|
22245
22254
|
},
|
|
@@ -22363,6 +22372,9 @@ __decorate([
|
|
|
22363
22372
|
__decorate([
|
|
22364
22373
|
ignoreClone
|
|
22365
22374
|
], HingeJoint.prototype, "_onLimitsChanged", null);
|
|
22375
|
+
__decorate([
|
|
22376
|
+
ignoreClone
|
|
22377
|
+
], HingeJoint.prototype, "_onAxisChanged", null);
|
|
22366
22378
|
|
|
22367
22379
|
/**
|
|
22368
22380
|
* A joint that maintains an upper or lower bound (or both) on the distance between two points on different objects.
|