pub struct NodeRef(/* private fields */);Expand description
A handle on a node. Fluent TSL methods hang off this; see tsl.rs.
Implementations§
Source§impl NodeRef
impl NodeRef
Sourcepub fn uniform_flow(&self) -> NodeRef
pub fn uniform_flow(&self) -> NodeRef
node.uniformFlow() — see uniform_flow.
Sourcepub fn set_name(&self, name: &'static str) -> NodeRef
pub fn set_name(&self, name: &'static str) -> NodeRef
node.setName( name ). Three has two: on a uniform it is
UniformNode.setName(), which renames the node in place and returns
it, so every reference to the uniform takes name and a second
setName wins over the first. On any other node it is the method
chaining of the free set_name, a context.
Sourcepub fn label(&self, name: &'static str) -> NodeRef
👎Deprecated: three.js r179 renamed label() to setName(); use set_name
pub fn label(&self, name: &'static str) -> NodeRef
three.js r179 renamed label() to setName(); use set_name
node.label( name ) — deprecated in three for
set_name, with the same two forms.
Sourcepub fn to_vertex_stage(&self) -> NodeRef
pub fn to_vertex_stage(&self) -> NodeRef
node.toVertexStage() — see vertex_stage.
Source§impl NodeRef
impl NodeRef
Sourcepub fn to_float(&self) -> NodeRef
pub fn to_float(&self) -> NodeRef
x.toFloat() — TSLCore.js’ addMethodChaining( 'toFloat', float ).
Sourcepub fn to_mat3(&self) -> NodeRef
pub fn to_mat3(&self) -> NodeRef
x.toMat3() — from a mat4, NodeBuilder.format()’s column
narrowing.
Sourcepub fn determinant(&self) -> NodeRef
pub fn determinant(&self) -> NodeRef
m.determinant().
Sourcepub fn difference(&self, b: impl Into<NodeRef>) -> NodeRef
pub fn difference(&self, b: impl Into<NodeRef>) -> NodeRef
a.difference( b ).
Sourcepub fn face_forward(
&self,
i: impl Into<NodeRef>,
nref: impl Into<NodeRef>,
) -> NodeRef
pub fn face_forward( &self, i: impl Into<NodeRef>, nref: impl Into<NodeRef>, ) -> NodeRef
n.faceForward( i, nref ).
Sourcepub fn all(&self) -> NodeRef
pub fn all(&self) -> NodeRef
b.all() — MathNode.ALL, see super::all.
Sourcepub fn transform_normal_by_view_matrix(
&self,
view_matrix: impl Into<NodeRef>,
) -> NodeRef
pub fn transform_normal_by_view_matrix( &self, view_matrix: impl Into<NodeRef>, ) -> NodeRef
n.transformNormalByViewMatrix( viewMatrix ).
Sourcepub fn transform_normal(&self, matrix: impl Into<NodeRef>) -> NodeRef
pub fn transform_normal(&self, matrix: impl Into<NodeRef>) -> NodeRef
n.transformNormal( matrix ) — see transform_normal. Three’s
matrix defaults to modelWorldMatrix; pass model_world_matrix()
for its no-argument form.
Sourcepub fn transform_normal_by_inverse_view_matrix(
&self,
view_matrix: impl Into<NodeRef>,
) -> NodeRef
pub fn transform_normal_by_inverse_view_matrix( &self, view_matrix: impl Into<NodeRef>, ) -> NodeRef
n.transformNormalByInverseViewMatrix( viewMatrix ).
Sourcepub fn count_one_bits(&self) -> NodeRef
pub fn count_one_bits(&self) -> NodeRef
x.countOneBits().
Sourcepub fn count_trailing_zeros(&self) -> NodeRef
pub fn count_trailing_zeros(&self) -> NodeRef
x.countTrailingZeros().
Sourcepub fn count_leading_zeros(&self) -> NodeRef
pub fn count_leading_zeros(&self) -> NodeRef
x.countLeadingZeros().
Sourcepub fn remap(
&self,
in_low: impl Into<NodeRef>,
in_high: impl Into<NodeRef>,
out_low: impl Into<NodeRef>,
out_high: impl Into<NodeRef>,
) -> NodeRef
pub fn remap( &self, in_low: impl Into<NodeRef>, in_high: impl Into<NodeRef>, out_low: impl Into<NodeRef>, out_high: impl Into<NodeRef>, ) -> NodeRef
x.remap( inLow, inHigh, outLow, outHigh ) — Remap.js’
addMethodChaining( 'remap', remap ).
Sourcepub fn remap_clamp(
&self,
in_low: impl Into<NodeRef>,
in_high: impl Into<NodeRef>,
out_low: impl Into<NodeRef>,
out_high: impl Into<NodeRef>,
) -> NodeRef
pub fn remap_clamp( &self, in_low: impl Into<NodeRef>, in_high: impl Into<NodeRef>, out_low: impl Into<NodeRef>, out_high: impl Into<NodeRef>, ) -> NodeRef
x.remapClamp( inLow, inHigh, outLow, outHigh ).
Source§impl NodeRef
impl NodeRef
Sourcepub fn modulo(&self, other: impl Into<NodeRef>) -> NodeRef
pub fn modulo(&self, other: impl Into<NodeRef>) -> NodeRef
OperatorNode( '%' ) — integer remainder. (MathNode’s float mod
is mod_float, which lowers to a helper instead.)
Sourcepub fn less_than_equal(&self, other: impl Into<NodeRef>) -> NodeRef
pub fn less_than_equal(&self, other: impl Into<NodeRef>) -> NodeRef
a.lessThanEqual( b ) — a <= b.
Sourcepub fn greater_than(&self, other: impl Into<NodeRef>) -> NodeRef
pub fn greater_than(&self, other: impl Into<NodeRef>) -> NodeRef
a.greaterThan( b ) — a > b.
Sourcepub fn greater_than_equal(&self, other: impl Into<NodeRef>) -> NodeRef
pub fn greater_than_equal(&self, other: impl Into<NodeRef>) -> NodeRef
a.greaterThanEqual( b ) — a >= b.
Sourcepub fn shift_left(&self, other: impl Into<NodeRef>) -> NodeRef
pub fn shift_left(&self, other: impl Into<NodeRef>) -> NodeRef
a.shiftLeft( b ) — a << b.
Sourcepub fn shift_right(&self, other: impl Into<NodeRef>) -> NodeRef
pub fn shift_right(&self, other: impl Into<NodeRef>) -> NodeRef
a.shiftRight( b ) — a >> b.
Sourcepub fn atan2(&self, x: impl Into<NodeRef>) -> NodeRef
pub fn atan2(&self, x: impl Into<NodeRef>) -> NodeRef
y.atan( x ) — MathNode.ATAN with two arguments, which WGSL spells
atan2( y, x ). The receiver is the numerator, as in TSL.
Sourcepub fn saturate(&self) -> NodeRef
pub fn saturate(&self) -> NodeRef
saturate() — clamp( x, 0, 1 ), which three.js emits with vector
bounds when x is a vector.
Sourcepub fn pow3(&self) -> NodeRef
pub fn pow3(&self) -> NodeRef
pow3( x ) — MathNode’s POW3 is the multiplication chain
x * x * x, not a pow() call.
Sourcepub fn reciprocal(&self) -> NodeRef
pub fn reciprocal(&self) -> NodeRef
node.reciprocal() — 1.0 / node, which is how OperatorNode prints it.
Sourcepub fn clamp(&self, lo: impl Into<NodeRef>, hi: impl Into<NodeRef>) -> NodeRef
pub fn clamp(&self, lo: impl Into<NodeRef>, hi: impl Into<NodeRef>) -> NodeRef
x.clamp( lo, hi ) — MathNode.CLAMP.
Sourcepub fn mix(&self, a: impl Into<NodeRef>, b: impl Into<NodeRef>) -> NodeRef
pub fn mix(&self, a: impl Into<NodeRef>, b: impl Into<NodeRef>) -> NodeRef
adjustment.mix( a, b ) — see mix.
Sourcepub fn swizzle(&self, components: &'static str) -> NodeRef
pub fn swizzle(&self, components: &'static str) -> NodeRef
node[ components ] — the general form of .x / .xy / .rgb, for
when the component is chosen at build time.
Sourcepub fn set_z(&self, z: impl Into<NodeRef>) -> NodeRef
pub fn set_z(&self, z: impl Into<NodeRef>) -> NodeRef
vec4( node.x, node.y, z, node.w ) — SetNode for .setZ().
Sourcepub fn to(&self, ty: Type) -> NodeRef
pub fn to(&self, ty: Type) -> NodeRef
type( node ) — cast to another type, a no-op if node is already ty.
Sourcepub fn element(&self, index: usize) -> NodeRef
pub fn element(&self, index: usize) -> NodeRef
m.element( i ) — a matrix column, or a vector component.
Sourcepub fn element_node(&self, index: NodeRef) -> NodeRef
pub fn element_node(&self, index: NodeRef) -> NodeRef
array( … ).element( node ).
Sourcepub fn select(&self, a: impl Into<NodeRef>, b: impl Into<NodeRef>) -> NodeRef
pub fn select(&self, a: impl Into<NodeRef>, b: impl Into<NodeRef>) -> NodeRef
cond.select( a, b ).
Sourcepub fn flip_y(&self) -> NodeRef
pub fn flip_y(&self) -> NodeRef
.flipY() — FlipNode over the y component: vec2( v.x, 1.0 - v.y ).
FlipNode.generate() does not ask the usage counter for a temp, it
takes one unconditionally (builder.getVarFromNode( this )) and assigns
the source snippet into it, because it has to read two components of
the source and will not evaluate it twice. So the var here is explicit
rather than a needs_var promotion, and it is the flip’s var, not the
source’s.
Divergence, cosmetic (docs/nodes.md §8): three writes the flipped
component as the bare string 1.0 - v.y; the port builds it out of
sub, so it comes out parenthesised as ( 1.0 - v.y ). Same value,
two characters more.
Sourcepub fn flip_x(&self) -> NodeRef
pub fn flip_x(&self) -> NodeRef
.flipX() — FlipNode over the x component: vec2( 1.0 - v.x, v.y ).
Same var and same cosmetic parenthesisation as flip_y;
ReflectorNode’s default uv, screenUV.flipX(), is the caller.
Sourcepub fn context(&self, value: ContextValue) -> NodeRef
pub fn context(&self, value: ContextValue) -> NodeRef
node.context( { … } ) — see context.
Sourcepub fn to_varying(&self, name: &'static str) -> NodeRef
pub fn to_varying(&self, name: &'static str) -> NodeRef
node.toVarying( name ) — see to_varying.
Sourcepub fn add_assign(&self, value: impl Into<NodeRef>) -> NodeRef
pub fn add_assign(&self, value: impl Into<NodeRef>) -> NodeRef
target.addAssign( value ) — target = ( target + value ).
Sourcepub fn sub_assign(&self, value: impl Into<NodeRef>) -> NodeRef
pub fn sub_assign(&self, value: impl Into<NodeRef>) -> NodeRef
target.subAssign( value ) — target = ( target - value ).
Sourcepub fn mul_assign(&self, value: impl Into<NodeRef>) -> NodeRef
pub fn mul_assign(&self, value: impl Into<NodeRef>) -> NodeRef
target.mulAssign( value ) — target = ( target * value ).
Sourcepub fn div_assign(&self, value: impl Into<NodeRef>) -> NodeRef
pub fn div_assign(&self, value: impl Into<NodeRef>) -> NodeRef
target.divAssign( value ) — target = ( target / value ).