preact
This commit is contained in:
parent
6acf267d48
commit
b7614eb3f8
4794 changed files with 1280808 additions and 1546 deletions
35
frontend/node_modules/three/examples/jsm/nodes/utils/RotateUVNode.js
generated
vendored
Normal file
35
frontend/node_modules/three/examples/jsm/nodes/utils/RotateUVNode.js
generated
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import TempNode from '../core/TempNode.js';
|
||||
import { addNodeClass } from '../core/Node.js';
|
||||
import { addNodeElement, nodeProxy, vec2 } from '../shadernode/ShaderNode.js';
|
||||
|
||||
class RotateUVNode extends TempNode {
|
||||
|
||||
constructor( uvNode, rotationNode, centerNode = vec2( 0.5 ) ) {
|
||||
|
||||
super( 'vec2' );
|
||||
|
||||
this.uvNode = uvNode;
|
||||
this.rotationNode = rotationNode;
|
||||
this.centerNode = centerNode;
|
||||
|
||||
}
|
||||
|
||||
setup() {
|
||||
|
||||
const { uvNode, rotationNode, centerNode } = this;
|
||||
|
||||
const vector = uvNode.sub( centerNode );
|
||||
|
||||
return vector.rotate( rotationNode ).add( centerNode );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default RotateUVNode;
|
||||
|
||||
export const rotateUV = nodeProxy( RotateUVNode );
|
||||
|
||||
addNodeElement( 'rotateUV', rotateUV );
|
||||
|
||||
addNodeClass( 'RotateUVNode', RotateUVNode );
|
||||
Loading…
Add table
Add a link
Reference in a new issue