🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
basic physic question
If you would grab the wall (read: stop the wall) the ball would go further 30 m/s.
An advice, you will (i think) never simulate a real world physics like this, try to go for aproxximatly things.
Imagine the perfect material would have a rebound of 1 and other materials would be less, rubber is 0.9 and steel is 0.1, then you would make speed before=speed after * contant
this would be aproxamitly and without gravity or air resistance.
Stay well.
bye
------------------
Bruno Sousa aka Akura
Founder and programmer - Magick.pt
magick_pt@geocities.com
http://magickpt.cjb.net
[This message has been edited by Akura (edited September 29, 1999).]
If you have only a wall and a ball in this world then the speed the ball hits the wall is the magnitude of the two motion vectors added together. That of the wall and the ball.
Ignoring the y and x vectors, imagine the ball is heading towards the wall with an x vector of 10m/s i.e straight down the positive x plane. If the wall is motionless it has an x velocity of 0m/s so
10m/s - 0m/s = 10 m/s
If it was moving towards the ball at 30 m/s it would be
10m/s - (-30m/s) = 40 m/s
it's - (-30) because the wall is moving in the negative x plane i.e. towards the ball.
If the wall was moving in the same direction as the ball but at 4 m/s then it would be
10 m/s - 4 m/s = 6 m/s
If this sounds too complex, talking in terms of vectors, then say so and I'll get simpler.
Hope this helps.
Mike, you only one who know physics here
![](http://www.gamedev.net/community/forums/ubb/wink.gif)
If the wall (wall has infinity mass) moves with speed of 30 and ball with speed of 10, then resulting speed will be 40.
The more complex way will be if wall is affected by this collision (will loose some amount of it's speed). If you interested, i can explain that way.
------------------
FlyFire/CodeX
http://codexorg.webjump.com
v(wall before collision)*m(wall) + v(ball before collision) * m(ball) = v(wall after collision)*m(wall) + v(ball after collision) * m(ball)
The only problem with this equation is that it ignores about everything (gravity,air resistance and material) but it should work.
but even so i would sugest using this formula but use the constant i said before about the material so you could get a more "cool" effect (if your using in your game a soccer ball and an iron ball and are sent at the same speed to a wall and bounce back the same the player will be disapointed even so that constant is not accuratly real it adds a more realistic aproach
(that what i tried to explain & i din't used physics )
------------------
Bruno Sousa aka Akura
Founder and programmer - Magick.pt
magick_pt@geocities.com
http://magickpt.cjb.net
Under ideal condition its would rebound at the same 10 m/s,right?
But how fast does he rebound if the wall
move with 30 m/s in his direction(left2right)? 30+10 or just 30 or what?
Please answer
Thanx