Update FX.cpp
Still 1 bug to fix - this was a test.
This commit is contained in:
parent
9cee424383
commit
341d9d1697
@ -2650,7 +2650,7 @@ uint16_t WS2812FX::mode_balltrack(void) {
|
|||||||
balls[i].velocity*float(balls[j].lastBounceUpdate-balls[i].lastBounceUpdate))/
|
balls[i].velocity*float(balls[j].lastBounceUpdate-balls[i].lastBounceUpdate))/
|
||||||
(balls[j].velocity-balls[i].velocity);
|
(balls[j].velocity-balls[i].velocity);
|
||||||
|
|
||||||
if( (tcollided>2)&&(tcollided<float(time-balls[j].lastBounceUpdate))){
|
if( (tcollided>2)&&(tcollided<float(time-balls[j].lastBounceUpdate))){ // 2ms minimum to avoid duplicate bounces
|
||||||
balls[i].height=balls[i].height + balls[i].velocity*(tcollided+float(balls[j].lastBounceUpdate-balls[i].lastBounceUpdate))/cfac;
|
balls[i].height=balls[i].height + balls[i].velocity*(tcollided+float(balls[j].lastBounceUpdate-balls[i].lastBounceUpdate))/cfac;
|
||||||
balls[j].height=balls[i].height;
|
balls[j].height=balls[i].height;
|
||||||
balls[i].lastBounceUpdate=(unsigned long)(tcollided+.5)+balls[j].lastBounceUpdate;
|
balls[i].lastBounceUpdate=(unsigned long)(tcollided+.5)+balls[j].lastBounceUpdate;
|
||||||
|
Loading…
Reference in New Issue
Block a user