Skip to content

Commit

Permalink
Remove: The usage of square root were not really needed
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdvideo1234 committed Apr 10, 2024
1 parent d30bf39 commit eaeef66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lua/autorun/trackassembly_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ local asmlib = trackasmlib; if(not asmlib) then -- Module present
------------ CONFIGURE ASMLIB ------------

asmlib.InitBase("track","assembly")
asmlib.SetOpVar("TOOL_VERSION","8.758")
asmlib.SetOpVar("TOOL_VERSION","8.759")

------------ CONFIGURE GLOBAL INIT OPVARS ------------

Expand Down
6 changes: 3 additions & 3 deletions lua/trackassembly/trackasmlib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4305,7 +4305,7 @@ function IntersectRay(vO1, vD1, vO2, vD2)
local ez = GetOpVar("EPSILON_ZERO")
local d1, d2 = vD1:GetNormalized(), vD2:GetNormalized()
local dx, oo = d1:Cross(d2), (vO2 - vO1)
local dn = (dx:Length())^2; if(dn < ez) then
local dn = dx:LengthSqr(); if(dn < ez) then
LogInstance("Rays parallel"); return nil end
local f1 = DeterminantVector(oo, d2, dx) / dn
local f2 = DeterminantVector(oo, d1, dx) / dn
Expand Down Expand Up @@ -5290,8 +5290,8 @@ function IsAmongLine(vO, vS, vE)
local oS = Vector(vO); oS:Sub(vS)
local oE = Vector(vO); oE:Sub(vE)
local oR = Vector(vE); oR:Sub(vE)
local nC = oS:Cross(oR):Length()
if(mathAbs(nC) > nE) then return false end
local nC = oS:Cross(oR):LengthSqr()
if(nC > nE) then return false end
local dS, dE = oS:Dot(oR), oE:Dot(oR)
if(dS * dE > 0) then return false end
return true
Expand Down

0 comments on commit eaeef66

Please sign in to comment.