2017년 5월 7일 일요일

Gravity Exercise




Changes log:
2015/09/08 - bug fix -- ball could stick to canvas bottom; new version is 2
---
END of changes log
Fling anywhere on the the Canvas to see the gravity demonstration.
Try adjusting the gravity, bounciness and rolliness values to simulate different materials and bodies (earth - 1.5 vs the moon - 0.25)
How it works: 
A Clock Timer is used to update the position of a ball by applying x and y velocities and gravity.
When the ball bounces a bounciness multiplier reduces it's y velocity until it eventually stops bouncing.
When the ball rolls, a rolliness multiplier reduces it's x velocity until it eventually stops rolling.
--
Nice demo, but my ball mostly just lays there.
I may need to consult with my personal physicist.

--
Are you flinging the canvas (not the ball itself) in a upward direction?
If the ball doesn't move much, you can reduce gravity and/or increase the FlingVelocityAdjustment value to be more responsive.

If the ball sticks to the bottom of the canvas rather than bounce sometimes that (hopefully) has been corrected with a bug fix in updated version 2 which is attached here and in the Gallery.
Thanks for trying it out!

--

댓글 없음:

댓글 쓰기