ConditionalNode

Last modified: Aug 27, 2024

Represents a logical if/else statement. Can be used as an alternative to the If()/Else() syntax.

The corresponding TSL select() looks like so:

velocity = position.greaterThanEqual( limit ).select( velocity.negate(), velocity );
export {}

The select() method is called in a chaining fashion on a condition. The parameter nodes of select() determine the outcome of the entire statement.

Constructor

new ConditionalNode(condNode, ifNode, elseNode?)
ParameterTypeDefault Value
condNodeNode
ifNodeNode
elseNode?null | Nodenull

Constructs a new conditional node.

AccessorType

Properties

PropertyTypeDefault Value
condNodeNode
ifNodeNode
elseNodenull | Node
MethodType

Extends

Node

select

TSL function for creating a conditional node.

ParameterTypeDefault Value
condNodeNode
ifNodeNode
elseNode?Node

Returns

ConditionalNode