1.1.1 • Published 2 months ago

cyclone-physics v1.1.1

Weekly downloads
6
License
MIT
Repository
github
Last release
2 months ago

Cyclone Javascript Physics Engine

A manual port of the Cyclone Physics Engine (http://procyclone.com/) from C++ to JavaScript

Usage:

// initial setup
elation.physics.system.start();

var smallball = new elation.physics.rigidbody({ 
  mass: 1, 
  position: new THREE.Vector3(0, 0, 1),
  velocity: new THREE.Vector3(0, 0, -1) 
});
smallball.setCollider("sphere", 2);
elation.events.add(smallball, "collide", function() { console.log('small boing!'); });
elation.physics.system.add(smallball);

var bigball = new elation.physics.rigidbody({
  mass: 10, 
  position: new THREE.Vector3(1, 0, 0),
  velocity: new THREE.Vector3(-1, 0, 0) 
});
bigball.setCollider("sphere", 5);
elation.events.add(bigball, "collide", function() { console.log('big boing!'); });
elation.physics.system.add(bigball);

// render loop
var lasttime = Date.now();
requestAnimationFrame(stepfunc);

function stepfunc(t) {
  elation.physics.system.iterate(t - lasttime);
  renderer.render();
  lasttime = t;
  requestAnimationFrame(stepfunc);
});
1.1.1

2 months ago

1.1.0

2 months ago

1.0.15

2 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

5 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago