@series-inc/rundot-3d-engine 0.5.13 → 0.5.14
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.
|
@@ -4675,19 +4675,7 @@ var RigidBodyComponentThree = class _RigidBodyComponentThree extends Component {
|
|
|
4675
4675
|
}
|
|
4676
4676
|
this.gameObject.updateMatrixWorld(true);
|
|
4677
4677
|
const pos = this.gameObject.getWorldPosition(new THREE10.Vector3());
|
|
4678
|
-
|
|
4679
|
-
if (this.options.centerOffset) {
|
|
4680
|
-
offset.copy(this.options.centerOffset);
|
|
4681
|
-
} else {
|
|
4682
|
-
if (this.options.shape === "box" /* BOX */) {
|
|
4683
|
-
offset.y = this.options.size.y / 2;
|
|
4684
|
-
} else if (this.options.shape === "capsule" /* CAPSULE */) {
|
|
4685
|
-
offset.y = this.options.height / 2;
|
|
4686
|
-
} else if (this.options.shape === "sphere" /* SPHERE */) {
|
|
4687
|
-
offset.y = this.options.radius;
|
|
4688
|
-
}
|
|
4689
|
-
}
|
|
4690
|
-
bodyDesc.setTranslation(pos.x + offset.x, pos.y + offset.y, pos.z + offset.z);
|
|
4678
|
+
bodyDesc.setTranslation(pos.x, pos.y, pos.z);
|
|
4691
4679
|
const worldQuat = this.gameObject.getWorldQuaternion(new THREE10.Quaternion());
|
|
4692
4680
|
bodyDesc.setRotation({
|
|
4693
4681
|
x: worldQuat.x,
|
|
@@ -4735,6 +4723,19 @@ var RigidBodyComponentThree = class _RigidBodyComponentThree extends Component {
|
|
|
4735
4723
|
colliderDesc = ColliderDesc2.cuboid(size.x / 2, size.y / 2, size.z / 2);
|
|
4736
4724
|
break;
|
|
4737
4725
|
}
|
|
4726
|
+
const colliderOffset = new THREE10.Vector3(0, 0, 0);
|
|
4727
|
+
if (this.options.centerOffset) {
|
|
4728
|
+
colliderOffset.copy(this.options.centerOffset);
|
|
4729
|
+
} else {
|
|
4730
|
+
if (this.options.shape === "box" /* BOX */) {
|
|
4731
|
+
colliderOffset.y = this.options.size.y / 2;
|
|
4732
|
+
} else if (this.options.shape === "capsule" /* CAPSULE */) {
|
|
4733
|
+
colliderOffset.y = this.options.height / 2;
|
|
4734
|
+
} else if (this.options.shape === "sphere" /* SPHERE */) {
|
|
4735
|
+
colliderOffset.y = this.options.radius;
|
|
4736
|
+
}
|
|
4737
|
+
}
|
|
4738
|
+
colliderDesc.setTranslation(colliderOffset.x, colliderOffset.y, colliderOffset.z);
|
|
4738
4739
|
colliderDesc.setRestitution(this.options.restitution);
|
|
4739
4740
|
colliderDesc.setFriction(this.options.friction);
|
|
4740
4741
|
colliderDesc.setSensor(this.options.isSensor);
|
|
@@ -4797,40 +4798,14 @@ var RigidBodyComponentThree = class _RigidBodyComponentThree extends Component {
|
|
|
4797
4798
|
}
|
|
4798
4799
|
const lerpPos = new THREE10.Vector3(curPos.x, curPos.y, curPos.z).lerp(nextPos, alpha);
|
|
4799
4800
|
const slerpQuat = curQuat.clone().slerp(nextQuat, alpha);
|
|
4800
|
-
if (this.options.centerOffset) {
|
|
4801
|
-
lerpPos.sub(this.options.centerOffset);
|
|
4802
|
-
} else {
|
|
4803
|
-
let defaultYOffset = 0;
|
|
4804
|
-
if (this.options.shape === "box" /* BOX */) {
|
|
4805
|
-
defaultYOffset = this.options.size.y / 2;
|
|
4806
|
-
} else if (this.options.shape === "capsule" /* CAPSULE */) {
|
|
4807
|
-
defaultYOffset = this.options.height / 2;
|
|
4808
|
-
} else if (this.options.shape === "sphere" /* SPHERE */) {
|
|
4809
|
-
defaultYOffset = this.options.radius;
|
|
4810
|
-
}
|
|
4811
|
-
lerpPos.y -= defaultYOffset;
|
|
4812
|
-
}
|
|
4813
4801
|
this.gameObject.position.copy(lerpPos);
|
|
4814
4802
|
this.gameObject.quaternion.copy(slerpQuat);
|
|
4815
4803
|
} else if (this.options.type === "kinematic" /* KINEMATIC */) {
|
|
4816
4804
|
this.gameObject.updateMatrixWorld(true);
|
|
4817
4805
|
const worldPos = this.gameObject.getWorldPosition(_RigidBodyComponentThree._tempVec3);
|
|
4818
4806
|
const worldQuat = this.gameObject.getWorldQuaternion(_RigidBodyComponentThree._tempQuat);
|
|
4819
|
-
const offset = new THREE10.Vector3(0, 0, 0);
|
|
4820
|
-
if (this.options.centerOffset) {
|
|
4821
|
-
offset.copy(this.options.centerOffset);
|
|
4822
|
-
} else {
|
|
4823
|
-
if (this.options.shape === "capsule" /* CAPSULE */ || this.options.shape === "box" /* BOX */) {
|
|
4824
|
-
const height = this.options.height || this.options.size?.y || 3;
|
|
4825
|
-
offset.y = height / 2;
|
|
4826
|
-
}
|
|
4827
|
-
}
|
|
4828
4807
|
this.rigidBody.setTranslation(
|
|
4829
|
-
{
|
|
4830
|
-
x: worldPos.x + offset.x,
|
|
4831
|
-
y: worldPos.y + offset.y,
|
|
4832
|
-
z: worldPos.z + offset.z
|
|
4833
|
-
},
|
|
4808
|
+
{ x: worldPos.x, y: worldPos.y, z: worldPos.z },
|
|
4834
4809
|
true
|
|
4835
4810
|
);
|
|
4836
4811
|
this.rigidBody.setRotation(
|
|
@@ -6135,4 +6110,4 @@ export {
|
|
|
6135
6110
|
PrefabLoader,
|
|
6136
6111
|
StowKitSystem
|
|
6137
6112
|
};
|
|
6138
|
-
//# sourceMappingURL=chunk-
|
|
6113
|
+
//# sourceMappingURL=chunk-F7S64ACG.js.map
|