UNPKG

mylingo3d

Version:

Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor

15 lines 686 B
import getActualScale from "../../../../utils/getActualScale"; import loadCannon from "../loadCannon"; export default async function () { const { Sphere, Cylinder, Vec3 } = await loadCannon(); const { x, y } = getActualScale(this); const radius = x * 0.5; const halfHeight = y * 0.5; const shape0 = new Sphere(radius); const shape1 = new Sphere(radius); const shape2 = new Cylinder(radius, radius, Math.abs(y - x)); this.cannonBody.addShape(shape0, new Vec3(0, -halfHeight + radius, 0)); this.cannonBody.addShape(shape1, new Vec3(0, halfHeight - radius, 0)); this.cannonBody.addShape(shape2); } //# sourceMappingURL=pillShape.js.map