Coder Social home page Coder Social logo

xeltalliv / vsplphysicsengine Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 36 KB

3D rigidbody physics engine written in a custom programming language that compiles into Scratch 3 project

License: MIT License

custom-programming-language physics-engine scratch3

vsplphysicsengine's Introduction

What is this

3D rigidbody physics engine based of:

  1. Ian Millington's book called "Game Physics Engine Development"
  2. https://danielchappuis.ch/download/ConstraintsDerivationRigidBody3D.pdf
  3. http://www.mft-spirit.nl/files/MTamis_Constraints.pdf

Features

Each rigidbody can have multiple colliders.
Colliders:

  1. Planes
  2. Spheres
  3. Boxes
  4. Capsules

Joints:

  1. Slider joint
  2. Hinge joints
  3. Unvisersal joints
  4. Three axis limited joints
  5. Ball and socket joints (3 axis unlimited)
  6. Shared motion joint (allows to linearly connect movement/rotation of one rigidbody to movement/rotation or another rigidbody)
  7. Center distance
  8. Point distance

Joints 1-4 support limits and motors

Force generators:

  1. Global acceleration
  2. Local acceleration
  3. Springs
  4. Buoyancy

Collision returns multiple contact points.
Cone friction.

Missing features

Doesn't automatically compute center of mass.
Doesn't use generalized collision detection. There is code for each possible combination of colliders.
Doesn't preserve contact data from the last frame.
Doesn't have warm starting.
Doesn't have sleep optimization.
Doesn't have coarse collision phase or any data structures to early out collision of far objects.

How to compile

  1. Press Code -> Download ZIP.
  2. Open vspl compiler on github pages, or download it's source code and run it locally.
  3. If your browser supports it, unzip this source code and press "Pick directory" and pick the directory that contains everything from this repo (not just src) and allow file reading. If browser doesn't support it, use "Import zip" instead.
  4. Press "Compile"
  5. In case of using "Pick directory", you will be prompted again for file write access. Accept it and compiled project will overwrite "Compiled.sb3" in "output" directory. In case file "Compiled.sb3" doesn't exist, you reject write access or using "Import zip", the compiled project will be downloaded as usually downloading any other files in the browser.

The demo of this physics engine can be seen here.

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.