#### Archived

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

# Mass and velocity

## 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 on other sites
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 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 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 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 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 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 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 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 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 on other sites
Woah thanks for the comments all.
And the strange stuff on light!

I do mean a non-light-speed, non-finger-of-light projectile.

I wonder what the stuff fired in Star Wars is supposed to be made out of... probably plasma or something then, so it has a mass.

Good point ToohrVyk re: making it feel right over correctness.

##### Share on other sites
quote:
Original post by Aph3x
I wonder what the stuff fired in Star Wars is supposed to be made out of... probably plasma or something then, so it has a mass.

If they where using plasma then why JEDIs dont use strong magnetic/electric fields around them to protect them selves why they make so much effort to defend them selves using light sabres.

##### Share on other sites
because it doesn''t look nearly as cool.

##### Share on other sites
Time to clarify things, perhaps...

1. Photons do not have a rest mass, their energy is entirely kinetic, and they cannot exist without moving.

2. Light travels at 3x10^8 m/s, relatively to everyone.

3. Unlike Star Trek, Star Wars was not conceived to be realistic, it was conceived to be fun (which Star Trek isn't ;D).

4. What you are talking about is not an actual laser. We could say its a plasma beam... And therefore, it should react like any projectile. Since its velocity is very low, you can just add its initial velocity to the shooter's velocity.

It wouldnt make sense not to add the projectile's velocity to the shooter's velocity, because if you have relatively fast vehicles, or if you shoot while falling off something very fast, you could even move faster than your projectile.

Looking for a serious game project?
www.xgameproject.com

[edited by - Max_Payne on May 25, 2004 9:02:56 PM]

##### Share on other sites
On more thing, can plasma ray can me made to travel straight? because sky lighting plasma tends to ground it self.

##### Share on other sites
quote:
Original post by DirectXXX
On more thing, can plasma ray can me made to travel straight? because sky lighting plasma tends to ground it self.

Well in the case of "star wars like" weapons, we would be talking of actually shooting plasma, and not shooting a discharge to ionize air.

Looking for a serious game project?
www.xgameproject.com

• ### Forum Statistics

• Total Topics
628354
• Total Posts
2982243

• 10
• 9
• 11
• 24
• 11