User Tag List

Results 1 to 3 of 3

Thread: Elasticity?

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export Module
    ChrisBurrows's Avatar
    Join Date
    May 2011
    Location
    Tasmania, Australia
    Posts
    622
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Elasticity?

    This is more of a physics question...

    If, for example, a ball (in free fall) with 80% elasticity hits the ground, is it that velocity is multiplied by -0.8 or that peak of that the next bounce will be 80% the height of the previous peak?

  2. #2
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,544
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Its how I do the elasticity in my engine- when a physical collides with a surface, invert its vertical (relative) vector, multiplying it by that coefficient.
    If the vector is -0.8x the vector of the collision, then yes, the height of the parabolic arc of the bounce should hit 80% of the previous height- it is directly proportional, not a square root or anything like that
    Until, of course, you start accounting for air resistance and fluid dynamics and cool stuff like that, as the resistance is proportional to the velocity squared, so you'd see that logarithmic decay

    But you'll also experience some rounding errors due to the instantaneous velocity of collisions, since you can expect that if the ball is detecting collisions per frame rather than calculating the exact moment of collision mathematically, your ball might act as if it had penetrated through the ground, and depending on how you code it, might have slightly more or slightly less than the velocity it would have had at the surface- particularly if you use an a priori collision detection to bounce it before it was overlapping

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export Module
    ChrisBurrows's Avatar
    Join Date
    May 2011
    Location
    Tasmania, Australia
    Posts
    622
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Thanks Pixeltheif for a very speed and detailed response! Currently, when the "ball" hits the ground, I am inverting the Y velocity and multiplied it by the elasticity... but, if a ball (0.8 elasticity) is dropped from height 100, the height of the next bounce is not 80. However, the Y velocity, when it hit's the ground the next time, is 80% that of the previous.

    I've been having problems too with the rounding errors you mentioned. My work-around is to continue the balls movement when it is under ground inside a fastloop, and then stop the fast loop once the ball has returned to the surface. This works fine and produces accurate results... except the ball has a large X velocity, in which case when it returns to the surface, the ball is not at the same point when it left.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •