import React, { Component, Fragment } from "react"; import InputGroup from "../inputs/InputGroup"; import SelectInput from "../inputs/SelectInput"; import BooleanInput from "../inputs/BooleanInput"; import NumericInputGroup from "../inputs/NumericInputGroup"; import { Vector2 } from "three"; import { withTranslation } from "react-i18next"; /** * Array containing options for shadow resolution * * @author Robert Long */ const ShadowMapResolutionOptions = [ { label: "256px", value: new Vector2(256, 256) }, { label: "512px", value: new Vector2(512, 512) }, { label: "1024px", value: new Vector2(1024, 1024) }, { label: "2048px", value: new Vector2(2048, 2048) }, { label: "4096px (not recommended)", value: new Vector2(4096, 4096) } ]; //creating properties for LightShadowProperties component type LightShadowPropertiesProps = { editor?: object; node?: object; t?: Function; }; /** * OnChangeShadowMapResolution used to customize properties of LightShadowProperties * Used with LightNodeEditors. * * @author Robert Long * @type {[class component]} */ export class LightShadowProperties extends Component< LightShadowPropertiesProps, {} > { // function to handle the change in shadowMapResolution propery onChangeShadowMapResolution = shadowMapResolution => { (this.props.editor as any).setPropertySelected( "shadowMapResolution", shadowMapResolution ); }; // function to handle changes in castShadow propery onChangeCastShadow = castShadow => { (this.props.editor as any).setPropertySelected("castShadow", castShadow); }; // fucntion to handle changes in shadowBias property onChangeShadowBias = shadowBias => { (this.props.editor as any).setPropertySelected("shadowBias", shadowBias); }; // function to handle changes shadowRadius property onChangeShadowRadius = shadowRadius => { (this.props.editor as any).setPropertySelected("shadowRadius", shadowRadius); }; //rendering editor view for LightShadowProperties render() { const node = this.props.node; return ( { /* @ts-ignore */ } { /* @ts-ignore */ } { /* @ts-ignore */ } { /* @ts-ignore */ } { /* @ts-ignore */ } ); } } export default withTranslation()(LightShadowProperties);