a3js 0.0.43 → 0.0.44

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/a3js.es.js CHANGED
@@ -743,9 +743,9 @@ class hi {
743
743
  }), this.body.setTranslation(this.transform.loc, !0), this.body.setRotation(this.transform.quat, !0));
744
744
  }
745
745
  removeOneselfFromPhysics(e) {
746
- this.body && e.world.removeRigidBody(this.body), this.colliders.forEach((t) => {
747
- e.world.removeCollider(t, !1), ft.delete(t.handle);
748
- });
746
+ this.colliders.forEach((t) => {
747
+ e.world.removeCollider(t, !0), ft.delete(t.handle);
748
+ }), this.body && e.world.removeRigidBody(this.body);
749
749
  }
750
750
  // ここはなんとかできそうな気もするけど、とりあえず。
751
751
  isGrounded() {
@@ -1034,7 +1034,7 @@ class ks {
1034
1034
  this.tmpV1.set(e), this.tmpV1.add(this.capsuleCenter), this.nextLocation.set(this.tmpV1);
1035
1035
  }
1036
1036
  setPositionNow(e) {
1037
- this.tmpV1.set(e), this.tmpV1.add(this.capsuleCenter), e = this.tmpV1, this.collider && this.collider.setTranslation(e), this.transform.loc.set(e), this.nextLocation.set(e);
1037
+ this.tmpV1.set(e), this.tmpV1.add(this.capsuleCenter), this.collider && this.collider.setTranslation(this.tmpV1), this.transform.loc.set(e), this.nextLocation.set(this.tmpV1);
1038
1038
  }
1039
1039
  setQuat(e) {
1040
1040
  this.collider && this.collider.setRotation(e), this.transform.quat.set(e);
@@ -1099,7 +1099,6 @@ class xs {
1099
1099
  bodyDesc;
1100
1100
  body;
1101
1101
  capsuleCenter;
1102
- nextLocation;
1103
1102
  tmpV1;
1104
1103
  tmpV2;
1105
1104
  tmpQ1;
@@ -1108,7 +1107,7 @@ class xs {
1108
1107
  this.completeOptions = {
1109
1108
  ...Ss,
1110
1109
  ...e
1111
- }, this.transform = new Ve(), this.capsuleCenter = new ae(), this.nextLocation = new ae(), this.tmpV1 = new ae(), this.tmpV2 = new ae(), this.tmpQ1 = new Pe();
1110
+ }, this.transform = new Ve(), this.capsuleCenter = new ae(), this.tmpV1 = new ae(), this.tmpV2 = new ae(), this.tmpQ1 = new Pe();
1112
1111
  }
1113
1112
  init(e, t) {
1114
1113
  if (this.transform.set(e), this.completeOptions.auto) {
@@ -1130,13 +1129,12 @@ class xs {
1130
1129
  this.physicsWorld = e, this.bodyDesc && (this.body = e.world.createRigidBody(this.bodyDesc), this.body.setEnabledRotations(!1, !1, !1, !0), this.body.setTranslation(this.transform.loc, !0), this.body.setRotation(this.transform.quat, !0)), this.colliderDesc && (this.collider = e.world.createCollider(this.colliderDesc, this.body)), this.collider && this.objectA3 && ft.set(this.collider.handle, this.objectA3);
1131
1130
  }
1132
1131
  removeOneselfFromPhysics(e) {
1133
- this.body && e.world.removeRigidBody(this.body), this.collider && (e.world.removeCollider(this.collider, !1), ft.delete(this.collider.handle)), this.physicsWorld = void 0;
1132
+ this.collider && (e.world.removeCollider(this.collider, !0), ft.delete(this.collider.handle)), this.body && e.world.removeRigidBody(this.body), this.physicsWorld = void 0;
1134
1133
  }
1135
1134
  setPosition(e) {
1136
- this.tmpV1.set(e), this.tmpV1.add(this.capsuleCenter), this.nextLocation.set(this.tmpV1);
1137
1135
  }
1138
1136
  setPositionNow(e) {
1139
- this.tmpV1.set(e), this.tmpV1.add(this.capsuleCenter), e = this.tmpV1, this.body ? this.body.setTranslation(e, !0) : this.bodyDesc?.setTranslation(e.x, e.y, e.z), this.transform.loc.set(e), this.nextLocation.set(e);
1137
+ this.tmpV1.set(e), this.tmpV1.add(this.capsuleCenter), this.body ? this.body.setTranslation(this.tmpV1, !0) : this.bodyDesc?.setTranslation(this.tmpV1.x, this.tmpV1.y, this.tmpV1.z), this.transform.loc.set(e);
1140
1138
  }
1141
1139
  setQuat(e) {
1142
1140
  this.body ? this.body.setRotation(e, !0) : this.bodyDesc?.setRotation(e), this.transform.quat.set(e);
@@ -13481,7 +13479,7 @@ class _A {
13481
13479
  }
13482
13480
  }
13483
13481
  removeOneselfFromPhysics(e) {
13484
- this.chassisBody && e.world.removeRigidBody(this.chassisBody), this.chassisCollider && (e.world.removeCollider(this.chassisCollider, !1), ft.delete(this.chassisCollider.handle));
13482
+ this.chassisCollider && (e.world.removeCollider(this.chassisCollider, !1), ft.delete(this.chassisCollider.handle)), this.chassisBody && e.world.removeRigidBody(this.chassisBody);
13485
13483
  }
13486
13484
  setPosition(e) {
13487
13485
  }