UNPKG

lingo3d

Version:

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

20 lines 740 B
import fpsAlpha from "../display/utils/fpsAlpha"; import createInternalSystem from "./utils/createInternalSystem"; import { configPhysicsSystem } from "./configLoadedSystems/configPhysicsSystem"; export const lerpToSystem = createInternalSystem("lerpToSystem", { data: {}, update: (self, data) => { const { x, y, z } = data.from.lerp(data.to, fpsAlpha(data.alpha)); if (Math.abs(self.x - x) < 0.1 && Math.abs(self.y - y) < 0.1 && Math.abs(self.z - z) < 0.1) { lerpToSystem.delete(self); self.onMoveToEnd?.(); } self.x = x; self.y = y; self.z = z; configPhysicsSystem.add(self); } }); //# sourceMappingURL=lerpToSystem.js.map