I wish bring in gzdoom some basic mechanics from first several pages of any textbook of physic, like inertia, impulse, ground/water/air friction, etc.
For this I need add to engine concept of force or acceleration.
But before adaptation of vectors analysis for zscript, I want to know is there are workaround in zscript that I can use for this?
Zscript PhysX/Havok/Bullet
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Re: Zscript PhysX/Havok/Bullet
It's quite unlikely that you'll ever be able to bring "true physics" to the Doom engine, but that being said, all objects have a concept of mass and velocity, and a simple multiplication of those is your total force in a given direction.
Inertia is simply a colliding object's mass - if you remember Newton's third law, where every action must have an equal and opposite reaction, that simply means that colliding with another object will basically swap momentums - providing the collision is head-on. It gets a little more complicated when it's a grazing and not a head-on collision - then it involves friction, and extra stuff like that, which gets a lot more complicated.
Everything in physics can be expressed mathematically, as long as you remember Newton's laws.
Inertia is simply a colliding object's mass - if you remember Newton's third law, where every action must have an equal and opposite reaction, that simply means that colliding with another object will basically swap momentums - providing the collision is head-on. It gets a little more complicated when it's a grazing and not a head-on collision - then it involves friction, and extra stuff like that, which gets a lot more complicated.
Everything in physics can be expressed mathematically, as long as you remember Newton's laws.
Re: Zscript PhysX/Havok/Bullet
Force is equal to mass * acceleration, not mass * velocity - that's momentum. An object with constant velocity has no forces acting on it - that's Newton's first law.Rachael wrote:but that being said, all objects have a concept of mass and velocity, and a simple multiplication of those is your total force in a given direction.
Re: Zscript PhysX/Havok/Bullet
True, thanks for clearing that up.
Re: Zscript PhysX/Havok/Bullet
Not according to vanilla Doom "physics"...Gutawer wrote:not mass * velocity - that's momentum.