mylingo3d
Version:
Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor
40 lines (34 loc) • 1.01 kB
text/typescript
import { Color, HemisphereLight } from "three"
import LightBase from "../core/LightBase"
import ISkyLight, {
skyLightDefaults,
skyLightSchema
} from "../../interface/ISkyLight"
export default class Skylight
extends LightBase<typeof HemisphereLight>
implements ISkyLight
{
public static componentName = "skyLight"
public static defaults = skyLightDefaults
public static schema = skyLightSchema
public constructor() {
super(HemisphereLight)
this.innerY = 0
}
public get groundColor() {
const light = this.lightState.get()
if (!light) return "#ffffff"
return "#" + light.groundColor.getHexString()
}
public set groundColor(val) {
this.cancelHandle("groundColor", () =>
this.lightState.get(
(light) => light && (light.groundColor = new Color(val))
)
)
}
public override get castShadow() {
return false
}
public override set castShadow(_) {}
}