transformNodePropertyComponent.tsx 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. import * as React from "react";
  2. import { LineContainerComponent } from '../../sharedComponents/lineContainerComponent';
  3. import { IPropertyComponentProps } from './propertyComponentProps';
  4. import { CheckBoxLineComponent } from '../../sharedComponents/checkBoxLineComponent';
  5. import { TransformBlock } from 'babylonjs/Materials/Node/Blocks/transformBlock';
  6. import { GeneralPropertyTabComponent } from './genericNodePropertyComponent';
  7. export class TransformPropertyTabComponent extends React.Component<IPropertyComponentProps> {
  8. constructor(props: IPropertyComponentProps) {
  9. super(props)
  10. }
  11. render() {
  12. return (
  13. <>
  14. <GeneralPropertyTabComponent globalState={this.props.globalState} block={this.props.block}/>
  15. <LineContainerComponent title="PROPERTIES">
  16. <CheckBoxLineComponent label="Transform as direction" onSelect={value => {
  17. let transformBlock = this.props.block as TransformBlock;
  18. if (value) {
  19. transformBlock.complementW = 0;
  20. } else {
  21. transformBlock.complementW = 1;
  22. }
  23. this.props.globalState.onRebuildRequiredObservable.notifyObservers();
  24. }} isSelected={() => (this.props.block as TransformBlock).complementW === 0} />
  25. </LineContainerComponent>
  26. </>
  27. );
  28. }
  29. }