Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Aph3x

Mass and velocity

This topic is 5136 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, OK, so I shoot a projectile from a moving vehicle. One would expect it to assume the velocity of the vehicle + its (direction * launchSpeed), which seems nice (and e.g. I note BF1942 uses this approach). But if I shoot a laser that conceptually has no mass, then its initial velocity should just be direction * speed. But this looks/feels horrid when implemented. Question: has anyone implemented a massy projectile system, and what system did you choose (assume vehicle velocity or not)?

Share this post


Link to post
Share on other sites
Advertisement
Lasers have an absolute velocity of 300,000 km/sec anyway, so why not just draw a line?

Either way, noone will notice if your laser has a specific mass in your implementation, so you might as well have one in there. Sorry if I misunderstood the problem.

Share this post


Link to post
Share on other sites
Hmm perhaps I should have used inverted comma's.
By laser I mean errrr... 'Energy weapon' thingy (not properly based in physics I guess).

I guess I'm just asking which system other people are using

[edited by - aph3x on May 25, 2004 12:29:51 PM]

Share this post


Link to post
Share on other sites
If you mean star wars thingy. lasers can have any mass but there is no force which can accelerate and deaccelerate them. This means we can make mass zero or dont apply any force on them. So they shouldnt be handled a physics engine but a particle system.

Share this post


Link to post
Share on other sites
If we remember Newton''s 2nd and 3rd laws here (Ignoring the laser beam for the time being, as it behaves in a non-Newtonian manner), you will realise that a projectile will have a recoil, which will accelerate the gun in the opposite direction in proportion to their ratio of masses.

Specifically, if we assume that a bullet being fired happens instanteously, I consider the "impulse" of the bullet, which is dimensionally the same as momentum and a vector quantity.

As we need to have conservation of momentum, you have to apply the equal and opposite (Newton3) impulse to the firer.

---

Now laser beams get a bit problematic:

1. They travel at the speed of light, which means according to Einstein they must have infinite times their rest mass
2. They have no rest mass

Of course we can''t multiply infinity by zero.

I don''t know how these clever people figure it out, but it has been established that light carries a finite amount of momentum (not very much, I might add)

So in principle, if you fire a laser beam, it will propel your spaceship in the opposite direction. This has in fact been suggested as a means of propulsion (not weaponry ) for spacecraft.

Mark

Share this post


Link to post
Share on other sites
markr: by shooting a laser at a small glass bead from below, you can make it levitate. And if you know the mass of the glass bead, using some formulas you can deduce the momentum of the photons from the laser. A probabilistic computation gives you the momentum of an individual photon (within reasonable bounds).

Aph3x: people include physics in game to make those games feel right. If a particular aspect of physics makes an effect in the game feel wrong, then that aspect is pointless from a game development standpoint, and should by all means be ignored. So simply consider (in your head and in the implementation) it's not a laser beam made of photons, but rather a needle of red-hot metal being shot, and do your computations based on this. Then, you can still call it a laser if it fits your story.

EDIT: how I did it, in my game: (click for a picture)

- Laser beams are instant-hit, vertical pillars of burning death.

- Most weapons are projectile weapons moving with euler integration

All pictures from the game here.

Victor Nicollet, INT13 game programmer



[edited by - ToohrVyk on May 25, 2004 4:27:56 PM]

Share this post


Link to post
Share on other sites
A laser is just a bunch of photons. The mass of a photon is m = E / c^2. So all you need is to know how many photons you are dealing with and how much energy each one carries.

Share this post


Link to post
Share on other sites
quote:
Original post by BitMaster
A laser is just a bunch of photons. The mass of a photon is m = E / c^2. So all you need is to know how many photons you are dealing with and how much energy each one carries.


O____O
You can''t just apply E = m c^2 every time you have an energy or a mass somewhere in a problem. Especially not when you''re dealing with a newtonian version of "slow light".



Victor Nicollet, INT13 game programmer

Share this post


Link to post
Share on other sites
If it''s a laser, it''s just photons. The mass of photons can be found in any school book of physics. Not sure what you mean by "slow light", it doesn''t ring any bells when I translate it into German.

Share this post


Link to post
Share on other sites
If this is a projectile with a finite speed, then it''ll act like any other projectile and take the vehicle''s velocity into account. Don''t think of it as a laser if it isn''t one.

(Actually, even lasers would do this... But you''d only see it as a slight doppler shift in the wavelength.)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!