All Projects → phenomLi → Torque

phenomLi / Torque

Licence: other
2d 纯计算高性能刚体物理引擎

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to Torque

Py3ODE
Port of PyODE for Python 3
Stars: ✭ 29 (-53.23%)
Mutual labels:  physics, physics-engine, physics-simulation
Physics3d
A 3D physics engine
Stars: ✭ 101 (+62.9%)
Mutual labels:  physics, physics-engine
Specs Physics
nphysics integration for the Specs entity component system
Stars: ✭ 94 (+51.61%)
Mutual labels:  physics, physics-engine
Physac
2D physics header-only library for videogames developed in C using raylib library.
Stars: ✭ 151 (+143.55%)
Mutual labels:  physics, physics-engine
Mcmd
Monte Carlo and Molecular Dynamics Simulation Package
Stars: ✭ 52 (-16.13%)
Mutual labels:  physics, physics-simulation
Spirit
Atomistic Spin Simulation Framework
Stars: ✭ 67 (+8.06%)
Mutual labels:  physics, physics-simulation
Matter Js
a 2D rigid body physics engine for the web ▲● ■
Stars: ✭ 12,522 (+20096.77%)
Mutual labels:  physics, physics-engine
Sicmutils
Scmutils in Clojure
Stars: ✭ 447 (+620.97%)
Mutual labels:  physics, physics-simulation
P2.js
JavaScript 2D physics library
Stars: ✭ 2,367 (+3717.74%)
Mutual labels:  physics, physics-engine
BowlerStudio
A Full-Stack Robotics Development Environment
Stars: ✭ 95 (+53.23%)
Mutual labels:  physics, physics-simulation
gopem
GUI for OPEM library
Stars: ✭ 20 (-67.74%)
Mutual labels:  physics, physics-simulation
Legion-Engine
Rythe is a data-oriented C++17 game engine built to make optimal use of modern hardware.
Stars: ✭ 502 (+709.68%)
Mutual labels:  physics, physics-engine
Latticeboltzmann
A 2D Lattice Boltzmann program
Stars: ✭ 34 (-45.16%)
Mutual labels:  physics, physics-simulation
Qrack
Comprehensive, GPU accelerated framework for developing universal virtual quantum processors
Stars: ✭ 79 (+27.42%)
Mutual labels:  physics, physics-simulation
Picongpu
Particle-in-Cell Simulations for the Exascale Era ✨
Stars: ✭ 452 (+629.03%)
Mutual labels:  physics, physics-simulation
Nphysics
2 and 3-dimensional rigid body physics engine for Rust.
Stars: ✭ 1,530 (+2367.74%)
Mutual labels:  physics, physics-engine
N-body-numerical-simulation
Script written in Python to integrate the equations of motion of N particles interacting with each other gravitationally. The script computes the equations of motion and use scipy.integrate to integrate them. Then it uses matplotlib to visualize the solution.
Stars: ✭ 40 (-35.48%)
Mutual labels:  physics, physics-simulation
orbital-sim
A simple physics engine build over a PyGame simulation to accurately model planetary orbits in space
Stars: ✭ 31 (-50%)
Mutual labels:  physics, physics-2d
Dynamics
A Compositional Object-Based Approach to Learning Physical Dynamics
Stars: ✭ 159 (+156.45%)
Mutual labels:  physics, physics-simulation
creative-coding-notebooks
🎨 An authorial collection of fundamental recipes on Creative Coding and Recreational Programming.
Stars: ✭ 17 (-72.58%)
Mutual labels:  physics, physics-simulation

Torque

2D 刚体高性能物理引擎,不包含渲染。


Usage

初始化一个 torque 实例

const torque = new Torque(width, height);

创建并添加一个矩形

const rect = Torque.body.Rect(100, 100, 100, 200);      
torque.append(rect);

此时一个宽 100,高 200 的矩形被创建在物理世界中的(100,100)位置上。但是此时我们看不到任何画面。

Torque 仅包含物理计算,不包含渲染器,因此你需要选取一个渲染器进行图形绘制。以 PIXI 为例,给这个矩形添加渲染器:

const app = new PIXI.Application({
    width: 800, 
    height: 600,
    antialias: true,   
});

let rectangle = new PIXI.Graphics();

shape.lineStyle(0.8, 0x000000, 1);
shape.beginFill();
        
rectangle.position.x = 100 + 100 / 2;
rectangle.position.y = 100 + 100 / 2;
rectangle.drawRect(-100 / 2, -100 / 2, 100, 100);

rectangle.endFill();

rect.setRender(function(body) {
    rectangle.position.x = body.position.x;
    rectangle.position.y = body.position.y;
    rectangle.rotation = body.rotation;
});

app.stage.add(rectangle);

至此,由PIXI创建的矩形rectangle与Torque世界的矩形rect通过setRender函数绑定在了一起。刷新浏览器,可以看见一个黑色边框的,长宽都为100的矩形出现在(100, 100)的位置。


Feature

  • SATBoost技术
  • 休眠 / 唤醒技术
  • Warm Start
  • Sequential Impulses
  • 基于SATBoost的快速碰撞缓存 / 复用技术
  • 碰撞过滤
  • 基于SATBoost的快速V-clip碰撞点求解方法
  • 动态 dt
  • 凹多边形
  • 复合刚体
  • 静态 / 运动 / 动态的刚体
  • 摩擦力,静摩擦力,空气摩擦,恢复系数
  • 旋转关节,扭转关节,布料等
  • 事件(collisionStart/collisionEnd/sleepStart/sleepEnd...)

Demo

  • 最新的DEMO已将渲染器从zrender替换至PIXI,因PIXI是基于WebGL渲染,具有更好的性能
  • 已增加关节约束功能!

戳这里


关于SATBoost

SATBoost技术是本人研究得到的针对SAT(分离轴测试算法)的一个优化算法,能大幅提高碰撞检测的效率。在给定7 * 17个正16边形的静止碰撞(rest collision)条件下,与未经过优化的常规SAT对比结果如下(关闭碰撞复用和休眠功能):

SATBoost主要针对SAT进行改进,但同时,SATBoost也优化了碰撞复用和碰撞点求解的性能。


A.D.

想了解制作物理引擎相关技术细节,可以关注我的博客(不定时更新)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].