@mml-io/3d-web-client-core 0.21.0 → 0.21.2
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/build/index.js +7 -1
- package/build/index.js.map +2 -2
- package/package.json +6 -6
package/build/index.js
CHANGED
@@ -5920,6 +5920,7 @@ function getRelativePositionAndRotationRelativeToObject(positionAndRotation, con
|
|
5920
5920
|
tempTargetMatrix.premultiply(tempContainerMatrix);
|
5921
5921
|
tempTargetMatrix.decompose(tempPositionVector, tempRotationQuaternion, tempScaleVector);
|
5922
5922
|
tempRotationEuler.setFromQuaternion(tempRotationQuaternion);
|
5923
|
+
tempPositionVector.multiply(container.scale);
|
5923
5924
|
return {
|
5924
5925
|
position: {
|
5925
5926
|
x: tempPositionVector.x,
|
@@ -6077,6 +6078,7 @@ var CollisionsManager = class {
|
|
6077
6078
|
meshRelativeCapsuleSegment.start
|
6078
6079
|
);
|
6079
6080
|
let collisionPosition = null;
|
6081
|
+
let currentCollisionDistance = -1;
|
6080
6082
|
meshState.meshBVH.shapecast({
|
6081
6083
|
intersectsBounds: (meshBox) => {
|
6082
6084
|
return meshBox.intersectsBox(meshRelativeCapsuleBoundingBox);
|
@@ -6097,7 +6099,11 @@ var CollisionsManager = class {
|
|
6097
6099
|
const realDistance = intersectionSegment.distance();
|
6098
6100
|
if (realDistance < capsuleRadius) {
|
6099
6101
|
if (!collisionPosition) {
|
6100
|
-
collisionPosition = new Vector316().copy(
|
6102
|
+
collisionPosition = new Vector316().copy(closestPointOnTriangle).applyMatrix4(meshState.matrix);
|
6103
|
+
currentCollisionDistance = realDistance;
|
6104
|
+
} else if (realDistance < currentCollisionDistance) {
|
6105
|
+
collisionPosition.copy(closestPointOnTriangle).applyMatrix4(meshState.matrix);
|
6106
|
+
currentCollisionDistance = realDistance;
|
6101
6107
|
}
|
6102
6108
|
const ratio = realDistance / modelReferenceDistance;
|
6103
6109
|
const realDepth = capsuleRadius - realDistance;
|