Original Post
Hi guys!
I was read this article on this site
http://www.gamedev.n...e-physics-r2714
And I wondered, what if upgrade it for experiment?
i downloaded it and decided to add friction.
But I did not understand how to do it correctly. We can replace the speed of this [color=#ff0000]-k*N+OldVelocity[color=#ff0000];
[color=#000000]where N as I understood the normalized velocity (well, more multiplied by -1 is not?)
Well, add a small fix that would not work, that the infinite is force the body begins to move in the opposite direction
[color=#ff0000]VelNew = max(-k*N+OldVelocity, 0.0f)
how to modify this method (if not this one?) to get the friction?
[source lang="cpp"]void Physics::UpdateVerlet() { //????????? ????????? ??????
for( int I = 0; I < VertexCount; I++ ) {
Vertex& V = *Vertices[ I ];
Vec2 OldPosition = V.Position;
V.Position += V.Position-V.OldPosition + V.Acceleration*Timestep*Timestep;
V.OldPosition = OldPosition;
}
}[/source]
I was read this article on this site
http://www.gamedev.n...e-physics-r2714
And I wondered, what if upgrade it for experiment?
i downloaded it and decided to add friction.
But I did not understand how to do it correctly. We can replace the speed of this [color=#ff0000]-k*N+OldVelocity[color=#ff0000];
[color=#000000]where N as I understood the normalized velocity (well, more multiplied by -1 is not?)
Well, add a small fix that would not work, that the infinite is force the body begins to move in the opposite direction
[color=#ff0000]VelNew = max(-k*N+OldVelocity, 0.0f)
how to modify this method (if not this one?) to get the friction?
[source lang="cpp"]void Physics::UpdateVerlet() { //????????? ????????? ??????
for( int I = 0; I < VertexCount; I++ ) {
Vertex& V = *Vertices[ I ];
Vec2 OldPosition = V.Position;
V.Position += V.Position-V.OldPosition + V.Acceleration*Timestep*Timestep;
V.OldPosition = OldPosition;
}
}[/source]