UNPKG

mylingo3d

Version:

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

30 lines 1.04 kB
import { PointLight as ThreePointLight } from "three"; import { pointLightDefaults, pointLightSchema } from "../../interface/IPointLight"; import LightBase from "../core/LightBase"; export default class PointLight extends LightBase { static componentName = "pointLight"; static defaults = pointLightDefaults; static schema = pointLightSchema; constructor() { super(ThreePointLight); } get decay() { const light = this.lightState.get(); if (!light) return 1; return light.decay; } set decay(val) { this.cancelHandle("decay", () => this.lightState.get((light) => light && (light.decay = val))); } get distance() { const light = this.lightState.get(); if (!light) return 0; return light.distance; } set distance(val) { this.cancelHandle("distance", () => this.lightState.get((light) => light && (light.distance = val))); } } //# sourceMappingURL=PointLight.js.map