Non-additive restitution
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?
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
Oh and btw, my actor bounces through restitution, acceleration 270 degrees, and with gravity.
http://www.mediafire.com/?r8dyc1054or3ihv
I adjusted the bounce height and speed in the equation, and it works perfectly!
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).
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).
"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
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)