UNPKG

3d-bullet-raub

Version:

Bullet Physics plugin for Node.js 3D Core

28 lines (20 loc) 415 B
'use strict'; const bullet = require('bullet-raub'); const _init = (opts = {}) => { const { three } = opts; const { Scene } = bullet; const scene = new Scene(); const Shape = require('./shape')({ scene, three }); return { bullet, scene, Shape, }; }; let inited = null; const init = (opts) => { if (inited) { return inited; } inited = _init(opts); return inited; }; module.exports = { init };