UNPKG

lingo3d

Version:

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

19 lines 799 B
import fpsAlpha from "../display/utils/fpsAlpha"; import createInternalSystem from "./utils/createInternalSystem"; export const lookToSystem = createInternalSystem("lookToSystem", { data: {}, update: (self, data) => { const { quaternion, quaternionNew, a1 } = data; quaternion.slerp(quaternionNew, fpsAlpha(a1 ?? 0.05)); const x = Math.abs(quaternion.x - quaternionNew.x); const y = Math.abs(quaternion.y - quaternionNew.y); const z = Math.abs(quaternion.z - quaternionNew.z); const w = Math.abs(quaternion.w - quaternionNew.w); if (x + y + z + w < 0.001) { lookToSystem.delete(self); self.onLookToEnd?.(); quaternion.copy(quaternionNew); } } }); //# sourceMappingURL=lookToSystem.js.map