init-psys   xtlang


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

Implementation

;; init particle system
(bind-func init-psys
  (lambda (psys:psystem*)
    (let ((i:i32 0))
      (dotimes (i 5000)
      (psystem-set-particle psys i 0.0 0.0
                (dtof (+ 5.0 (* 50.0 (random))))
                (* 0.01 (- (dtof (random)) .5)) ; xvelocity
                (* 0.01 (- (dtof (random)) .5)) ; yvelocity
                (dtof (random))
            (dtof (random))
            (dtof (random))
            1.0 ;; (dtof (random))
            100000)))
    void))


Back to Index