Class ConstructorSplat


public final class ConstructorSplat extends ConstructorCall
Represents the construction of a vector splat (broadcast), such as `float3(n)`.

These always contain exactly 1 scalar.

  • Method Details

    • make

      public static @NonNull Expression make(int position, @NonNull Type type, @NonNull Expression arg)
    • getKind

      public Node.ExpressionKind getKind()
      Specified by:
      getKind in class Expression
      See Also:
    • getConstantValue

      public @NonNull OptionalDouble getConstantValue(int i)
      Description copied from class: Expression
      Returns the i'th compile-time constant value within a literal or constructor. Indices which do not contain compile-time constant values will return empty. `vec4(1, vec2(2), 3)` contains four compile-time constants: (1, 2, 2, 3) `mat2(f)` contains four slots, and two are constant: (empty, 0, 0, empty)
      Overrides:
      getConstantValue in class ConstructorCall
    • copy

      public @NonNull Expression copy(int position)
      Specified by:
      copy in class Expression