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.
35 lines
738 B
35 lines
738 B
import { LabelElement } from '../../libs/flow.module.js';
|
|
import { BaseNode } from '../core/BaseNode.js';
|
|
import { MathNode, UniformNode } from 'three/nodes';
|
|
|
|
const NULL_VALUE = new UniformNode( 0 );
|
|
|
|
export class DotEditor extends BaseNode {
|
|
|
|
constructor() {
|
|
|
|
const node = new MathNode( MathNode.DOT, NULL_VALUE, NULL_VALUE );
|
|
|
|
super( 'Dot Product', 1, node, 175 );
|
|
|
|
const aElement = new LabelElement( 'A' ).setInput( 3 );
|
|
const bElement = new LabelElement( 'B' ).setInput( 3 );
|
|
|
|
aElement.onConnect( () => {
|
|
|
|
node.aNode = aElement.getLinkedObject() || NULL_VALUE;
|
|
|
|
} );
|
|
|
|
bElement.onConnect( () => {
|
|
|
|
node.bNode = bElement.getLinkedObject() || NULL_VALUE;
|
|
|
|
} );
|
|
|
|
this.add( aElement )
|
|
.add( bElement );
|
|
|
|
}
|
|
|
|
}
|
|
|