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',