@vci/quick-three
Version:
quick three
17 lines (16 loc) • 678 B
JavaScript
import { createTweenModifier } from "./../../helper/TweenHelper";
function createLightHelper(qt, light) {
light.modifyIntensity = createTweenModifier(
qt.tw,
{
instance: light,
keyModifyProperty: "intensity",
twKey: `light.modifyIntensity@${light.uuid}`
// TODO 最好不要在亮度为0的时候移出灯光,否则会造诚阴影异常|待官方修复
// twOnStart: (e, value) => value >= 0 && (o3Parent.add(light)),
// twOnComplete: () => light.intensity === 0 && o3Parent.remove(light)
}
);
light.resetIntensity = async twOption => await light.modifyIntensity(light._intensity, twOption);
}
export { createLightHelper };