ConditionalNode

Last modified: Sep 29, 2025

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 );

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.

AccessorTypeModifiers
get typestringstatic
MethodTypeModifiers

Extends

Node

select

ParameterTypeDefault Value
condNodeNode
ifNodeNode
elseNode?any

Returns

ConditionalNode