import * as React from "react"; import { Camera, Observable } from "babylonjs"; 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"; interface ICommonCameraPropertyGridComponentProps { 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: BABYLON.Camera.PERSPECTIVE_CAMERA }, { label: "Orthographic", value: BABYLON.Camera.ORTHOGRAPHIC_CAMERA } ]; return ( this.setState({ mode: value })} /> { camera.mode === BABYLON.Camera.PERSPECTIVE_CAMERA && } { camera.mode === BABYLON.Camera.ORTHOGRAPHIC_CAMERA && } { camera.mode === BABYLON.Camera.ORTHOGRAPHIC_CAMERA && } { camera.mode === BABYLON.Camera.ORTHOGRAPHIC_CAMERA && } { camera.mode === BABYLON.Camera.ORTHOGRAPHIC_CAMERA && } ); } }