Skip to content

Balls sometimes stick together instead of bouncing. #1

@martinodb

Description

@martinodb

Hello!

Very nice little ball collision simulator :)
I noticed that sometimes the balls stick together instead of bouncing. Take it with a grain of salt, but I think it's because the way you defined the "approaching" function, so that sometimes the balls are not approaching (they are already going past each other) but the function thinks they are approaching, because it only depends on the velocities. I changed the definition and it seems to work better, the balls don't seem to get stuck any more. Shall I open a pull request? Sorry, I'm new to Github, I don't know how this works ;)
Here's my fork.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions