Answer the question
In order to leave comments, you need to log in
Solver (pushing objects) of the physics engine?
There are three vectors (3D) -
acceleration
velocity
position
I update the position like this -
position += (velocity * time);
velocity += (accerelation * time);
Answer the question
In order to leave comments, you need to log in
It is necessary to enter such a parameter as elasticity . Sometimes it is called bounce material. It shows the efficiency of collision with the surface. Simply put, elasticity determines the amount of energy an object has left after a collision.
Now you have 100% elasticity - absolutely elastic bodies. But in reality this does not happen. Thus, the rebound velocity should decrease in proportion to the elasticity of the colliding bodies. Then it will decrease again and again... And then it will reach the discretization interval - the body will stop.
You also need to take into account the resistance of the environment. By itself, the speed of the body in free flight should decrease (not taking into account 9.8). This is set by viscous friction.
Shortly speaking,
You are right about elasticity. But there is to simplify, then in the event of a collision, the speed cannot be changed as
a
k = 0 - absolutely inelastic collision (the ball will stick)
k = 1 - absolutely elastic (it will jump endlessly)
Probably there is not enough mass parameter or at least friction, but better both at once. At worst, at least some sort of extinction coefficient of accerelation.
Now you have a completely linear world in a "spherical vacuum".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question