Giter Club home page Giter Club logo

Comments (3)

cwgreene avatar cwgreene commented on May 29, 2024

Note that the proposed solution will result in the walls becoming 'sticky'. To make the collisions more elastic, the new position should actually be the reflected position across the boundary, and the old position should like wise be updated to be it's mirror image. This will get the next frame's velocity to be consistent.

from verlet-js.

subprotocol avatar subprotocol commented on May 29, 2024

I agree, this should fix the issue. Great callout! You are right, both position vectors will need to be updated. It should be possible to slip this functionality into the new bounds checking function on line 58: https://github.com/subprotocol/verlet-js/blob/master/js/verlet-js/verlet.js

from verlet-js.

cwgreene avatar cwgreene commented on May 29, 2024

Implemented inelastic solution ('sticky' is the wrong word, 'soft' or 'absorbent' would have been better) for the left hand side and it works as expected.

Sample Solution:
cwgreene@2dbc721

I'm going to implement the generic bounding line solution.

from verlet-js.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.