From c4767283227c76bed358cebedd8b8bbe35f0eac1 Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Sun, 7 Mar 2021 16:17:18 +0100 Subject: [PATCH] add HemisphereLight --- src/lights/HemisphereLight.js | 16 ++++++++++++++++ src/lights/index.js | 1 + src/plugin.js | 1 + 3 files changed, 18 insertions(+) create mode 100644 src/lights/HemisphereLight.js diff --git a/src/lights/HemisphereLight.js b/src/lights/HemisphereLight.js new file mode 100644 index 0000000..8bd15c8 --- /dev/null +++ b/src/lights/HemisphereLight.js @@ -0,0 +1,16 @@ +import { HemisphereLight } from 'three'; +import Light from './Light.js'; +import { bindProp } from '../tools.js'; + +export default { + extends: Light, + props: { + groundColor: { type: String, default: '#ffffff' }, + }, + created() { + this.light = new HemisphereLight(this.color, this.groundColor, this.intensity); + bindProp(this, 'groundColor', this.light); + this.initLight(); + }, + __hmrId: 'HemisphereLight', +}; diff --git a/src/lights/index.js b/src/lights/index.js index d54391c..16e6df9 100644 --- a/src/lights/index.js +++ b/src/lights/index.js @@ -1,5 +1,6 @@ export { default as AmbientLight } from './AmbientLight.js'; export { default as DirectionalLight } from './DirectionalLight.js'; +export { default as HemisphereLight } from './HemisphereLight.js'; export { default as PointLight } from './PointLight.js'; export { default as RectAreaLight } from './RectAreaLight.js'; export { default as SpotLight } from './SpotLight.js'; diff --git a/src/plugin.js b/src/plugin.js index cedd359..bf1a574 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -29,6 +29,7 @@ export const TroisJSVuePlugin = { 'AmbientLight', 'DirectionalLight', + 'HemisphereLight', 'PointLight', 'RectAreaLight', 'SpotLight',