Capítulo 490 de 859

Chapter 490: StructTypeNode

Core Idea

Represents a struct type node in the node-based system. This class is used to define and manage the layout and types of struct members. It extends the base Node class and provides methods to get the length of the struct, retrieve member types, and generate the struct type for a builder.

Key Concepts

  • isStructTypeNode : boolean (readonly): This flag can be used for type testing.
  • membersLayout : Array.<{name: string, type: string, atomic: boolean}>: The layout of the members for the struct
  • name : string: The name of the struct.

Reference Tables

Constructor

Signature
new StructTypeNode( membersLayout : Object, name : string )

Properties

PropertyDescription
.isStructTypeNode : boolean (readonly)This flag can be used for type testing.
.membersLayout : Array.<{name: string, type: string, atomic: boolean}>The layout of the members for the struct
.name : stringThe name of the struct.

Methods

MethodDescription
.getLength() : numberReturns the length of the struct in 4-byte elements (e.g. float or int components). The length is calculated by summing the lengths of the struct's members, accounting for memory alignment. To get th…

Key Takeaways

  1. StructTypeNode extends: EventDispatcher → Node
  2. Most relevant properties: isStructTypeNode, membersLayout, name.
  3. Key methods: getLength.

Connects To