fluid-cube-add-velocity   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/external/fluid2d.xtm

Implementation

(bind-func fluid-cube-add-velocity
  (lambda (cube:fluidcube* x y amount-x:double amount-y:double)
    (let ((N (tref cube 0))
    (idx (+ x (* y N)))
    (_Vx (tref cube 6))
    (_Vy (tref cube 7)))
      (pset! _Vx idx (+ amount-x (pref _Vx idx)))
      (pset! _Vy idx (+ amount-y (pref _Vy idx)))
      cube)))


Back to Index

Similar Entries