fluid-cube-add-density   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/contrib/fluid_dynamics.xtm

Implementation

(bind-func fluid-cube-add-density
  (lambda (cube:fluidcube* x y z amount:double)
    (let ((N (tref cube 0))
    (idx (fluid-ix x y z 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