Non-additive restitution

Horizon LabsHorizon Labs Member Posts: 7
edited February 2012 in Working with GS (Mac)
Hey guys, I have a problem..
I have an actor that i want to bounce up and down.
It does that fine, but i don't want it to keep on going higher after each successful bounce.
I want the actor to bounce and reach the same height every time.
Any ideas?

Comments

  • 921creative921creative Member, PRO Posts: 140
    If you add Drag to the actor, it shouldn't increase in height as it bounces.
  • Horizon LabsHorizon Labs Member Posts: 7
    Didn't work :/ Thanks tho
    Oh and btw, my actor bounces through restitution, acceleration 270 degrees, and with gravity.
  • 921creative921creative Member, PRO Posts: 140
    Sorry. Try increasing Density. If it's heavier, it shouldn't bounce much.
  • CloudsClouds Member Posts: 1,599
    Here's an endless bounce based on half a sine wave, not sure if it is any use, but it never stops bouncing and always reaches the same height:

    http://www.mediafire.com/?r8dyc1054or3ihv
  • Horizon LabsHorizon Labs Member Posts: 7
    Thank you so much Tynan! It works!
    I adjusted the bounce height and speed in the equation, and it works perfectly!
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    @DigitalCorpze

    Glad it works for you - yeah, the parameters are pretty easy to work out.

    AAA*sin(( self.Time *BBB)%180)+CCC

    AAA = the height of the bounce.
    BBB = the speed of the bounce.
    CCC = the position of the lowest point of the bounce (the floor basically).

    P.S - You can turn gravity off to save processing power as well as switching off 'movable' on the bouncing actor (also saves processing power).
  • Horizon LabsHorizon Labs Member Posts: 7
    Last question...
    Is there any way to set the "CCC" value, or the position of the lowest point to be dynamic?
    So, if the actor bounce height is set to 100, and then it jumps onto a platform, the bounce height will remain the same(100).
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    @DigitalCorpze


    "Is there any way to set the "CCC" value, or the position of the lowest point to be dynamic?"

    Of course, simply replace CCC with an attribute, something like this.

    AAA*sin(( self.Time *BBB)%180)+game.FloorHeight

  • Horizon LabsHorizon Labs Member Posts: 7
    Don't know if ur still there...
    But i added the game.FloorHeight atribute like you said in ur last post, and i have yet again run into a problem(LOL).
    When my actor jumps onto a higher platform, the bounce height for that platform is fine, but when i want it to come back down to a lower platform... it just bounces in the "air" at the same height of the higher platform.

    So, is there any way to make it so the actor can basically climb up and down a set of stairs while bouncing and still keep all of the properties you have helped me with in the past?(like non additive bounce height, changing height of "floor" when actor jumps onto a higher platform)
Sign In or Register to comment.