Advertisement
Pridexs

E2 - PontoA - B

Sep 13th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. @name
  2. @inputs X1 X2 Y1 Y2 Z1 Z2
  3. @inputs XO YO ZO DistA DistB
  4. @outputs  D:vector Mul P:vector
  5. @persist Time XF YF ZF IsAtPointA IsAtPointB
  6. @trigger all
  7.  
  8. D=vec(XF,YF,ZF)
  9. Mul=2000
  10.  
  11.  
  12. if (DistB < 200) {
  13.     IsAtPointB = 1
  14.     IsAtPointA = 0
  15. }
  16.  
  17. if (DistA < 200) {
  18.     IsAtPointB = 0
  19.     IsAtPointA = 1
  20. }
  21.  
  22. function irPontoA() {
  23.  
  24.    
  25.     XF = XO - X1
  26.     YF = YO - Y1
  27.     ZF = ZO - Z1
  28.  
  29. }
  30.  
  31. function irPontoB() {
  32.     XF = XO - X2
  33.     YF = YO - Y2
  34.     ZF = ZO - Z2
  35.    
  36.    
  37.  
  38. }
  39.  
  40. if (IsAtPointB == 1) {
  41.     irPontoA()
  42. }
  43. if (IsAtPointA == 1) {
  44.     irPontoB()
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement