import * as React from "react"; import { Camera } from "babylonjs/Cameras/camera"; import { Observable } from "babylonjs/Misc/observable"; import { PropertyChangedEvent } from "../../../../propertyChangedEvent"; import { SliderLineComponent } from "../../../lines/sliderLineComponent"; import { LineContainerComponent } from "../../../lineContainerComponent"; import { FloatLineComponent } from "../../../lines/floatLineComponent"; import { TextLineComponent } from "../../../lines/textLineComponent"; import { OptionsLineComponent } from "../../../lines/optionsLineComponent"; import { LockObject } from "../lockObject"; import { GlobalState } from '../../../../globalState'; import { CustomPropertyGridComponent } from '../customPropertyGridComponent'; import { ButtonLineComponent } from '../../../../../sharedUiComponents/lines/buttonLineComponent'; import { TextInputLineComponent } from '../../../lines/textInputLineComponent'; import { AnimationGridComponent } from '../animations/animationPropertyGridComponent'; import { HexLineComponent } from '../../../lines/hexLineComponent'; interface ICommonCameraPropertyGridComponentProps { globalState: GlobalState; camera: Camera; lockObject: LockObject; onPropertyChangedObservable?: Observable; } export class CommonCameraPropertyGridComponent extends React.Component { constructor(props: ICommonCameraPropertyGridComponentProps) { super(props); this.state = { mode: this.props.camera.mode }; } render() { const camera = this.props.camera; var modeOptions = [ { label: "Perspective", value: Camera.PERSPECTIVE_CAMERA }, { label: "Orthographic", value: Camera.ORTHOGRAPHIC_CAMERA } ]; return (
this.setState({ mode: value })} /> { camera.mode === Camera.PERSPECTIVE_CAMERA && } { camera.mode === Camera.ORTHOGRAPHIC_CAMERA && } { camera.mode === Camera.ORTHOGRAPHIC_CAMERA && } { camera.mode === Camera.ORTHOGRAPHIC_CAMERA && } { camera.mode === Camera.ORTHOGRAPHIC_CAMERA && } { camera.dispose(); this.props.globalState.onSelectionChangedObservable.notifyObservers(null); }} />
); } }