fluid-cube-add-density   xtlang


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

Implementation

(bind-func fluid-cube-add-density
  (lambda (cube:fluidcube* x y amount:double)
    (let ((N (tref cube 0))
    (idx (+ x (* y N)))
    (density-ptr:double* (tref cube 5))
    (density (pref density-ptr idx)))
      (pset! density-ptr idx (+ density amount))
      (+ density amount))))


Back to Index

Similar Entries