| hidden: () => !this.hasAttribute('color'), | hidden: () => !this.hasAttribute('color'), | ||||
| value: async() => { | value: async() => { | ||||
| if (!this.hasAttribute('color')) { | if (!this.hasAttribute('color')) { | ||||
| await ThreeViewer.Dialog.prompt('No color attribute found') | |||||
| await ThreeViewer.Dialog.alert('No color attribute found') | |||||
| return | return | ||||
| } | } | ||||
| if (!await ThreeViewer.Dialog.confirm('Remove color attribute?')) return | if (!await ThreeViewer.Dialog.confirm('Remove color attribute?')) return |
| import {ILight} from './ILight' | import {ILight} from './ILight' | ||||
| import {iLightCommons} from '../object/iLightCommons' | import {iLightCommons} from '../object/iLightCommons' | ||||
| import {IObject3D} from '../IObject' | import {IObject3D} from '../IObject' | ||||
| import {uiColor, UiObjectConfig, uiPanelContainer, uiSlider, uiToggle} from 'uiconfig.js' | |||||
| import {uiColor, uiFolderContainer, UiObjectConfig, uiSlider, uiToggle} from 'uiconfig.js' | |||||
| import {onChange3} from 'ts-browser-helpers' | import {onChange3} from 'ts-browser-helpers' | ||||
| @uiPanelContainer('Ambient Light') | |||||
| @uiFolderContainer('Ambient Light') | |||||
| export class AmbientLight2 extends AmbientLight implements ILight<undefined> { | export class AmbientLight2 extends AmbientLight implements ILight<undefined> { | ||||
| assetType = 'light' as const | assetType = 'light' as const | ||||
| setDirty = iLightCommons.setDirty | setDirty = iLightCommons.setDirty |
| import {ILight} from './ILight' | import {ILight} from './ILight' | ||||
| import {iLightCommons} from '../object/iLightCommons' | import {iLightCommons} from '../object/iLightCommons' | ||||
| import {IObject3D} from '../IObject' | import {IObject3D} from '../IObject' | ||||
| import {uiColor, uiNumber, UiObjectConfig, uiPanelContainer, uiSlider, uiToggle, uiVector} from 'uiconfig.js' | |||||
| import {uiColor, uiFolderContainer, uiNumber, UiObjectConfig, uiSlider, uiToggle, uiVector} from 'uiconfig.js' | |||||
| import {onChange2, onChange3} from 'ts-browser-helpers' | import {onChange2, onChange3} from 'ts-browser-helpers' | ||||
| import {bindToValue} from '../../three' | import {bindToValue} from '../../three' | ||||
| * @category Lights | * @category Lights | ||||
| */ | */ | ||||
| // todo: add Light section in the readme detailing these ...2 lights | // todo: add Light section in the readme detailing these ...2 lights | ||||
| @uiPanelContainer('Directional Light') | |||||
| @uiFolderContainer('Directional Light') | |||||
| export class DirectionalLight2 extends DirectionalLight implements ILight<DirectionalLightShadow> { | export class DirectionalLight2 extends DirectionalLight implements ILight<DirectionalLightShadow> { | ||||
| assetType = 'light' as const | assetType = 'light' as const | ||||
| setDirty = iLightCommons.setDirty | setDirty = iLightCommons.setDirty |
| import {ILight} from './ILight' | import {ILight} from './ILight' | ||||
| import {iLightCommons} from '../object/iLightCommons' | import {iLightCommons} from '../object/iLightCommons' | ||||
| import {IObject3D} from '../IObject' | import {IObject3D} from '../IObject' | ||||
| import {uiColor, UiObjectConfig, uiPanelContainer, uiSlider, uiToggle, uiVector} from 'uiconfig.js' | |||||
| import {uiColor, uiFolderContainer, UiObjectConfig, uiSlider, uiToggle, uiVector} from 'uiconfig.js' | |||||
| import {onChange3} from 'ts-browser-helpers' | import {onChange3} from 'ts-browser-helpers' | ||||
| @uiPanelContainer('Hemisphere Light') | |||||
| @uiFolderContainer('Hemisphere Light') | |||||
| export class HemisphereLight2 extends HemisphereLight implements ILight<undefined> { | export class HemisphereLight2 extends HemisphereLight implements ILight<undefined> { | ||||
| assetType = 'light' as const | assetType = 'light' as const | ||||
| setDirty = iLightCommons.setDirty | setDirty = iLightCommons.setDirty |
| import {ILight} from './ILight' | import {ILight} from './ILight' | ||||
| import {iLightCommons} from '../object/iLightCommons' | import {iLightCommons} from '../object/iLightCommons' | ||||
| import {IObject3D} from '../IObject' | import {IObject3D} from '../IObject' | ||||
| import {uiColor, uiNumber, UiObjectConfig, uiPanelContainer, uiSlider, uiToggle, uiVector} from 'uiconfig.js' | |||||
| import {uiColor, uiFolderContainer, uiNumber, UiObjectConfig, uiSlider, uiToggle, uiVector} from 'uiconfig.js' | |||||
| import {onChange3} from 'ts-browser-helpers' | import {onChange3} from 'ts-browser-helpers' | ||||
| import {bindToValue} from '../../three' | import {bindToValue} from '../../three' | ||||
| * | * | ||||
| * Note - gltf serialization is handled by {@link GLTFLightExtrasExtension} | * Note - gltf serialization is handled by {@link GLTFLightExtrasExtension} | ||||
| */ | */ | ||||
| @uiPanelContainer('Point Light') | |||||
| @uiFolderContainer('Point Light') | |||||
| export class PointLight2 extends PointLight implements ILight<PointLightShadow> { | export class PointLight2 extends PointLight implements ILight<PointLightShadow> { | ||||
| assetType = 'light' as const | assetType = 'light' as const | ||||
| setDirty = iLightCommons.setDirty | setDirty = iLightCommons.setDirty |
| import {ILight} from './ILight' | import {ILight} from './ILight' | ||||
| import {iLightCommons} from '../object/iLightCommons' | import {iLightCommons} from '../object/iLightCommons' | ||||
| import {IObject3D} from '../IObject' | import {IObject3D} from '../IObject' | ||||
| import {uiColor, uiNumber, UiObjectConfig, uiPanelContainer, uiSlider, uiToggle} from 'uiconfig.js' | |||||
| import {uiColor, uiFolderContainer, uiNumber, UiObjectConfig, uiSlider, uiToggle} from 'uiconfig.js' | |||||
| import {onChange3} from 'ts-browser-helpers' | import {onChange3} from 'ts-browser-helpers' | ||||
| @uiPanelContainer('RectArea Light') | |||||
| @uiFolderContainer('RectArea Light') | |||||
| export class RectAreaLight2 extends RectAreaLight implements ILight<undefined> { | export class RectAreaLight2 extends RectAreaLight implements ILight<undefined> { | ||||
| assetType = 'light' as const | assetType = 'light' as const | ||||
| setDirty = iLightCommons.setDirty | setDirty = iLightCommons.setDirty |
| import {ILight} from './ILight' | import {ILight} from './ILight' | ||||
| import {iLightCommons} from '../object/iLightCommons' | import {iLightCommons} from '../object/iLightCommons' | ||||
| import {IObject3D} from '../IObject' | import {IObject3D} from '../IObject' | ||||
| import {uiColor, uiInput, uiNumber, UiObjectConfig, uiPanelContainer, uiSlider, uiToggle, uiVector} from 'uiconfig.js' | |||||
| import {uiColor, uiFolderContainer, uiInput, uiNumber, UiObjectConfig, uiSlider, uiToggle, uiVector} from 'uiconfig.js' | |||||
| import {onChange3} from 'ts-browser-helpers' | import {onChange3} from 'ts-browser-helpers' | ||||
| import {bindToValue} from '../../three' | import {bindToValue} from '../../three' | ||||
| * | * | ||||
| * Note - gltf serialization is handled by {@link GLTFLightExtrasExtension} | * Note - gltf serialization is handled by {@link GLTFLightExtrasExtension} | ||||
| */ | */ | ||||
| @uiPanelContainer('Spot Light') | |||||
| @uiFolderContainer('Spot Light') | |||||
| export class SpotLight2 extends SpotLight implements ILight<SpotLightShadow> { | export class SpotLight2 extends SpotLight implements ILight<SpotLightShadow> { | ||||
| assetType = 'light' as const | assetType = 'light' as const | ||||
| setDirty = iLightCommons.setDirty | setDirty = iLightCommons.setDirty |