rhodonite
    Preparing search index...

    Class SceneGraphComponent

    SceneGraphComponent is a component that represents a node in the scene graph. It manages hierarchical relationships between entities and handles world matrix calculations.

    Hierarchy (View Summary)

    Index
    _addGizmoChild _copyFrom _destroy _getArrayLengthForAllocation _getPhysicsWorldScale _onPhysicsComponentAdded _onPhysicsComponentRemoved _shallowCopyFrom $load $logic addChild addThisComponentToEntity calcWorldMergedAABB calcWorldMergedAABBWithSkeletal castRay castRayFromScreen getLocalPositionOf getLocalPositionOfTo getPositionRestTo getPositionTo getQuaternionRecursively getQuaternionRecursivelyTo getRotationRest getRotationTo getTag getTagValue getWorldAABB getWorldAABBWithSkeletal getWorldPositionOf getWorldPositionOfTo hasTag isExistProcessStageMethod isJoint isWorldMatrixUpToDateRecursively logicForce matchTag matchTags matchTagsAsFreeStrings moveStageTo registerDependency removeChild removeTag setEulerAnglesToPhysics setIsBillboardRecursively setMatrixToPhysics setMatrixWithoutPhysics setPositionToPhysics setPositionWithoutPhysics setRotationToPhysics setRotationWithoutPhysics setScaleToPhysics setTransformGizmoSpace setVisibilityRecursively setWorldAABBDirtyParentRecursively setWorldMatrixDirty setWorldMatrixDirtyRecursively setWorldMatrixDirtyWithoutAABBDirty setWorldMatrixRestDirty setWorldMatrixRestDirtyRecursively submitToAllocation tryToSetTag tryToSetUniqueName unregister validateTagString _cleanupForEngine _getVariableLengthLocationMemberName _reset _updateTransformGizmosByCameraChange doesTheProcessStageMethodExist getArrayLengthOfMember getComponentCountPerBufferView getComponentTypeOfMember getCompositionTypeOfMember getLocationOffsetOfMemberOfComponent getMemberInfo getRnObject getRnObjectByName getStateVersion getTopLevelComponents getUpdateCount process registerMember searchByTag updateComponentsForRenderStage
    • Creates a new SceneGraphComponent instance.

      Parameters

      • engine: Engine

        The engine instance

      • entityUid: number

        The unique identifier of the entity this component belongs to

      • componentSid: number

        The component instance identifier

      • entityRepository: EntityRepository

        The entity repository managing this component

      • isReUse: boolean

        Whether this component is being reused

      Returns SceneGraphComponent

    __currentProcessStage: ProcessStageEnum = ProcessStage.Load
    __engine: Engine
    __entityRepository: EntityRepository

    the instance of EntityRepository

    __entityUid: number

    the entity unique Id which this component belongs to

    __isReUse: boolean = false
    __memoryManager: MemoryManager

    the instance of MemoryManager

    _isAlive: boolean = true
    _isCulled: boolean = false
    _tags: RnTags = {}

    Collection of tags associated with this object

    isRootJoint: boolean = false
    jointIndex: number = -1
    toMakeWorldMatrixTheSameAsLocalMatrix: boolean = false
    _processStages: ProcessStageEnum[] = ...
    _variableLengthLocationRadix: 65536

    The radix used to split the location of a variable-length array member into two floats (location = x * radix + y), so that both are exactly representable as 32-bit floats.

    currentMaxObjectCount: number = 0

    Current maximum object count for UID generation

    InvalidObjectUID: -1

    Invalid object UID constant

    • get _componentMemoryRegistry(): ComponentMemoryRegistry

      Gets the ComponentMemoryRegistry for this component's engine.

      Returns ComponentMemoryRegistry

    • get _hasPhysicsComponentInSubtree(): boolean
      Internal

      Returns whether this node or one of its descendants has a PhysicsComponent.

      Returns boolean

    • get children(): SceneGraphComponent[]

      Gets the child scene graph components of this node.

      Returns SceneGraphComponent[]

      An array of child scene graph components

    • get componentSID(): number

      Gets the Scoped ID of this Component instance. The SID is unique within the component type and represents the instance index.

      Returns number

      The component scoped ID

    • get componentTID(): number

      Gets the component type identifier for this instance.

      Returns number

      The component type ID

    • get entity(): ISceneGraphEntity

      Gets the entity which has this component.

      Returns ISceneGraphEntity

      The entity which has this component

    • get entityUID(): number

      Gets the unique ID of the entity that owns this component.

      Returns number

      The entity unique ID

    • get entityWorldMatrixWithSkeletalInner(): MutableMatrix44

      Gets the internal entity world matrix with skeletal animation applied.

      Returns MutableMatrix44

      The internal entity world matrix with skeletal transformations

    • get entityWorldWithSkeletalMatrix(): MutableMatrix44

      Gets the entity world matrix with skeletal animation applied.

      Returns MutableMatrix44

      A cloned copy of the entity world matrix with skeletal transformations

    • get eulerAngles(): Vector3

      Gets the world rotation as Euler angles.

      Returns Vector3

      The world rotation as Euler angles (in radians)

    • set eulerAngles(vec: IVector3): void

      Sets the world rotation using Euler angles and updates physics simulation if present.

      Parameters

      • vec: IVector3

        The Euler angles (in radians) to set

      Returns void

    • get isAABBGizmoVisible(): boolean

      Gets the visibility state of the AABB gizmo.

      Returns boolean

      True if the AABB gizmo is visible, false otherwise

    • set isAABBGizmoVisible(flg: boolean): void

      Sets the visibility of the AABB (Axis-Aligned Bounding Box) gizmo.

      Parameters

      • flg: boolean

        True to show the AABB gizmo, false to hide it

      Returns void

    • get isBillboard(): boolean

      Gets the billboard state of this scene graph node.

      Returns boolean

      True if billboard is enabled, false otherwise

    • set isBillboard(flg: boolean): void

      Sets the billboard state of this scene graph node.

      Parameters

      • flg: boolean

        True to enable billboard behavior, false to disable

      Returns void

    • get isJointGizmoVisible(): boolean

      Gets the visibility state of the joint gizmo.

      Returns boolean

      True if the joint gizmo is visible, false otherwise

    • set isJointGizmoVisible(flg: boolean): void

      Sets the visibility of the joint gizmo that visualizes skeletal joints.

      Parameters

      • flg: boolean

        True to show the joint gizmo, false to hide it

      Returns void

    • get isLocatorGizmoVisible(): boolean

      Gets the visibility state of the locator gizmo.

      Returns boolean

      True if the locator gizmo is visible, false otherwise

    • set isLocatorGizmoVisible(flg: boolean): void

      Sets the visibility of the locator gizmo.

      Parameters

      • flg: boolean

        True to show the locator gizmo, false to hide it

      Returns void

    • get isRotationGizmoVisible(): boolean

      Gets the visibility state of the rotation gizmo.

      Returns boolean

      True if the rotation gizmo is visible, false otherwise

    • set isRotationGizmoVisible(flg: boolean): void

      Sets the visibility of the rotation gizmo.

      Parameters

      • flg: boolean

        True to show the rotation gizmo, false to hide it

      Returns void

    • get isScaleGizmoVisible(): boolean

      Gets the visibility state of the scale gizmo.

      Returns boolean

      True if the scale gizmo is visible, false otherwise

    • set isScaleGizmoVisible(flg: boolean): void

      Sets the visibility of the scale gizmo.

      Parameters

      • flg: boolean

        True to show the scale gizmo, false to hide it

      Returns void

    • get isTopLevel(): boolean

      Checks if this node is at the top level (has no parent).

      Returns boolean

      True if this is a root node, false otherwise

    • get isTranslationGizmoVisible(): boolean

      Gets the visibility state of the translation gizmo.

      Returns boolean

      True if the translation gizmo is visible, false otherwise

    • set isTranslationGizmoVisible(flg: boolean): void

      Sets the visibility of the translation gizmo.

      Parameters

      • flg: boolean

        True to show the translation gizmo, false to hide it

      Returns void

    • get isVisible(): boolean

      Gets the visibility state of this scene graph node.

      Returns boolean

      True if visible, false if hidden

    • set isVisible(flg: boolean): void

      Sets the visibility of this scene graph node.

      Parameters

      • flg: boolean

        True to make visible, false to hide

      Returns void

    • get matrix(): MutableMatrix44

      Gets a clone of the world matrix.

      Returns MutableMatrix44

      A cloned copy of the world matrix

    • set matrix(matrix: MutableMatrix44): void

      Parameters

      Returns void

    • get matrixInner(): MutableMatrix44

      Gets the internal world matrix (mutable reference).

      Returns MutableMatrix44

      The internal world matrix

    • get matrixRest(): MutableMatrix44

      Gets a clone of the world matrix in rest pose.

      Returns MutableMatrix44

      A cloned copy of the world matrix in rest pose

    • get matrixRestInner(): MutableMatrix44

      Gets the internal world matrix in rest pose (mutable reference).

      Returns MutableMatrix44

      The internal world matrix in rest pose

    • get normalMatrix(): MutableMatrix33

      Gets a clone of the normal matrix.

      Returns MutableMatrix33

      A cloned copy of the normal matrix

    • get normalMatrixInner(): MutableMatrix33

      Gets the internal normal matrix (mutable reference).

      Returns MutableMatrix33

      The internal normal matrix

    • get objectUID(): number

      Gets the unique object identifier

      Returns number

      The object's UID

    • get parent(): SceneGraphComponent | undefined

      Gets the parent scene graph component of this node.

      Returns SceneGraphComponent | undefined

      The parent component, or undefined if this is a root node

    • get position(): MutableVector3

      Gets the world position of this node.

      Returns MutableVector3

      The world position

    • set position(vec: IVector3): void

      Sets the world position and updates physics simulation if present.

      Parameters

      • vec: IVector3

        The world position to set

      Returns void

    • get positionRest(): MutableVector3

      Gets the world position in rest pose.

      Returns MutableVector3

      The world position in rest pose

    • get rotation(): Quaternion

      Gets the world rotation as a quaternion.

      Returns Quaternion

      The world rotation quaternion

    • set rotation(quat: IQuaternion): void

      Sets the world rotation and updates physics simulation if present.

      Parameters

      Returns void

    • get rotationInner(): Quaternion

      Returns Quaternion

    • get rotationRest(): Quaternion

      Gets the world rotation in rest pose.

      Returns Quaternion

      The world rotation quaternion in rest pose

    • get scale(): MutableVector3

      Gets the world scale of this node.

      Returns MutableVector3

      The world scale vector

    • set scale(vec: IVector3): void

      Sets the world scale and updates physics simulation if present.

      Parameters

      Returns void

    • get uniqueName(): string

      Gets the unique name of this object

      Returns string

      The unique name string

    • get worldMatrixVersion(): number

      Gets the monotonically increasing world matrix version of this node. The value changes whenever the node is marked dirty, so summing it over a set of nodes detects whether any of them may need to be recomputed.

      Returns number

      The world matrix version

    • get worldMergedAABB(): AABB

      Gets the cached merged world AABB, recalculating if dirty.

      Returns AABB

      The merged world AABB of this node and all its descendants

    • get worldMergedAABBWithSkeletal(): AABB

      Gets the cached merged world AABB with skeletal animation, recalculating if dirty.

      Returns AABB

      The merged world AABB with skeletal transformations

    • get worldPosition(): Vector3

      Gets the world position of this node.

      Returns Vector3

      The world position as a Vector3

    • get componentTID(): 4

      Gets the Type ID of the Component class. This is overridden by concrete component classes to provide unique type identification.

      Returns 4

      The component type ID (default: 0)

    • get hierarchyVersion(): number

      Gets the version counter of the scene graph hierarchy. It changes whenever a parent-child relationship of any SceneGraphComponent may have changed.

      Returns number

      The hierarchy version counter

    • Adds a SceneGraph component as a gizmo child (internal use only).

      Parameters

      Returns void

    • Internal

      Copies tag data from another RnObject instance to this object

      Parameters

      • rnObject: RnObject

        The source RnObject to copy tags from

      Returns void

    • Destroys this component and cleans up resources.

      Returns void

    • Returns the array length to allocate for a variable-length array member of this component instance (see registerMember). Override this to allocate a per-instance size. When undefined is returned, the maximum array length registered for the component class is used.

      Parameters

      • _memberName: string

        The name of the variable-length array member

      Returns number | undefined

      The array length, or undefined to use the class-wide value

    • Internal

      Resolves world-scale magnitudes with signs relative to the entity's proper world rotation. Physics bodies use that rotation separately, so reflected local offsets need these signs.

      The returned vector is a shared reusable instance, so callers must copy it when they need to keep the values around.

      Parameters

      Returns IVector3

    • Internal

      Records that this entity acquired a PhysicsComponent.

      Returns void

    • Internal

      Records that this entity lost its PhysicsComponent.

      Returns void

    • Performs a shallow copy from another SceneGraphComponent.

      Parameters

      • component_: Component

        The source component to copy from

      Returns void

    • Loads the component and moves to the Logic stage.

      Returns void

    • Executes logic stage processing including matrix updates and gizmo updates.

      Returns void

    • Adds a SceneGraph component as a child of this node.

      Parameters

      • sg: SceneGraphComponent

        The SceneGraph component to add as a child

      • keepPoseInWorldSpace: boolean = false

        Whether to keep the child's world pose

      Returns void

    • Calculates the merged world AABB including all children.

      Returns AABB

      The merged world AABB of this node and all its descendants

    • Calculates the merged world AABB with skeletal animation including all children.

      Returns AABB

      The merged world AABB with skeletal transformations

    • Performs ray casting against all mesh components in this hierarchy.

      Parameters

      • srcPointInWorld: Vector3

        The ray origin point in world space

      • directionInWorld: Vector3

        The ray direction vector in world space (should be normalized)

      • dotThreshold: number = 0

        Threshold for triangle-ray intersection angle (default: 0)

      • ignoreMeshComponents: MeshComponent[] = []

        Array of mesh components to exclude from ray casting (default: [])

      Returns RaycastResultEx2

      Ray casting result containing intersection information

    • Performs ray casting from screen coordinates against all mesh components in this hierarchy.

      Parameters

      • x: number

        Screen x coordinate

      • y: number

        Screen y coordinate

      • camera: CameraComponent

        The camera component to use for screen-to-world projection

      • viewport: Vector4

        Viewport rectangle as Vector4 (x, y, width, height)

      • dotThreshold: number = 0

        Threshold for triangle-ray intersection angle (default: 0)

      • ignoreMeshComponents: MeshComponent[] = []

        Array of mesh components to exclude from ray casting (default: [])

      Returns RaycastResultEx2

      Ray casting result containing intersection information in world space

    • Transforms a world position to local space.

      Parameters

      • worldPosition: Vector3

        The position in world space

      Returns Vector3

      The position in local space

    • Transforms a world position to local space and stores the result in the output vector.

      Parameters

      • worldPosition: Vector3

        The position in world space

      • out: MutableVector3

        The output vector to store the result

      Returns Vector3

      The output vector containing the local position

    • Gets the world position in rest pose and stores it in the output vector.

      Parameters

      Returns MutableVector3

      The output vector containing the world position in rest pose

    • Gets the world position and stores it in the output vector.

      Parameters

      Returns MutableVector3

      The output vector containing the world position

    • Gets the world rotation quaternion by recursively combining local rotations. This allocates a new quaternion. Use getQuaternionRecursivelyTo when a pre-allocated output quaternion is available (e.g. in hot per-frame paths).

      Returns IQuaternion

      The world rotation quaternion

    • Gets the world rotation quaternion by recursively combining local rotations and stores the result in the given output quaternion without allocating.

      Parameters

      Returns IMutableQuaternion

      The output quaternion containing the world rotation

    • Gets the world rotation in rest pose with conditional termination.

      Parameters

      • endFn: (sg: SceneGraphComponent) => boolean

        Function to determine if recursion should stop at this node

      Returns Quaternion

      The world rotation quaternion in rest pose

    • Gets the world rotation and stores it in the output quaternion.

      Parameters

      Returns MutableQuaternion

      The output quaternion containing the world rotation

    • Retrieves a complete tag object (name and value) for the specified tag name

      Parameters

      • tagName: string

        The name of the tag to retrieve

      Returns Tag

      A Tag object containing the name and value

    • Retrieves the value associated with a specific tag name

      Parameters

      • tagName: string

        The name of the tag whose value to retrieve

      Returns any

      The tag value, or undefined if the tag doesn't exist

    • Gets the world-space AABB (Axis-Aligned Bounding Box) of this node.

      Returns AABB

      The world AABB of this node

    • Gets the world-space AABB with skeletal animation applied.

      Returns AABB

      The world AABB with skeletal transformations

    • Transforms a local position to world space.

      Parameters

      • localPosition: Vector3

        The position in local space

      Returns Vector3

      The position in world space

    • Transforms a local position to world space and stores the result in the output vector.

      Parameters

      • localPosition: Vector3

        The position in local space

      • out: MutableVector3

        The output vector to store the result

      Returns MutableVector3

      The output vector containing the world position

    • Checks whether this object has a tag with the specified name

      Parameters

      • tagName: string

        The name of the tag to check for

      Returns boolean

      True if the tag exists (value is not null/undefined), false otherwise

    • Checks whether the specified ProcessStage method exists in this Component instance. This is used to determine if this component can handle a particular process stage.

      Parameters

      Returns boolean

      True if the method exists, false otherwise

    • Checks if this node represents a skeletal joint.

      Returns boolean

      True if this is a joint (has a valid joint index), false otherwise

    • Checks if the world matrix is up-to-date recursively up the hierarchy.

      Returns boolean

      True if the world matrix is up-to-date for this node and all its ancestors

    • Returns void

    • Checks if this object has a tag with the specified name and value

      Parameters

      • tagName: string

        The tag name to match

      • tagValue: string

        The tag value to match

      Returns boolean

      True if the object has a matching tag, false otherwise

    • Checks if this object has all the specified tags with exactly matching values

      Parameters

      • tags: RnTags

        Object containing tag names as keys and expected values

      Returns boolean

      True if all specified tags exist with matching values, false otherwise

    • Checks if the object's combined tag string contains all the provided search strings. This allows for flexible searching within tag names and values.

      Parameters

      • stringArray: string[]

        Array of strings that must all be present in the combined tag string

      Returns boolean

      True if all strings are found in the combined tag string, false otherwise

    • Transitions the component to a different process stage. This affects which update methods will be called during the frame processing.

      Parameters

      Returns void

    • Registers a dependency relationship with another component. This method is intended for future use in managing component dependencies.

      Parameters

      Returns void

      This method is not used yet and needs implementation

    • Removes a child SceneGraph component from this node.

      Parameters

      Returns void

    • Removes a tag from this object

      Parameters

      • tagName: string

        The name of the tag to remove

      Returns void

    • Updates the physics simulation with the new Euler angles.

      Parameters

      • vec: IVector3

        The Euler angles (in radians) to set in physics

      Returns void

    • Sets the billboard state of this node and all its children recursively.

      Parameters

      • flg: boolean

        True to enable billboard behavior, false to disable

      Returns void

    • Parameters

      Returns void

    • Parameters

      Returns void

    • Updates the physics simulation with the new position.

      Parameters

      • vec: IVector3

        The world position to set in physics

      Returns void

    • Sets the world position without updating physics simulation.

      Parameters

      • vec: IVector3

        The world position to set

      Returns void

    • Updates the physics simulation with the new rotation.

      Parameters

      • quat: IQuaternion

        The quaternion rotation to set in physics

      Returns void

    • Sets the world rotation without updating physics simulation.

      Parameters

      Returns void

    • Updates the physics simulation with the new scale.

      Parameters

      • vec: IVector3

        The scale vector to set in physics

      Returns void

    • Sets the coordinate space for transformation gizmos.

      Parameters

      • space: "local" | "world"

        The coordinate space ('local' or 'world')

      Returns void

    • Sets the visibility of this node and all its children recursively.

      Parameters

      • flag: boolean

        True to make visible, false to hide

      Returns void

    • Recursively marks the world AABB as dirty up the parent hierarchy.

      Returns void

    • Marks the world matrix as dirty and propagates changes up the hierarchy.

      Returns void

    • Recursively marks the world matrix as dirty for this node and all children.

      Returns void

    • Marks the world matrix as dirty without checking if the AABB is dirty.

      Returns void

    • Marks the world matrix rest state as dirty and propagates to children.

      Returns void

    • Recursively marks the world matrix rest state as dirty for this node and all children.

      Returns void

    • Allocates memory for all member fields of this component instance. This method is called during component initialization to set up memory layout and allocate space for the specified number of entities.

      Parameters

      • componentCountPerBufferView: number

        The number of components per buffer view

      • isReUse: boolean

        Whether to reuse existing memory allocations

      Returns void

    • Attempts to set a tag on this object. If the tag already exists, it will be replaced.

      Parameters

      • tag: Tag

        The tag object containing the name and value to set

      Returns boolean

      True if the tag was successfully set, false if the tag name contains invalid characters

    • Attempts to set a unique name for this object

      Parameters

      • name: string

        The desired unique name

      • toAddNameIfConflict: boolean

        If true, appends UID to make name unique when conflicts occur; if false, fails on conflict

      Returns boolean

      True if the name was successfully set, false if there was a conflict and toAddNameIfConflict was false

    • Unregisters this object from all tracking collections. Should be called when the object is being destroyed.

      Returns void

    • Validates that a tag string contains only allowed characters (alphanumeric and underscore)

      Parameters

      • val: string

        The string to validate

      Returns boolean

      True if the string contains only valid characters, false if it contains invalid characters

    • Internal

      Cleans up static resources associated with the specified engine.

      Parameters

      • engine: Engine

        The engine instance to clean up resources for

      Returns void

    • Gets the name of the member which holds the location of a variable-length array member.

      Parameters

      • memberName: string

        The name of the variable-length array member

      Returns string

      The name of the location member

    • Internal

      Resets all static object tracking data. Used primarily for testing.

      Returns void

    • Internal

      Re-applies the screen-space gizmo scale after the camera has been updated.

      The transform gizmos keep a constant on-screen size, so they must be rescaled whenever the camera changes. SceneGraphComponent (TID 4) is processed before CameraComponent (TID 9) in the Logic stage, so this is called by the Engine right after the Logic stage has finished, which also covers frames in which the Engine skips the Logic stage entirely.

      Parameters

      • engine: Engine

        The engine whose current camera may have changed

      Returns void

    • Checks whether the specified ProcessStage method exists in the given Component class. This is used to determine if a component can handle a particular process stage.

      Parameters

      Returns boolean

      True if the method exists, false otherwise

    • Gets the array length of a specific member field in a component class.

      Parameters

      Returns Map<typeof Component, Map<string, number>>

      The array length map of the component

    • Gets the number of components per buffer view for the component.

      Parameters

      Returns Map<typeof Component, number>

      The number of components per buffer view for the component

    • Gets the ComponentType of a specific member field in a component class. This is useful for understanding the primitive data type of component members.

      Parameters

      • _engine: Engine
      • memberName: string

        The name of the member field

      • componentClass: typeof Component

        The component class to query

      Returns ComponentTypeEnum | undefined

      The ComponentType of the member or undefined if not found

    • Gets the CompositionType of a specific member field in a component class. This is useful for understanding the data structure of component members.

      Parameters

      • _engine: Engine
      • memberName: string

        The name of the member field

      • componentClass: typeof Component

        The component class to query

      Returns CompositionTypeEnum | undefined

      The CompositionType of the member or undefined if not found

    • Gets the pixel location offset in the buffer for a specific member of a component type. This is useful for GPU texture-based data access where locations are measured in pixels.

      Parameters

      • engine: Engine

        The engine instance

      • componentType: typeof Component

        The component class type

      • memberName: string

        The name of the member field

      Returns number[]

      The pixel location offset in the buffer

    • Gets the member info of the component. This is useful for getting the member info of the component.

      Parameters

      Returns Map<typeof Component, Map<string, MemberInfo>>

      The member info of the component

    • Retrieves an RnObject instance by its unique identifier

      Parameters

      • objectUid: number

        The unique identifier of the object to retrieve

      Returns RnObject | undefined

      The RnObject instance or undefined if not found or garbage collected

    • Retrieves an RnObject instance by its unique name

      Parameters

      • uniqueName: string

        The unique name of the object to retrieve

      Returns RnObject | undefined

      The RnObject instance or undefined if not found or garbage collected

    • Gets the state version of the component memory layout. This is incremented whenever the component's memory layout changes.

      Parameters

      • engine: Engine

        The engine instance

      Returns number

      The state version number

    • Gets all top-level scene graph components (nodes without parents).

      Returns SceneGraphComponent[]

      An array of scene graph components that are at the root level

    • Gets the update counter for scene graph components of the specified engine.

      Parameters

      • engine: Engine

        The engine instance to get the update count for

      Returns number

      The current update count for the specified engine

    • Processes all components of a given type for a specific process stage. This method iterates through all components of the specified type and calls their corresponding process stage method if they are in that stage.

      Parameters

      Returns void

    • Registers a member field of the component class for memory allocation. This method defines the memory layout and characteristics of component data members.

      Variable-length array members (isVariableLength: true) are allocated per instance with the length returned by _getArrayLengthForAllocation, instead of the fixed slot layout shared by the components of a buffer view. Shaders find the data through a Vec4 member named ${memberName}Location, which must be registered before the variable-length member.

      Parameters

      • this: typeof Component
      • bufferUse: {
            arrayLength?: number;
            bufferUse: EnumIO;
            componentSID?: number;
            componentType: ComponentTypeEnum;
            compositionType: CompositionTypeEnum;
            convertToBool?: boolean;
            dataClassType: DataClassType;
            initValues: number[] | VectorN;
            isVariableLength?: boolean;
            memberName: string;
            shaderType: EnumIO;
        }

        The intended purpose/type of buffer use

      Returns void

    • Searches for the first object that has a specific tag with the given value

      Parameters

      • tag: string

        The tag name to search for

      • value: string

        The tag value to match

      Returns WeakRef<RnObject> | undefined

      WeakRef to the first matching object, or undefined if not found

    • Updates components specifically for the render stage with render pass context. This method calls the sort_$render method of the component class to handle render-specific processing and sorting.

      Parameters

      Returns any

      The result of the sort_$render method