AcceleratedParticle acceleration change #1510
-
In the AcceleratedParticle, the acceleration is final, which means, that it cannot be changed during the particle lifetime. I am trying to make AcceleratedParticle to be able to respond to acceleration changes when the phone's orientation is changed. For instance, particle are slowly falling towards the ground. Then the phone is rotated and the ground is not where it used to be at the particle creation time. In that case, the acceleration should change. Is there a chance final status of acceleration could be considered, or should I make my own AcceleratedParticle class? What other options do I have? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
That it is particle.acceleration.setValues(10.0, 10.0); (Not sure why that one is |
Beta Was this translation helpful? Give feedback.
-
Thanks. This detail that fields can be changed in a final object somehow slipped my attention. Now, I learned something new. |
Beta Was this translation helpful? Give feedback.
That it is
final
just means that it can't be set to a new reference, you can still change the values of theVector2
. Example:(Not sure why that one is
final
, but notspeed
andposition
)