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

Back to Index