You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
696 B
30 lines
696 B
import { SelectInput, Element } from '../../libs/flow.module.js';
|
|
import { BaseNode } from '../core/BaseNode.js';
|
|
import { NormalNode } from 'three/nodes';
|
|
|
|
export class NormalEditor extends BaseNode {
|
|
|
|
constructor() {
|
|
|
|
const node = new NormalNode();
|
|
|
|
super( 'Normal', 3, node, 200 );
|
|
|
|
const optionsField = new SelectInput( [
|
|
{ name: 'Local', value: NormalNode.LOCAL },
|
|
{ name: 'World', value: NormalNode.WORLD },
|
|
{ name: 'View', value: NormalNode.VIEW },
|
|
{ name: 'Geometry', value: NormalNode.GEOMETRY }
|
|
], NormalNode.LOCAL ).onChange( () => {
|
|
|
|
node.scope = optionsField.getValue();
|
|
|
|
this.invalidate();
|
|
|
|
} );
|
|
|
|
this.add( new Element().add( optionsField ) );
|
|
|
|
}
|
|
|
|
}
|
|
|