@galacean/engine 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/browser.js CHANGED
@@ -26622,9 +26622,9 @@
26622
26622
  _this = Component.call(this, entity) || this, _this._colliderInfo = new JointColliderInfo(), _this._connectedColliderInfo = new JointColliderInfo(), _this._force = Infinity, _this._torque = Infinity, _this._automaticConnectedAnchor = true;
26623
26623
  //@ts-ignore
26624
26624
  _this._colliderInfo.anchor._onValueChanged = _this._updateActualAnchor.bind(_this, 1);
26625
- _this._updateConnectedActualAnchor = _this._updateActualAnchor.bind(_this, 2);
26625
+ _this._handleConnectedAnchorChanged = _this._handleConnectedAnchorChanged.bind(_this);
26626
26626
  //@ts-ignore
26627
- _this._connectedColliderInfo.anchor._onValueChanged = _this._updateConnectedActualAnchor;
26627
+ _this._connectedColliderInfo.anchor._onValueChanged = _this._handleConnectedAnchorChanged.bind(_this);
26628
26628
  _this._onSelfTransformChanged = _this._onSelfTransformChanged.bind(_this);
26629
26629
  _this._onConnectedTransformChanged = _this._onConnectedTransformChanged.bind(_this);
26630
26630
  // @ts-ignore
@@ -26670,6 +26670,8 @@
26670
26670
  var connectedAnchor = connectedColliderInfo.anchor;
26671
26671
  var connectedActualAnchor = connectedColliderInfo.actualAnchor;
26672
26672
  var connectedCollider = connectedColliderInfo.collider;
26673
+ // @ts-ignore
26674
+ connectedAnchor._onValueChanged = null;
26673
26675
  if (connectedCollider) {
26674
26676
  var _connectedCollider_entity_transform = connectedCollider.entity.transform, connectedPos = _connectedCollider_entity_transform.worldPosition, connectedWorldScale = _connectedCollider_entity_transform.lossyWorldScale;
26675
26677
  Vector3.subtract(selfPos, connectedPos, Joint._tempVector3);
@@ -26679,6 +26681,16 @@
26679
26681
  Vector3.add(selfPos, selfActualAnchor, connectedActualAnchor);
26680
26682
  connectedAnchor.copyFrom(connectedActualAnchor);
26681
26683
  }
26684
+ // @ts-ignore
26685
+ connectedAnchor._onValueChanged = this._handleConnectedAnchorChanged;
26686
+ this._updateActualAnchor(2);
26687
+ };
26688
+ _proto._handleConnectedAnchorChanged = function _handleConnectedAnchorChanged() {
26689
+ if (this._automaticConnectedAnchor) {
26690
+ console.warn("Cannot set connectedAnchor when automaticConnectedAnchor is true.");
26691
+ } else {
26692
+ this._updateActualAnchor(2);
26693
+ }
26682
26694
  };
26683
26695
  _proto._onSelfTransformChanged = function _onSelfTransformChanged(type) {
26684
26696
  if (type & TransformModifyFlags.WorldScale) {
@@ -26758,25 +26770,12 @@
26758
26770
  * @remarks If connectedCollider is set, this anchor is relative offset, or the anchor is world position.
26759
26771
  * The connectedAnchor is automatically calculated, if you want to set it manually, please set automaticConnectedAnchor to false
26760
26772
  */ function get() {
26761
- var connectedColliderAnchor = this._connectedColliderInfo.anchor;
26762
- if (this._automaticConnectedAnchor) {
26763
- //@ts-ignore
26764
- connectedColliderAnchor._onValueChanged = null;
26765
- this._calculateConnectedAnchor();
26766
- //@ts-ignore
26767
- connectedColliderAnchor._onValueChanged = this._updateConnectedActualAnchor;
26768
- }
26769
- return connectedColliderAnchor;
26773
+ return this._connectedColliderInfo.anchor;
26770
26774
  },
26771
26775
  set: function set(value) {
26772
- if (this._automaticConnectedAnchor) {
26773
- console.warn("Cannot set connectedAnchor when automaticConnectedAnchor is true.");
26774
- return;
26775
- }
26776
26776
  var connectedAnchor = this._connectedColliderInfo.anchor;
26777
26777
  if (value !== connectedAnchor) {
26778
26778
  connectedAnchor.copyFrom(value);
26779
- this._updateActualAnchor(2);
26780
26779
  }
26781
26780
  }
26782
26781
  },
@@ -26897,7 +26896,7 @@
26897
26896
  ], exports.Joint.prototype, "_nativeJoint", void 0);
26898
26897
  __decorate$1([
26899
26898
  ignoreClone
26900
- ], exports.Joint.prototype, "_updateConnectedActualAnchor", void 0);
26899
+ ], exports.Joint.prototype, "_handleConnectedAnchorChanged", null);
26901
26900
  __decorate$1([
26902
26901
  ignoreClone
26903
26902
  ], exports.Joint.prototype, "_onSelfTransformChanged", null);
@@ -26956,6 +26955,9 @@
26956
26955
  _this = Joint.call(this, entity) || this, _this._axis = new Vector3(1, 0, 0), _this._hingeFlags = HingeJointFlag.None, _this._useSpring = false, _this._angle = 0, _this._velocity = 0;
26957
26956
  _this._onMotorChanged = _this._onMotorChanged.bind(_this);
26958
26957
  _this._onLimitsChanged = _this._onLimitsChanged.bind(_this);
26958
+ _this._onAxisChanged = _this._onAxisChanged.bind(_this);
26959
+ //@ts-ignore
26960
+ _this._axis._onValueChanged = _this._onAxisChanged;
26959
26961
  return _this;
26960
26962
  }
26961
26963
  var _proto = HingeJoint.prototype;
@@ -27004,20 +27006,27 @@
27004
27006
  }
27005
27007
  }
27006
27008
  };
27009
+ _proto._onAxisChanged = function _onAxisChanged() {
27010
+ var _this__nativeJoint;
27011
+ //@ts-ignore
27012
+ this._axis._onValueChanged = null;
27013
+ this._axis.normalize();
27014
+ (_this__nativeJoint = this._nativeJoint) == null ? void 0 : _this__nativeJoint.setAxis(this._axis);
27015
+ //@ts-ignore
27016
+ this._axis._onValueChanged = this._onAxisChanged;
27017
+ };
27007
27018
  _create_class$2(HingeJoint, [
27008
27019
  {
27009
27020
  key: "axis",
27010
27021
  get: /**
27011
- * The anchor rotation.
27022
+ * The Direction of the axis around which the hingeJoint.
27012
27023
  */ function get() {
27013
27024
  return this._axis;
27014
27025
  },
27015
27026
  set: function set(value) {
27016
27027
  var axis = this._axis;
27017
27028
  if (value !== axis) {
27018
- var _this__nativeJoint;
27019
27029
  axis.copyFrom(value);
27020
- (_this__nativeJoint = this._nativeJoint) == null ? void 0 : _this__nativeJoint.setAxis(axis);
27021
27030
  }
27022
27031
  }
27023
27032
  },
@@ -27141,6 +27150,9 @@
27141
27150
  __decorate$1([
27142
27151
  ignoreClone
27143
27152
  ], HingeJoint.prototype, "_onLimitsChanged", null);
27153
+ __decorate$1([
27154
+ ignoreClone
27155
+ ], HingeJoint.prototype, "_onAxisChanged", null);
27144
27156
  /**
27145
27157
  * A joint that maintains an upper or lower bound (or both) on the distance between two points on different objects.
27146
27158
  */ var SpringJoint = /*#__PURE__*/ function(Joint) {
@@ -49957,7 +49969,7 @@
49957
49969
  ], EXT_texture_webp);
49958
49970
 
49959
49971
  //@ts-ignore
49960
- var version = "1.4.0";
49972
+ var version = "1.4.1";
49961
49973
  console.log("Galacean engine version: " + version);
49962
49974
  for(var key in CoreObjects){
49963
49975
  Loader.registerClass(key, CoreObjects[key]);