Skip to content

Commit

Permalink
Fixed collision positions (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusLongmuir authored Sep 18, 2023
1 parent 8341fa4 commit 826408f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ export class CollisionsManager {
// and the triangle
if (realDistance < capsuleRadius) {
if (!collisionPosition) {
collisionPosition = new Vector3().copy(closestPointOnSegment);
collisionPosition = new Vector3()
.copy(closestPointOnSegment)
.applyMatrix4(meshState.matrix);
}
// Calculate the ratio between the real distance and the mesh-space distance
const ratio = realDistance / modelReferenceDistance;
Expand Down

0 comments on commit 826408f

Please sign in to comment.