boxEmitterGridComponent.tsx 1.7 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import * as React from "react";
  2. import { Observable } from "babylonjs/Misc/observable";
  3. import { GlobalState } from '../../../../globalState';
  4. import { PropertyChangedEvent } from '../../../../propertyChangedEvent';
  5. import { BoxParticleEmitter } from 'babylonjs/Particles/EmitterTypes/boxParticleEmitter';
  6. import { Vector3LineComponent } from '../../../../../sharedUiComponents/lines/vector3LineComponent';
  7. interface IBoxEmitterGridComponentProps {
  8. globalState: GlobalState;
  9. emitter: BoxParticleEmitter,
  10. onPropertyChangedObservable?: Observable<PropertyChangedEvent>
  11. }
  12. export class BoxEmitterGridComponent extends React.Component<IBoxEmitterGridComponentProps> {
  13. constructor(props: IBoxEmitterGridComponentProps) {
  14. super(props);
  15. }
  16. render() {
  17. let emitter = this.props.emitter;
  18. return (
  19. <>
  20. <Vector3LineComponent label="Direction 1" target={emitter} propertyName="direction1"
  21. onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
  22. <Vector3LineComponent label="Direction 2" target={emitter} propertyName="direction2"
  23. onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
  24. <Vector3LineComponent label="Min emit box" target={emitter} propertyName="minEmitBox"
  25. onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
  26. <Vector3LineComponent label="Max emit box" target={emitter} propertyName="maxEmitBox"
  27. onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
  28. </>
  29. );
  30. }
  31. }