Skip to content

Commit 3929842

Browse files
committed
change utilitiesMPR.jl
1 parent 7b000f2 commit 3929842

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/contactDetection/ContactDetectionMPR/utilitiesMPR.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ end
120120
- r4: Point on line r1 + lambda*r21 that is closest to the origin with 0<=lambda<=1, or r4_old, if it is closer.
121121
- d4: Signed distance of r4 to the origin or d4_old if abs(d4_old) < norm(r1 + lambda*r21)
122122
"""
123-
function signedDistanceToLineSegmentWithR4(r1::SVector{3,Float64}, r2::SVector{3,Float64},
124-
r21::SVector{3,Float64}, e::SVector{3,Float64},
125-
r4_old::SVector{3,Float64}, d4_old::Float64=0.0)
123+
function signedDistanceToLineSegmentWithR4(r1::SVector{3,T}, r2::SVector{3,T},
124+
r21::SVector{3,T}, e::SVector{3,T},
125+
r4_old::SVector{3,T}, d4_old::T=T(0.0)) where {T}
126126
# r = r1 + lambda*r21 (0 <= lambda <= 1)
127127
#
128128
# The closest point to the line is point r4, such that r21*r4 = 0
@@ -146,8 +146,8 @@ end
146146
- r4: Point on line r1 + lambda*r21 that is closest to the origin with 0<=lambda<=1.
147147
- d4: Signed distance of r4 to the origin
148148
"""
149-
function signedDistanceToLineSegment(r1::SVector{3,Float64}, r2::SVector{3,Float64},
150-
r21::SVector{3,Float64}, e::SVector{3,Float64})
149+
function signedDistanceToLineSegment(r1::SVector{3,T}, r2::SVector{3,T},
150+
r21::SVector{3,T}, e::SVector{3,T}) where {T}
151151
# r = r1 + lambda*r21 (0 <= lambda <= 1)
152152
#
153153
# The closest point to the line is point r4, such that r21*r4 = 0
@@ -168,8 +168,8 @@ end
168168
- r4: Point on triangle portal r1, r2, r3 that is closest to the origin.
169169
- d : Signed distance of r4 to the origin: d > 0: origin is outside of tetrahedron r0,r1,r2,r3, otherwise inside.
170170
"""
171-
function signedDistanceToPortal(r0::SVector{3,Float64}, r1::SVector{3,Float64},
172-
r2::SVector{3,Float64}, r3::SVector{3,Float64})
171+
function signedDistanceToPortal(r0::SVector{3,T}, r1::SVector{3,T},
172+
r2::SVector{3,T}, r3::SVector{3,T}) where {T}
173173
# Determine unit normal on portal
174174
r21 = r2 - r1
175175
r31 = r3 - r1

0 commit comments

Comments
 (0)