Simple Physics

BlitzMax Forums/BlitzMax Beginners Area/Simple Physics

Eric(Posted 2006) [#1]
I have a Square in the middle of my screen.

I shoot bullets at it from various locations. What I am trying to figure out is what torque is the missle applying on the square so I can rotate it in that direction.

Does this make sense? If so any help would be really appreciated.

Regards,
Eric


Dreamora(Posted 2006) [#2]
Impulse = mass * speed

On impact this means:

mass_bullet * speed_bullet_before = mass_bullet * speed_bullet_after + mass_square * speed_square_after

=> speed_square_after = mass_bullet / (mass_bullet + mass_square) * speed_bullet_before


Eric(Posted 2006) [#3]
Thanks for the help unfortunately it does not give me rotational information. Should the square rotate left or right depending on the missle impact.


Dreamora(Posted 2006) [#4]
Thats impulse as well.
But thats rotational impulse and not nearly that easy.
This needs vector projection and the like.

Because of that, I would suggest that you visit a page that is describing such topics (think wiki has a good one on that as well as it is basic physics)


splinux(Posted 2006) [#5]
You need the torque value (rotation force, http://en.wikipedia.org/wiki/Torque)


bradford6(Posted 2006) [#6]
Eric,
Physics like what you are describing is very math intensive. to start you need to be able to ascertain the exact point of impact and calculate a normal vector (perpendicular to the surface of impact) and transfer the energy from the projectile into a rotational velocity (torque)

sounds like fun. I will start work on it tonight :)


Eric(Posted 2006) [#7]
Ya know all of this Physics stuff gives me a head ache!! hahaha


Tibit(Posted 2006) [#8]
I would suggest that you use polygons to solve this problem, because with those you can easily build boxes, and with polygons and line collision you get both the point of impact and the normal of the side that was hit. With this information at hand you can take the next step and apply torque, which is turning momentum, which in turn makes the box spin.

Dreamora, is impact the same as momentum?

Here is an article I wrote about Basic Vectors and Physics. It does not adress torque, but it is a good start for anyone who wants to know more about physics, simple and aimed for beginners.


Dreamora(Posted 2006) [#9]
with impact I mean the moment they touch each other where the impulse is transfered / split between them ... :-)


Eric(Posted 2006) [#10]
Wave,

Nice little Article.

I've looked at the Physics community, but it's a little too confusing. I need to learn this a step at a time, kind of like your little article.

I understand physics.. Concepts anyhow, I just can't translate that into BMX code.

Regards,
Eric

I'm Editing this Post after completely reading the Article by wave.

What a great explaination of everything..For the first time I am starting to understand how to get physics into code.

Any chance you would continue writing about this topic gettting into Dot Products and Projections and all that stuff. I would be willing to donate to the cause if necessary. :)