3.0.0 • Published 7 months ago

3d-bullet-raub v3.0.0

Weekly downloads
32
License
MIT
Repository
github
Last release
7 months ago

Node.js 3D Bullet

This is a part of Node3D project.

NPM ESLint Test

npm i -s 3d-bullet-raub

Bullet physics plugin for Node.js 3D Core

Example

This plugin provides the Shape class to simplify the common use cases with Three.js and Bullet Physics addon.

  • Can display debug shapes.
  • Updates mesh pose from physics engine.
  • Removes meshes when the body is destroyed.
  • Shape extends Body and works with scene.hit()/scene.trace().
import * as three from 'three';
import { init, addThreeHelpers } from '3d-core-raub';
import { init as initBullet } from '3d-bullet-raub';

const { gl, loop, Screen } = init();
addThreeHelpers(three, gl);
const { scene, Shape } = initBullet({ three });

const screen = new Screen({ three });

const plane = new Shape({
	sceneThree: screen.scene,
	color: 0xface8d,
	type: 'plane',
	debug: 'solid',
});

const box = new Shape({
	sceneThree: screen.scene,
	pos: [0, 10, 0], // use { xyz } or [xyz]
	mass: 3,
	debug: 'solid',
	color: 0xbeefed,
	size: { x: 3, y: 2, z: 1 }, // use { xyz } or [xyz]
});

loop(() => {
	scene.update();
	screen.draw();
});
3.0.0

7 months ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.0

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago