UNPKG

mylingo3d

Version:

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

16 lines 837 B
import getActualScale from "../../../../utils/getActualScale"; import loadCannon from "../loadCannon"; import { vector3, vector3_ } from "../../../../utils/reusables"; export default async function () { const { Box, Vec3 } = await loadCannon(); const actualScale = getActualScale(this); const scale0 = actualScale.clone().multiply(vector3.set(0.15, 0.5, 0.1)); const scale1 = actualScale.clone().multiply(vector3_.set(0.5, 0.15, 0.1)); const shape0 = new Box(scale0); const shape1 = new Box(scale1); this.cannonBody.addShape(shape0, new Vec3(-scale1.x, 0, 0)); this.cannonBody.addShape(shape0, new Vec3(scale1.x, 0, 0)); this.cannonBody.addShape(shape1, new Vec3(0, -scale0.y, 0)); this.cannonBody.addShape(shape1, new Vec3(0, scale0.y, 0)); } //# sourceMappingURL=torusShape.js.map