(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)))
;(printf "idx: %d:%d:%d:%d\n" idx N x y)
(pset! density_ptr idx (+ density amount))
(+ density amount))))