1.6.2 • Published 12 months ago

trebuchetjs v1.6.2

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

TrebuchetJS

Lightweight physics simulation engine for Three.js. Naive calculations of drag and other physical effects favor performance and cartoon feel for applications where user interactivity is more important than realism.

API

TREBUCHET.World(float drag, float gravity, string up_axis) Constructor for a World object, which contains all PhysicsBody objects that are affected by the package's simulations.

TREBUCHET.PhysicsBody(var object, float force) Constructor for a PhysicsBody, which can be placed into a World object to simulate physics for it. Object should be a three.js mesh object.

TREBUCHET.addImpulse(var object, float force, THREE.Vector3 direction, World world) Adds a force impulse to a given object, in a direction and with a force amount. Specifies World to simulate the object in.

TREBUCHET.simulateWorld(World world) To be run every frame; Runs all physics simulations (forces, drag, and gravity) for a given world and all objects inside it.

TREBUCHET.readPositions(World world) Prints to the console the positions of all objects in a given World. For debugging.

1.6.2

12 months ago

1.6.1

1 year ago

1.6.0

1 year ago

1.5.2

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.8

1 year ago

1.4.7

1 year ago

1.4.6

1 year ago

1.4.5

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.4

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.14

1 year ago

1.2.13

1 year ago

1.2.12

1 year ago

1.2.11

1 year ago

1.2.10

1 year ago

1.2.9

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago