UNPKG

pocket-physics

Version:

Verlet physics extracted from pocket-ces demos

12 lines (11 loc) 364 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.inertia = void 0; const v2_1 = require("./v2"); const inertia = (cmp) => { const x = cmp.cpos.x * 2 - cmp.ppos.x; const y = cmp.cpos.y * 2 - cmp.ppos.y; (0, v2_1.set)(cmp.ppos, cmp.cpos.x, cmp.cpos.y); (0, v2_1.set)(cmp.cpos, x, y); }; exports.inertia = inertia;