Skip to content

Documentation / scene / ConstantVec4Node

Class: ConstantVec4Node

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:908

Constant 4D vector (vec4) value node

Extends

Constructors

Constructor

new ConstantVec4Node(): ConstantVec4Node

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:922

Creates a new constant vec4 node

Returns

ConstantVec4Node

Remarks

Initializes with [0, 0, 0, 0] and creates output slots for the full vector and individual components.

Overrides

BaseGraphNode.constructor

Properties

_inputs

protected _inputs: GraphNodeInput[]

Defined in: libs/scene/src/utility/blueprint/node.ts:336

Internal storage for input slot definitions

Inherited from

BaseGraphNode._inputs


_outputs

protected _outputs: GraphNodeOutput[]

Defined in: libs/scene/src/utility/blueprint/node.ts:338

Internal storage for output slot definitions

Inherited from

BaseGraphNode._outputs


_error

protected _error: string

Defined in: libs/scene/src/utility/blueprint/node.ts:340

Internal storage for error message

Inherited from

BaseGraphNode._error

Accessors

isUniform

Get Signature

get isUniform(): boolean

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:953

Gets whether this constant is exposed as a uniform parameter

Returns

boolean

Set Signature

set isUniform(val): void

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:956

Whether this node contains uniform value/texture

Parameters
val

boolean

Returns

void

Whether this node has uniform value

Overrides

BaseGraphNode.isUniform


paramName

Get Signature

get paramName(): string

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:967

Gets the uniform parameter name

Returns

string

Set Signature

set paramName(val): void

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:970

Uniform parameter name

Parameters
val

string

Returns

void

Uniform parameter name

Overrides

BaseGraphNode.paramName


x

Get Signature

get x(): number

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:980

Gets the x component of the vector

Returns

number

Set Signature

set x(val): void

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:983

Parameters
val

number

Returns

void


y

Get Signature

get y(): number

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:992

Gets the y component of the vector

Returns

number

Set Signature

set y(val): void

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:995

Parameters
val

number

Returns

void


z

Get Signature

get z(): number

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:1004

Gets the z component of the vector

Returns

number

Set Signature

set z(val): void

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:1007

Parameters
val

number

Returns

void


w

Get Signature

get w(): number

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:1016

Gets the w component of the vector

Returns

number

Set Signature

set w(val): void

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:1019

Parameters
val

number

Returns

void


inputs

Get Signature

get inputs(): GraphNodeInput[]

Defined in: libs/scene/src/utility/blueprint/node.ts:380

Gets the input slot definitions array

Returns

GraphNodeInput[]

Array of input slot definitions

Inherited from

SpriteBlockNode.inputs


outputs

Get Signature

get outputs(): GraphNodeOutput[]

Defined in: libs/scene/src/utility/blueprint/node.ts:384

Gets the output slot definitions array

Returns

GraphNodeOutput[]

Array of output slot definitions

Inherited from

BaseGraphNode.outputs


error

Get Signature

get error(): string

Defined in: libs/scene/src/utility/blueprint/node.ts:388

Gets the current error message

Returns

string

Set Signature

set error(str): void

Defined in: libs/scene/src/utility/blueprint/node.ts:391

Current error message, empty string if no error

Parameters
str

string

Returns

void

Current error message, empty string if no error

Inherited from

BaseGraphNode.error

Methods

on()

on<K>(type, listener, context?): void

Defined in: libs/base/dist/index.d.ts:594

IEventTarget.on

Type Parameters

K

K extends "changed"

Parameters

type

K

listener

EventListener<{ changed: []; }, K>

context?

unknown

Returns

void

Inherited from

BaseGraphNode.on


once()

once<K>(type, listener, context?): void

Defined in: libs/base/dist/index.d.ts:598

IEventTarget.once

Type Parameters

K

K extends "changed"

Parameters

type

K

listener

EventListener<{ changed: []; }, K>

context?

unknown

Returns

void

Inherited from

BaseGraphNode.once


off()

off<K>(type, listener?, context?): void

Defined in: libs/base/dist/index.d.ts:602

IEventTarget.off

Type Parameters

K

K extends "changed"

Parameters

type

K

listener?

EventListener<{ changed: []; }>

context?

unknown

Returns

void

Inherited from

BaseGraphNode.off


dispatchEvent()

dispatchEvent<K>(type, ...args): void

Defined in: libs/base/dist/index.d.ts:606

IEventTarget.dispatchEvent

Type Parameters

K

K extends "changed"

Parameters

type

K

args

...object[K]

Returns

void

Inherited from

BaseGraphNode.dispatchEvent


toString()

toString(): string

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:943

Generates a string representation of this node

Returns

string

The parameter name if uniform, otherwise comma-separated values

Remarks

Values are rounded to 3 decimal places for display purposes.

Overrides

BaseGraphNode.toString


getSerializationCls()

static getSerializationCls(): object

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:1034

Gets the serialization descriptor for this node type

Returns

object

Serialization class descriptor with property definitions

ctor

ctor: typeof ConstantVec4Node = ConstantVec4Node

name

name: string = 'ConstantVec4Node'

getProps()

getProps(): PropertyAccessor<object, "">[]

Returns

PropertyAccessor<object, "">[]

Remarks

Used by the serialization system to save/load node graphs. Includes an 'rgba' property for color picker integration with alpha channel.


validate()

protected validate(): string

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:1132

Validates the node state

Returns

string

Empty string (always valid)

Remarks

Constant nodes have no validation requirements.

Overrides

BaseGraphNode.validate


getType()

protected getType(id): "vec4" | "float"

Defined in: libs/scene/src/utility/blueprint/common/constants.ts:1141

Gets the output type for a specific output slot

Parameters

id

number

The output slot ID

Returns

"vec4" | "float"

'float' for component outputs (id > 1), 'vec4' for the full vector

Overrides

BaseGraphNode.getType


getOutputType()

getOutputType(id): string

Defined in: libs/scene/src/utility/blueprint/node.ts:376

Gets the output type for a specific output slot

Parameters

id

number

The output slot ID

Returns

string

The type name of the output

Remarks

Default implementation delegates to the abstract getType() method. Can be overridden for more complex type logic.

Inherited from

BaseGraphNode.getOutputType


check()

check(): void

Defined in: libs/scene/src/utility/blueprint/node.ts:413

Validates the node and updates error state

Returns

void

Remarks

Calls the validate() method and stores the result in _error. Emits a 'changed' event if the error state changes.

Inherited from

BaseGraphNode.check


reset()

reset(): void

Defined in: libs/scene/src/utility/blueprint/node.ts:422

Clears the error state

Returns

void

Remarks

Sets _error to an empty string.

Inherited from

BaseGraphNode.reset


setInput()

setInput(id, node, inputId): void

Defined in: libs/scene/src/utility/blueprint/node.ts:443

Connects an input slot to another node's output

Parameters

id

number

The input slot ID to connect

node

BaseGraphNode

The source node to connect from

inputId

number

The output slot ID of the source node

Returns

void

Throws

Error if the input slot with the given ID doesn't exist

Example

typescript
const addNode = new AddNode();
const constantNode = new ConstantNode(5.0);

// Connect constantNode's output 0 to addNode's input 0
addNode.setInput(0, constantNode, 0);

Inherited from

BaseGraphNode.setInput

Released under the MIT License.