Physics particles are initialized with velocity equal to initial position vector #81
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was trying to start using the VerletPhysics routines, but ran into a problem where particles have an initial velocity.
I did some digging, and it looks like 9e0bba8 changed the initial conditions for particles to always set
prev
to be(vec2 0 0)
. Previously it set both current position and previous position to the initial position. The new behavior sets the initial velocity of a particle to(- pos (vec2 0 0))
.If the particles all start at 0,0 or very near this likely works out fine, but it seems like setting both pos and prev to the initial conditions would make more sense? Is there some other use case here I'm missing? Maybe the spring examples were in a coordinate system relative to origin?
Thank you for implementing all these geometry routines, it's been a really great & useful resource!