Madwand

Stress test code

Oct 4th, 2015
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. firstpass = true
  2.  
  3. function Update(I)
  4.   if firstpass then
  5.       CoM = I:GetConstructCenterOfMass()
  6.       math.randomseed(I:GetTime()+CoM.x+CoM.y+CoM.z)
  7.       firstpass = false
  8.   end
  9.  
  10.   for i=1,10000,1 do
  11.     local V = Vector3(math.random()*10000,math.random()*10000,math.random()*10000)
  12.     local A1 = math.random()*360
  13.     local A2 = math.random()*360
  14.     local A3 = math.random()*360
  15.     local L1 = Quaternion.Euler(A1,A2,A3) * V
  16.     local L2 = Quaternion.Inverse(Quaternion.LookRotation(V))
  17.     local L3 = GetTargetInfo
  18.     local L4 = Vector3.Magnitude(V)
  19.     local L5 = Vector3.Normalize(V)
  20.     local L6 = Vector3.Distance(V, L5)
  21.     local L7 = Vector3.ClampMagnitude(V, math.random()*1000)
  22.   end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment