Previously, I have been calculating entity velocities as the difference between the entity position before UpdateWorld and the position after. This is wrong.
Instead, multiply the normal of the collisions with your velocity to get the new velocity:
I expect this to fix a number of errors I was getting with verlets.
Instead, multiply the normal of the collisions with your velocity to get the new velocity:
If EntityCollided(p\entity,2) m=Magnitude(p\velocity[0],p\velocity[1],p\velocity[2]) For c=1 To CountCollisions(p\entity) p\velocity[0]=p\velocity[0]+CollisionNX(p\entity,c)*Abs(p\velocity[0]) p\velocity[1]=p\velocity[1]+CollisionNY(p\entity,c)*Abs(p\velocity[1]) p\velocity[2]=p\velocity[2]+CollisionNZ(p\entity,c)*Abs(p\velocity[2]) Next EndIf
I expect this to fix a number of errors I was getting with verlets.