I’m playing around with the playground library and can’t figure something out, I think this little demo of a bouncing ball should speak for itself :
The culprit is explained at line #27, and I’m not quite sure sure how to solve registering “ceiling hits”.
I’d also like to register a change of behavior every time
x crosses zero so ideally I’m looking for a generic solution.
Another way to look at this, is that I’d like to register a change of behavior at the beginning, middle or end of the
wave function cycle.
I thought about accumulating x values to later apply a modulo operation but that seems too complicated as the initial x value is dependent on time plus I would have to track previous x values so I’m guessing I must be missing something obvious.