super-three 0.136.1 → 0.137.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/three.cjs +37132 -0
- package/build/three.js +71 -53
- package/build/three.min.js +2 -2
- package/build/three.module.js +80 -47
- package/examples/js/animation/MMDAnimationHelper.js +3 -1
- package/examples/js/controls/experimental/CameraControls.js +6 -2
- package/examples/js/exporters/GLTFExporter.js +82 -39
- package/examples/js/geometries/TextGeometry.js +12 -10
- package/examples/js/interactive/HTMLMesh.js +14 -2
- package/examples/js/loaders/EXRLoader.js +20 -9
- package/examples/js/loaders/GLTFLoader.js +1 -1
- package/examples/js/loaders/LDrawLoader.js +541 -425
- package/examples/js/loaders/MD2Loader.js +5 -5
- package/examples/js/loaders/MTLLoader.js +10 -3
- package/examples/js/loaders/PCDLoader.js +2 -2
- package/examples/js/loaders/STLLoader.js +1 -1
- package/examples/js/loaders/SVGLoader.js +3 -2
- package/examples/js/modifiers/EdgeSplitModifier.js +0 -6
- package/examples/js/modifiers/SimplifyModifier.js +0 -10
- package/examples/js/objects/Lensflare.js +2 -2
- package/examples/js/postprocessing/OutlinePass.js +1 -5
- package/examples/js/renderers/CSS2DRenderer.js +25 -19
- package/examples/js/renderers/CSS3DRenderer.js +37 -32
- package/examples/js/utils/LDrawUtils.js +182 -0
- package/examples/jsm/exporters/GLTFExporter.js +80 -12
- package/examples/jsm/geometries/TextGeometry.js +13 -13
- package/examples/jsm/interactive/HTMLMesh.js +16 -2
- package/examples/jsm/libs/flow.module.js +930 -169
- package/examples/jsm/loaders/EXRLoader.js +19 -9
- package/examples/jsm/loaders/GLTFLoader.js +1 -1
- package/examples/jsm/loaders/LDrawLoader.js +534 -442
- package/examples/jsm/loaders/MD2Loader.js +5 -5
- package/examples/jsm/loaders/MTLLoader.js +11 -4
- package/examples/jsm/loaders/PCDLoader.js +2 -2
- package/examples/jsm/loaders/STLLoader.js +1 -1
- package/examples/jsm/loaders/SVGLoader.js +3 -1
- package/examples/jsm/loaders/VRMLLoader.js +0 -1
- package/examples/jsm/modifiers/EdgeSplitModifier.js +0 -6
- package/examples/jsm/modifiers/SimplifyModifier.js +0 -10
- package/examples/jsm/node-editor/NodeEditor.js +435 -181
- package/examples/jsm/node-editor/accessors/NormalEditor.js +8 -8
- package/examples/jsm/node-editor/accessors/PositionEditor.js +8 -8
- package/examples/jsm/node-editor/accessors/UVEditor.js +6 -7
- package/examples/jsm/node-editor/core/BaseNode.js +83 -0
- package/examples/jsm/node-editor/display/BlendEditor.js +7 -6
- package/examples/jsm/node-editor/examples/animate-uv.json +1 -1
- package/examples/jsm/node-editor/examples/fake-top-light.json +1 -1
- package/examples/jsm/node-editor/examples/oscillator-color.json +1 -1
- package/examples/jsm/node-editor/examples/rim.json +1 -1
- package/examples/jsm/node-editor/inputs/ColorEditor.js +14 -10
- package/examples/jsm/node-editor/inputs/FloatEditor.js +6 -7
- package/examples/jsm/node-editor/inputs/SliderEditor.js +4 -5
- package/examples/jsm/node-editor/inputs/Vector2Editor.js +6 -7
- package/examples/jsm/node-editor/inputs/Vector3Editor.js +8 -9
- package/examples/jsm/node-editor/inputs/Vector4Editor.js +9 -10
- package/examples/jsm/node-editor/materials/BasicMaterialEditor.js +87 -0
- package/examples/jsm/node-editor/materials/PointsMaterialEditor.js +97 -0
- package/examples/jsm/node-editor/materials/StandardMaterialEditor.js +20 -17
- package/examples/jsm/node-editor/math/AngleEditor.js +39 -0
- package/examples/jsm/node-editor/math/DotEditor.js +6 -7
- package/examples/jsm/node-editor/math/InvertEditor.js +4 -3
- package/examples/jsm/node-editor/math/LimiterEditor.js +11 -10
- package/examples/jsm/node-editor/math/NormalizeEditor.js +6 -5
- package/examples/jsm/node-editor/math/OperatorEditor.js +12 -11
- package/examples/jsm/node-editor/math/PowerEditor.js +6 -5
- package/examples/jsm/node-editor/math/TrigonometryEditor.js +12 -7
- package/examples/jsm/node-editor/procedural/CheckerEditor.js +4 -3
- package/examples/jsm/node-editor/scene/MeshEditor.js +99 -0
- package/examples/jsm/node-editor/scene/Object3DEditor.js +160 -0
- package/examples/jsm/node-editor/scene/PointsEditor.js +99 -0
- package/examples/jsm/node-editor/utils/JoinEditor.js +58 -0
- package/examples/jsm/node-editor/utils/OscillatorEditor.js +7 -6
- package/examples/jsm/node-editor/utils/SplitEditor.js +39 -0
- package/examples/jsm/node-editor/utils/TimerEditor.js +6 -5
- package/examples/jsm/postprocessing/OutlinePass.js +1 -4
- package/examples/jsm/renderers/CSS2DRenderer.js +24 -19
- package/examples/jsm/renderers/CSS3DRenderer.js +36 -30
- package/examples/jsm/renderers/nodes/accessors/UVNode.js +4 -4
- package/examples/jsm/renderers/nodes/core/NodeBuilder.js +2 -1
- package/examples/jsm/renderers/nodes/utils/SplitNode.js +19 -4
- package/examples/jsm/utils/LDrawUtils.js +18 -11
- package/package.json +16 -9
- package/src/constants.js +1 -3
- package/src/core/BufferGeometry.js +2 -2
- package/src/geometries/LatheGeometry.js +1 -1
- package/src/loaders/FileLoader.js +20 -3
- package/src/math/Box3.js +24 -10
- package/src/renderers/WebGLRenderTarget.js +4 -1
- package/src/renderers/WebGLRenderer.js +3 -3
- package/src/renderers/shaders/ShaderChunk/morphnormal_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/morphtarget_vertex.glsl.js +2 -2
- package/src/renderers/webgl/WebGLBackground.js +2 -2
- package/src/renderers/webgl/WebGLGeometries.js +2 -2
- package/src/renderers/webgl/WebGLPrograms.js +2 -2
- package/src/renderers/webgl/WebGLState.js +2 -2
- package/src/renderers/webgl/WebGLTextures.js +9 -6
- package/src/renderers/webgl/WebGLUtils.js +1 -3
- package/src/renderers/webxr/WebXRManager.js +2 -0
- package/src/utils.js +15 -1
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NumberInput, LabelElement } from '../../libs/flow.module.js';
|
|
2
|
+
import { BaseNode } from '../core/BaseNode.js';
|
|
2
3
|
import { Vector4Node } from '../../renderers/nodes/Nodes.js';
|
|
3
4
|
|
|
4
|
-
export class Vector4Editor extends
|
|
5
|
+
export class Vector4Editor extends BaseNode {
|
|
5
6
|
|
|
6
7
|
constructor() {
|
|
7
8
|
|
|
8
9
|
const node = new Vector4Node();
|
|
9
10
|
|
|
10
|
-
super( 'Vector 4', 4, node );
|
|
11
|
-
|
|
12
|
-
this.title.setIcon( 'ti ti-box-multiple-4' );
|
|
11
|
+
super( 'Vector 4', 4, node, 350 );
|
|
13
12
|
|
|
14
13
|
const onUpdate = () => {
|
|
15
14
|
|
|
@@ -20,12 +19,12 @@ export class Vector4Editor extends ObjectNode {
|
|
|
20
19
|
|
|
21
20
|
};
|
|
22
21
|
|
|
23
|
-
const fieldX = new NumberInput().onChange( onUpdate );
|
|
24
|
-
const fieldY = new NumberInput().onChange( onUpdate );
|
|
25
|
-
const fieldZ = new NumberInput().onChange( onUpdate );
|
|
26
|
-
const fieldW = new NumberInput().onChange( onUpdate );
|
|
22
|
+
const fieldX = new NumberInput().setTagColor( 'red' ).onChange( onUpdate );
|
|
23
|
+
const fieldY = new NumberInput().setTagColor( 'green' ).onChange( onUpdate );
|
|
24
|
+
const fieldZ = new NumberInput().setTagColor( 'blue' ).onChange( onUpdate );
|
|
25
|
+
const fieldW = new NumberInput().setTagColor( 'white' ).onChange( onUpdate );
|
|
27
26
|
|
|
28
|
-
this.add( new LabelElement( '
|
|
27
|
+
this.add( new LabelElement( 'XYZW' )
|
|
29
28
|
.add( fieldX )
|
|
30
29
|
.add( fieldY )
|
|
31
30
|
.add( fieldZ )
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ColorInput, SliderInput, LabelElement } from '../../libs/flow.module.js';
|
|
2
|
+
import { BaseNode } from '../core/BaseNode.js';
|
|
3
|
+
import { MeshBasicNodeMaterial } from '../../renderers/nodes/Nodes.js';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
|
|
6
|
+
export class BasicMaterialEditor extends BaseNode {
|
|
7
|
+
|
|
8
|
+
constructor() {
|
|
9
|
+
|
|
10
|
+
const material = new MeshBasicNodeMaterial();
|
|
11
|
+
|
|
12
|
+
super( 'Basic Material', 1, material );
|
|
13
|
+
|
|
14
|
+
this.setWidth( 300 );
|
|
15
|
+
|
|
16
|
+
const color = new LabelElement( 'color' ).setInput( 3 );
|
|
17
|
+
const opacity = new LabelElement( 'opacity' ).setInput( 1 );
|
|
18
|
+
const position = new LabelElement( 'position' ).setInput( 3 );
|
|
19
|
+
|
|
20
|
+
color.add( new ColorInput( material.color.getHex() ).onChange( ( input ) => {
|
|
21
|
+
|
|
22
|
+
material.color.setHex( input.getValue() );
|
|
23
|
+
|
|
24
|
+
} ) );
|
|
25
|
+
|
|
26
|
+
opacity.add( new SliderInput( material.opacity, 0, 1 ).onChange( ( input ) => {
|
|
27
|
+
|
|
28
|
+
material.opacity = input.getValue();
|
|
29
|
+
|
|
30
|
+
this.updateTransparent();
|
|
31
|
+
|
|
32
|
+
} ) );
|
|
33
|
+
|
|
34
|
+
color.onConnect( () => this.update(), true );
|
|
35
|
+
opacity.onConnect( () => this.update(), true );
|
|
36
|
+
position.onConnect( () => this.update(), true );
|
|
37
|
+
|
|
38
|
+
this.add( color )
|
|
39
|
+
.add( opacity )
|
|
40
|
+
.add( position );
|
|
41
|
+
|
|
42
|
+
this.color = color;
|
|
43
|
+
this.opacity = opacity;
|
|
44
|
+
this.position = position;
|
|
45
|
+
|
|
46
|
+
this.material = material;
|
|
47
|
+
|
|
48
|
+
this.update();
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
update() {
|
|
53
|
+
|
|
54
|
+
const { material, color, opacity, position } = this;
|
|
55
|
+
|
|
56
|
+
color.setEnabledInputs( ! color.getLinkedObject() );
|
|
57
|
+
opacity.setEnabledInputs( ! opacity.getLinkedObject() );
|
|
58
|
+
|
|
59
|
+
material.colorNode = color.getLinkedObject();
|
|
60
|
+
material.opacityNode = opacity.getLinkedObject() || null;
|
|
61
|
+
|
|
62
|
+
material.positionNode = position.getLinkedObject() || null;
|
|
63
|
+
|
|
64
|
+
material.dispose();
|
|
65
|
+
|
|
66
|
+
this.updateTransparent();
|
|
67
|
+
|
|
68
|
+
// TODO: Fix on NodeMaterial System
|
|
69
|
+
material.customProgramCacheKey = () => {
|
|
70
|
+
|
|
71
|
+
return THREE.MathUtils.generateUUID();
|
|
72
|
+
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
updateTransparent() {
|
|
78
|
+
|
|
79
|
+
const { material, opacity } = this;
|
|
80
|
+
|
|
81
|
+
material.transparent = opacity.getLinkedObject() || material.opacity < 1 ? true : false;
|
|
82
|
+
|
|
83
|
+
opacity.setIcon( material.transparent ? 'ti ti-layers-intersect' : 'ti ti-layers-subtract' );
|
|
84
|
+
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { ColorInput, SliderInput, LabelElement } from '../../libs/flow.module.js';
|
|
2
|
+
import { BaseNode } from '../core/BaseNode.js';
|
|
3
|
+
import { PointsNodeMaterial } from '../../renderers/nodes/Nodes.js';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
|
|
6
|
+
export class PointsMaterialEditor extends BaseNode {
|
|
7
|
+
|
|
8
|
+
constructor() {
|
|
9
|
+
|
|
10
|
+
const material = new PointsNodeMaterial( {
|
|
11
|
+
depthWrite: false,
|
|
12
|
+
transparent: true,
|
|
13
|
+
sizeAttenuation: true,
|
|
14
|
+
blending: THREE.AdditiveBlending
|
|
15
|
+
} );
|
|
16
|
+
|
|
17
|
+
super( 'Points Material', 1, material );
|
|
18
|
+
|
|
19
|
+
this.setWidth( 300 );
|
|
20
|
+
|
|
21
|
+
const color = new LabelElement( 'color' ).setInput( 3 );
|
|
22
|
+
const opacity = new LabelElement( 'opacity' ).setInput( 1 );
|
|
23
|
+
const size = new LabelElement( 'size' ).setInput( 1 );
|
|
24
|
+
const position = new LabelElement( 'position' ).setInput( 3 );
|
|
25
|
+
|
|
26
|
+
color.add( new ColorInput( material.color.getHex() ).onChange( ( input ) => {
|
|
27
|
+
|
|
28
|
+
material.color.setHex( input.getValue() );
|
|
29
|
+
|
|
30
|
+
} ) );
|
|
31
|
+
|
|
32
|
+
opacity.add( new SliderInput( material.opacity, 0, 1 ).onChange( ( input ) => {
|
|
33
|
+
|
|
34
|
+
material.opacity = input.getValue();
|
|
35
|
+
|
|
36
|
+
this.updateTransparent();
|
|
37
|
+
|
|
38
|
+
} ) );
|
|
39
|
+
|
|
40
|
+
color.onConnect( () => this.update(), true );
|
|
41
|
+
opacity.onConnect( () => this.update(), true );
|
|
42
|
+
size.onConnect(() => this.update(), true );
|
|
43
|
+
position.onConnect(() => this.update(), true );
|
|
44
|
+
|
|
45
|
+
this.add( color )
|
|
46
|
+
.add( opacity )
|
|
47
|
+
.add( size )
|
|
48
|
+
.add( position );
|
|
49
|
+
|
|
50
|
+
this.color = color;
|
|
51
|
+
this.opacity = opacity;
|
|
52
|
+
this.size = size;
|
|
53
|
+
this.position = position;
|
|
54
|
+
|
|
55
|
+
this.material = material;
|
|
56
|
+
|
|
57
|
+
this.update();
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
update() {
|
|
62
|
+
|
|
63
|
+
const { material, color, opacity, size, position } = this;
|
|
64
|
+
|
|
65
|
+
color.setEnabledInputs( ! color.getLinkedObject() );
|
|
66
|
+
opacity.setEnabledInputs( ! opacity.getLinkedObject() );
|
|
67
|
+
|
|
68
|
+
material.colorNode = color.getLinkedObject();
|
|
69
|
+
material.opacityNode = opacity.getLinkedObject() || null;
|
|
70
|
+
|
|
71
|
+
material.sizeNode = size.getLinkedObject() || null;
|
|
72
|
+
material.positionNode = position.getLinkedObject() || null;
|
|
73
|
+
|
|
74
|
+
material.dispose();
|
|
75
|
+
|
|
76
|
+
this.updateTransparent();
|
|
77
|
+
|
|
78
|
+
// TODO: Fix on NodeMaterial System
|
|
79
|
+
material.customProgramCacheKey = () => {
|
|
80
|
+
|
|
81
|
+
return THREE.MathUtils.generateUUID();
|
|
82
|
+
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
updateTransparent() {
|
|
88
|
+
|
|
89
|
+
const { material, opacity } = this;
|
|
90
|
+
|
|
91
|
+
material.transparent = opacity.getLinkedObject() || material.opacity < 1 ? true : false;
|
|
92
|
+
|
|
93
|
+
opacity.setIcon( material.transparent ? 'ti ti-layers-intersect' : 'ti ti-layers-subtract' );
|
|
94
|
+
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ColorInput, SliderInput, LabelElement } from '../../libs/flow.module.js';
|
|
2
|
+
import { BaseNode } from '../core/BaseNode.js';
|
|
2
3
|
import { MeshStandardNodeMaterial } from '../../renderers/nodes/Nodes.js';
|
|
3
4
|
import * as THREE from 'three';
|
|
4
5
|
|
|
5
|
-
export class StandardMaterialEditor extends
|
|
6
|
+
export class StandardMaterialEditor extends BaseNode {
|
|
6
7
|
|
|
7
8
|
constructor() {
|
|
8
9
|
|
|
9
10
|
const material = new MeshStandardNodeMaterial();
|
|
10
11
|
|
|
11
|
-
super( 'Standard Material',
|
|
12
|
-
|
|
13
|
-
this.title.setStyle( 'blue' );
|
|
12
|
+
super( 'Standard Material', 1, material );
|
|
14
13
|
|
|
15
14
|
this.setWidth( 300 );
|
|
16
15
|
|
|
@@ -18,6 +17,7 @@ export class StandardMaterialEditor extends ObjectNode {
|
|
|
18
17
|
const opacity = new LabelElement( 'opacity' ).setInput( 1 );
|
|
19
18
|
const metalness = new LabelElement( 'metalness' ).setInput( 1 );
|
|
20
19
|
const roughness = new LabelElement( 'roughness' ).setInput( 1 );
|
|
20
|
+
const position = new LabelElement( 'position' ).setInput( 3 );
|
|
21
21
|
|
|
22
22
|
color.add( new ColorInput( material.color.getHex() ).onChange( ( input ) => {
|
|
23
23
|
|
|
@@ -49,16 +49,19 @@ export class StandardMaterialEditor extends ObjectNode {
|
|
|
49
49
|
opacity.onConnect( () => this.update(), true );
|
|
50
50
|
metalness.onConnect( () => this.update(), true );
|
|
51
51
|
roughness.onConnect( () => this.update(), true );
|
|
52
|
+
position.onConnect(() => this.update(), true );
|
|
52
53
|
|
|
53
54
|
this.add( color )
|
|
54
55
|
.add( opacity )
|
|
55
56
|
.add( metalness )
|
|
56
|
-
.add( roughness )
|
|
57
|
+
.add( roughness )
|
|
58
|
+
.add( position );
|
|
57
59
|
|
|
58
60
|
this.color = color;
|
|
59
61
|
this.opacity = opacity;
|
|
60
62
|
this.metalness = metalness;
|
|
61
63
|
this.roughness = roughness;
|
|
64
|
+
this.position = position;
|
|
62
65
|
|
|
63
66
|
this.material = material;
|
|
64
67
|
|
|
@@ -68,19 +71,19 @@ export class StandardMaterialEditor extends ObjectNode {
|
|
|
68
71
|
|
|
69
72
|
update() {
|
|
70
73
|
|
|
71
|
-
const { material, color, opacity, roughness, metalness } = this;
|
|
72
|
-
|
|
73
|
-
color.setEnabledInputs( ! color.linkedExtra );
|
|
74
|
-
opacity.setEnabledInputs( ! opacity.linkedExtra );
|
|
75
|
-
roughness.setEnabledInputs( ! roughness.linkedExtra );
|
|
76
|
-
metalness.setEnabledInputs( ! metalness.linkedExtra );
|
|
74
|
+
const { material, color, opacity, roughness, metalness, position } = this;
|
|
77
75
|
|
|
78
|
-
|
|
76
|
+
color.setEnabledInputs( ! color.getLinkedObject() );
|
|
77
|
+
opacity.setEnabledInputs( ! opacity.getLinkedObject() );
|
|
78
|
+
roughness.setEnabledInputs( ! roughness.getLinkedObject() );
|
|
79
|
+
metalness.setEnabledInputs( ! metalness.getLinkedObject() );
|
|
79
80
|
|
|
80
|
-
material.
|
|
81
|
+
material.colorNode = color.getLinkedObject();
|
|
82
|
+
material.opacityNode = opacity.getLinkedObject() || null;
|
|
83
|
+
material.metalnessNode = metalness.getLinkedObject();
|
|
84
|
+
material.roughnessNode = roughness.getLinkedObject();
|
|
81
85
|
|
|
82
|
-
material.
|
|
83
|
-
material.roughnessNode = roughness.linkedExtra;
|
|
86
|
+
material.positionNode = position.getLinkedObject() || null;
|
|
84
87
|
|
|
85
88
|
material.dispose();
|
|
86
89
|
|
|
@@ -99,7 +102,7 @@ export class StandardMaterialEditor extends ObjectNode {
|
|
|
99
102
|
|
|
100
103
|
const { material, opacity } = this;
|
|
101
104
|
|
|
102
|
-
material.transparent = opacity.
|
|
105
|
+
material.transparent = opacity.getLinkedObject() || material.opacity < 1 ? true : false;
|
|
103
106
|
|
|
104
107
|
opacity.setIcon( material.transparent ? 'ti ti-layers-intersect' : 'ti ti-layers-subtract' );
|
|
105
108
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SelectInput, Element, LabelElement } from '../../libs/flow.module.js';
|
|
2
|
+
import { BaseNode } from '../core/BaseNode.js';
|
|
3
|
+
import { MathNode, Vector3Node } from '../../renderers/nodes/Nodes.js';
|
|
4
|
+
|
|
5
|
+
const DEFAULT_VALUE = new Vector3Node();
|
|
6
|
+
|
|
7
|
+
export class AngleEditor extends BaseNode {
|
|
8
|
+
|
|
9
|
+
constructor() {
|
|
10
|
+
|
|
11
|
+
const node = new MathNode( MathNode.SIN, DEFAULT_VALUE );
|
|
12
|
+
|
|
13
|
+
super( 'Angle', 1, node, 175 );
|
|
14
|
+
|
|
15
|
+
const optionsField = new SelectInput( [
|
|
16
|
+
{ name: 'Degrees to Radians', value: MathNode.RAD },
|
|
17
|
+
{ name: 'Radians to Degrees', value: MathNode.DEG }
|
|
18
|
+
], MathNode.RAD ).onChange( () => {
|
|
19
|
+
|
|
20
|
+
node.method = optionsField.getValue();
|
|
21
|
+
|
|
22
|
+
this.invalidate();
|
|
23
|
+
|
|
24
|
+
} );
|
|
25
|
+
|
|
26
|
+
const input = new LabelElement( 'A' ).setInput( 1 );
|
|
27
|
+
|
|
28
|
+
input.onConnect( () => {
|
|
29
|
+
|
|
30
|
+
node.aNode = input.getLinkedObject() || DEFAULT_VALUE;
|
|
31
|
+
|
|
32
|
+
} );
|
|
33
|
+
|
|
34
|
+
this.add( new Element().add( optionsField ) )
|
|
35
|
+
.add( input );
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
}
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LabelElement } from '../../libs/flow.module.js';
|
|
2
|
+
import { BaseNode } from '../core/BaseNode.js';
|
|
2
3
|
import { MathNode, FloatNode } from '../../renderers/nodes/Nodes.js';
|
|
3
4
|
|
|
4
5
|
const NULL_VALUE = new FloatNode();
|
|
5
6
|
|
|
6
|
-
export class DotEditor extends
|
|
7
|
+
export class DotEditor extends BaseNode {
|
|
7
8
|
|
|
8
9
|
constructor() {
|
|
9
10
|
|
|
10
11
|
const node = new MathNode( MathNode.DOT, NULL_VALUE, NULL_VALUE );
|
|
11
12
|
|
|
12
|
-
super( 'Dot Product', 1, node );
|
|
13
|
-
|
|
14
|
-
this.setWidth( 200 );
|
|
13
|
+
super( 'Dot Product', 1, node, 175 );
|
|
15
14
|
|
|
16
15
|
const aElement = new LabelElement( 'A' ).setInput( 3 );
|
|
17
16
|
const bElement = new LabelElement( 'B' ).setInput( 3 );
|
|
18
17
|
|
|
19
18
|
aElement.onConnect( () => {
|
|
20
19
|
|
|
21
|
-
node.aNode = aElement.
|
|
20
|
+
node.aNode = aElement.getLinkedObject() || NULL_VALUE;
|
|
22
21
|
|
|
23
22
|
} );
|
|
24
23
|
|
|
25
24
|
bElement.onConnect( () => {
|
|
26
25
|
|
|
27
|
-
node.bNode = bElement.
|
|
26
|
+
node.bNode = bElement.getLinkedObject() || NULL_VALUE;
|
|
28
27
|
|
|
29
28
|
} );
|
|
30
29
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SelectInput, LabelElement } from '../../libs/flow.module.js';
|
|
2
|
+
import { BaseNode } from '../core/BaseNode.js';
|
|
2
3
|
import { MathNode, FloatNode } from '../../renderers/nodes/Nodes.js';
|
|
3
4
|
|
|
4
5
|
const DEFAULT_VALUE = new FloatNode();
|
|
5
6
|
|
|
6
|
-
export class InvertEditor extends
|
|
7
|
+
export class InvertEditor extends BaseNode {
|
|
7
8
|
|
|
8
9
|
constructor() {
|
|
9
10
|
|
|
@@ -26,7 +27,7 @@ export class InvertEditor extends ObjectNode {
|
|
|
26
27
|
|
|
27
28
|
input.onConnect( () => {
|
|
28
29
|
|
|
29
|
-
node.aNode = input.
|
|
30
|
+
node.aNode = input.getLinkedObject() || DEFAULT_VALUE;
|
|
30
31
|
|
|
31
32
|
} );
|
|
32
33
|
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SelectInput, LabelElement, Element } from '../../libs/flow.module.js';
|
|
2
|
+
import { BaseNode } from '../core/BaseNode.js';
|
|
2
3
|
import { MathNode, FloatNode } from '../../renderers/nodes/Nodes.js';
|
|
3
4
|
|
|
4
5
|
const NULL_VALUE = new FloatNode();
|
|
5
6
|
|
|
6
|
-
export class LimiterEditor extends
|
|
7
|
+
export class LimiterEditor extends BaseNode {
|
|
7
8
|
|
|
8
9
|
constructor() {
|
|
9
10
|
|
|
10
|
-
const node = new MathNode( MathNode.
|
|
11
|
+
const node = new MathNode( MathNode.MIN, NULL_VALUE, NULL_VALUE );
|
|
11
12
|
|
|
12
|
-
super( 'Limiter', 1, node,
|
|
13
|
+
super( 'Limiter', 1, node, 175 );
|
|
13
14
|
|
|
14
15
|
const methodInput = new SelectInput( [
|
|
15
|
-
{ name: '
|
|
16
|
-
{ name: '
|
|
17
|
-
] );
|
|
16
|
+
{ name: 'Min', value: MathNode.MIN },
|
|
17
|
+
{ name: 'Max', value: MathNode.MAX }
|
|
18
|
+
], MathNode.MIN );
|
|
18
19
|
|
|
19
20
|
methodInput.onChange( ( data ) => {
|
|
20
21
|
|
|
@@ -29,17 +30,17 @@ export class LimiterEditor extends ObjectNode {
|
|
|
29
30
|
|
|
30
31
|
aElement.onConnect( () => {
|
|
31
32
|
|
|
32
|
-
node.aNode = aElement.
|
|
33
|
+
node.aNode = aElement.getLinkedObject() || NULL_VALUE;
|
|
33
34
|
|
|
34
35
|
} );
|
|
35
36
|
|
|
36
37
|
bElement.onConnect( () => {
|
|
37
38
|
|
|
38
|
-
node.bNode = bElement.
|
|
39
|
+
node.bNode = bElement.getLinkedObject() || NULL_VALUE;
|
|
39
40
|
|
|
40
41
|
} );
|
|
41
42
|
|
|
42
|
-
this.add( new
|
|
43
|
+
this.add( new Element().add( methodInput ) )
|
|
43
44
|
.add( aElement )
|
|
44
45
|
.add( bElement );
|
|
45
46
|
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LabelElement } from '../../libs/flow.module.js';
|
|
2
|
+
import { BaseNode } from '../core/BaseNode.js';
|
|
2
3
|
import { MathNode, Vector3Node } from '../../renderers/nodes/Nodes.js';
|
|
3
4
|
|
|
4
5
|
const DEFAULT_VALUE = new Vector3Node();
|
|
5
6
|
|
|
6
|
-
export class NormalizeEditor extends
|
|
7
|
+
export class NormalizeEditor extends BaseNode {
|
|
7
8
|
|
|
8
9
|
constructor() {
|
|
9
10
|
|
|
10
11
|
const node = new MathNode( MathNode.NORMALIZE, DEFAULT_VALUE );
|
|
11
12
|
|
|
12
|
-
super( 'Normalize', 3, node,
|
|
13
|
+
super( 'Normalize', 3, node, 175 );
|
|
13
14
|
|
|
14
|
-
const input = new LabelElement( '
|
|
15
|
+
const input = new LabelElement( 'A' ).setInput( 3 );
|
|
15
16
|
|
|
16
17
|
input.onConnect( () => {
|
|
17
18
|
|
|
18
|
-
node.aNode = input.
|
|
19
|
+
node.aNode = input.getLinkedObject() || DEFAULT_VALUE;
|
|
19
20
|
|
|
20
21
|
} );
|
|
21
22
|
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SelectInput, LabelElement, Element } from '../../libs/flow.module.js';
|
|
2
|
+
import { BaseNode } from '../core/BaseNode.js';
|
|
2
3
|
import { OperatorNode, FloatNode } from '../../renderers/nodes/Nodes.js';
|
|
3
4
|
|
|
4
5
|
const NULL_VALUE = new FloatNode();
|
|
5
6
|
|
|
6
|
-
export class OperatorEditor extends
|
|
7
|
+
export class OperatorEditor extends BaseNode {
|
|
7
8
|
|
|
8
9
|
constructor() {
|
|
9
10
|
|
|
10
11
|
const node = new OperatorNode( '+', NULL_VALUE, NULL_VALUE );
|
|
11
12
|
|
|
12
|
-
super( 'Operator', 1, node,
|
|
13
|
+
super( 'Operator', 1, node, 150 );
|
|
13
14
|
|
|
14
15
|
const opInput = new SelectInput( [
|
|
15
|
-
{ name: '+
|
|
16
|
-
{ name: '-
|
|
17
|
-
{ name: '*
|
|
18
|
-
{ name: '/
|
|
19
|
-
] );
|
|
16
|
+
{ name: 'Addition ( + )', value: '+' },
|
|
17
|
+
{ name: 'Subtraction ( - )', value: '-' },
|
|
18
|
+
{ name: 'Multiplication ( * )', value: '*' },
|
|
19
|
+
{ name: 'Division ( / )', value: '/' }
|
|
20
|
+
], '+' );
|
|
20
21
|
|
|
21
22
|
opInput.onChange( ( data ) => {
|
|
22
23
|
|
|
@@ -31,17 +32,17 @@ export class OperatorEditor extends ObjectNode {
|
|
|
31
32
|
|
|
32
33
|
aElement.onConnect( () => {
|
|
33
34
|
|
|
34
|
-
node.aNode = aElement.
|
|
35
|
+
node.aNode = aElement.getLinkedObject() || NULL_VALUE;
|
|
35
36
|
|
|
36
37
|
} );
|
|
37
38
|
|
|
38
39
|
bElement.onConnect( () => {
|
|
39
40
|
|
|
40
|
-
node.bNode = bElement.
|
|
41
|
+
node.bNode = bElement.getLinkedObject() || NULL_VALUE;
|
|
41
42
|
|
|
42
43
|
} );
|
|
43
44
|
|
|
44
|
-
this.add( new
|
|
45
|
+
this.add( new Element().add( opInput ) )
|
|
45
46
|
.add( aElement )
|
|
46
47
|
.add( bElement );
|
|
47
48
|
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LabelElement } from '../../libs/flow.module.js';
|
|
2
|
+
import { BaseNode } from '../core/BaseNode.js';
|
|
2
3
|
import { MathNode, FloatNode } from '../../renderers/nodes/Nodes.js';
|
|
3
4
|
|
|
4
5
|
const NULL_VALUE = new FloatNode();
|
|
5
6
|
|
|
6
|
-
export class PowerEditor extends
|
|
7
|
+
export class PowerEditor extends BaseNode {
|
|
7
8
|
|
|
8
9
|
constructor() {
|
|
9
10
|
|
|
10
11
|
const node = new MathNode( MathNode.POW, NULL_VALUE, NULL_VALUE );
|
|
11
12
|
|
|
12
|
-
super( 'Power', 1, node,
|
|
13
|
+
super( 'Power', 1, node, 175 );
|
|
13
14
|
|
|
14
15
|
const aElement = new LabelElement( 'A' ).setInput( 1 );
|
|
15
16
|
const bElement = new LabelElement( 'B' ).setInput( 1 );
|
|
16
17
|
|
|
17
18
|
aElement.onConnect( () => {
|
|
18
19
|
|
|
19
|
-
node.aNode = aElement.
|
|
20
|
+
node.aNode = aElement.getLinkedObject() || NULL_VALUE;
|
|
20
21
|
|
|
21
22
|
} );
|
|
22
23
|
|
|
23
24
|
bElement.onConnect( () => {
|
|
24
25
|
|
|
25
|
-
node.bNode = bElement.
|
|
26
|
+
node.bNode = bElement.getLinkedObject() || NULL_VALUE;
|
|
26
27
|
|
|
27
28
|
} );
|
|
28
29
|
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SelectInput, Element, LabelElement } from '../../libs/flow.module.js';
|
|
2
|
+
import { BaseNode } from '../core/BaseNode.js';
|
|
2
3
|
import { MathNode, Vector3Node } from '../../renderers/nodes/Nodes.js';
|
|
3
4
|
|
|
4
5
|
const DEFAULT_VALUE = new Vector3Node();
|
|
5
6
|
|
|
6
|
-
export class TrigonometryEditor extends
|
|
7
|
+
export class TrigonometryEditor extends BaseNode {
|
|
7
8
|
|
|
8
9
|
constructor() {
|
|
9
10
|
|
|
10
11
|
const node = new MathNode( MathNode.SIN, DEFAULT_VALUE );
|
|
11
12
|
|
|
12
|
-
super( 'Trigonometry', 1, node,
|
|
13
|
+
super( 'Trigonometry', 1, node, 175 );
|
|
13
14
|
|
|
14
15
|
const optionsField = new SelectInput( [
|
|
15
16
|
{ name: 'Sin', value: MathNode.SIN },
|
|
16
17
|
{ name: 'Cos', value: MathNode.COS },
|
|
17
|
-
{ name: 'Tan', value: MathNode.TAN }
|
|
18
|
-
|
|
18
|
+
{ name: 'Tan', value: MathNode.TAN },
|
|
19
|
+
|
|
20
|
+
{ name: 'asin', value: MathNode.ASIN },
|
|
21
|
+
{ name: 'acos', value: MathNode.ACOS },
|
|
22
|
+
{ name: 'atan', value: MathNode.ATAN }
|
|
23
|
+
], MathNode.SIN ).onChange( () => {
|
|
19
24
|
|
|
20
25
|
node.method = optionsField.getValue();
|
|
21
26
|
|
|
@@ -23,11 +28,11 @@ export class TrigonometryEditor extends ObjectNode {
|
|
|
23
28
|
|
|
24
29
|
} );
|
|
25
30
|
|
|
26
|
-
const input = new LabelElement( '
|
|
31
|
+
const input = new LabelElement( 'A' ).setInput( 1 );
|
|
27
32
|
|
|
28
33
|
input.onConnect( () => {
|
|
29
34
|
|
|
30
|
-
node.aNode = input.
|
|
35
|
+
node.aNode = input.getLinkedObject() || DEFAULT_VALUE;
|
|
31
36
|
|
|
32
37
|
} );
|
|
33
38
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LabelElement } from '../../libs/flow.module.js';
|
|
2
|
+
import { BaseNode } from '../core/BaseNode.js';
|
|
2
3
|
import { CheckerNode, UVNode } from '../../renderers/nodes/Nodes.js';
|
|
3
4
|
|
|
4
5
|
const DEFAULT_UV = new UVNode();
|
|
5
6
|
|
|
6
|
-
export class CheckerEditor extends
|
|
7
|
+
export class CheckerEditor extends BaseNode {
|
|
7
8
|
|
|
8
9
|
constructor() {
|
|
9
10
|
|
|
@@ -15,7 +16,7 @@ export class CheckerEditor extends ObjectNode {
|
|
|
15
16
|
|
|
16
17
|
field.onConnect( () => {
|
|
17
18
|
|
|
18
|
-
node.uvNode = field.
|
|
19
|
+
node.uvNode = field.getLinkedObject() || DEFAULT_UV;
|
|
19
20
|
|
|
20
21
|
} );
|
|
21
22
|
|