Skip to content

thepixelist11/RopePhysics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rope Physics

Summary:

This is a real-time rope and cloth simulation using the basic Störmer-Verlet method of verlet integration. This uses the equation:
xn+1 = 2xn - xn-1 + A(xn)Δt2
to calclulate the position (x) of a point in the next timestep based on the last two positions of the points, the acceleration of the point (A(xn)) and the delta time (Δt2)

Verlet integration is a numerical method used to integrate Newton's equations of motion (wikipedia).

How to Use:

To use the program, you first need to download the code. Open index.html in a web browser (This was not tested in any browsers other than Google Chrome. There may be some issues or bugs in other browsers.)

Controls for when in setup mode:
- LMB: Place dynamic node or change static node to dynamic
- RMB: Place static node or change dynamic node to static
- Hold MMB: Place constraint between two points. If you drag from one point to empty space, a new point will be created at the end
- Hold Spacebar: Place a line of equidistant nodes

Controls for when in simulation mode:
- LMB: Change static node to dynamic
- RMB: Change dynamic node to static
- Hold MMB:Cut constraints

General controls
- Delete: Clear all nodes and constraints
- Hold X or Backspace and press LMB or RMB: Delete specific node


Credits:

Wikipedia - Verlet Integration - Research and part of description
Sebastian Lague - YouTube - Inspiration

License:

MIT License

Copyright 2023 - thepixelist11

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published