Collection of tags associated with this object
Static
Readonly
InvalidInvalid object UID constant
Static
currentCurrent maximum object count for UID generation
Gets the vertex handles associated with this primitive for GPU resources.
The vertex handles if they exist, otherwise undefined
Gets the component types of all vertex attributes.
An array of component types (Float, UnsignedByte, etc.)
Gets the composition types of all vertex attributes.
An array of composition types (Vec2, Vec3, Vec4, Scalar, etc.)
Gets an iterator for all attribute entries (semantic, accessor pairs).
An iterator over attribute map entries
Gets all vertex attribute semantic identifiers.
An array of all attribute semantic strings
Gets the current material assigned to this primitive.
The material currently in use
Sets the material for this primitive and updates rendering sort keys. The sort key is updated based on material properties for efficient rendering order.
The material to assign to this primitive
Gets the unique object identifier
The object's UID
Gets the version number of the position accessor. Used to track when position data has been updated.
The current position accessor version
Gets the primitive rendering mode.
The primitive mode enum (Triangles, TriangleStrip, etc.)
Gets the unique identifier for this primitive.
The primitive's UID
Gets the blend shape targets array.
The array of morph target attributes
Gets the unique name of this object
The unique name string
Gets the GPU resource handles for this primitive.
The vertex handles for GPU resources, or undefined if not created
Static
variantGets the current count of material variant updates across all primitives. This counter is incremented whenever material variants are modified.
The number of material variant updates since application start
Internal
Associates this primitive with a parent mesh. This establishes the hierarchical relationship between mesh and primitive.
The mesh that this primitive belongs to
Internal
Copies tag data from another RnObject instance to this object
The source RnObject to copy tags from
Performs ray casting against this primitive's geometry. Tests intersection between a ray and the triangles of this primitive.
The origin point of the ray
The direction vector of the ray (should be normalized)
Whether front-facing triangles can be hit
Whether back-facing triangles can be hit
Threshold for determining front/back face orientation
Whether to use face normals for culling
Ray casting result with intersection data or failure indication
Copies vertex data from a descriptor into this primitive. Creates appropriate buffers and accessors for the provided data.
Descriptor containing arrays of vertex data and configuration
Generates a line geometry with optional terminal markers at both endpoints. Creates a line between two points with small cross-shaped markers to indicate the start and end positions when hasTerminalMark is enabled.
Configuration object containing line parameters
Gets a specific vertex attribute by its semantic meaning.
The semantic identifier for the attribute
The accessor for the attribute, or undefined if not found
Gets a copy of the blend shape targets for this primitive.
A copy of the morph target array
Checks if this object has all the specified tags with exactly matching values
Object containing tag names as keys and expected values
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.
Array of strings that must all be present in the combined tag string
True if all strings are found in the combined tag string, false otherwise
Sets blend shape (morph) targets for this primitive. Blend shapes allow vertex animation by interpolating between target positions.
Array of attribute maps representing morph targets
Sets the vertex and index data for this primitive. This is the main method for configuring primitive geometry and rendering properties.
Map of vertex attributes with their semantic meanings
The primitive rendering mode (triangles, triangle strip, etc.)
Optional
material: MaterialOptional material to assign (uses default if not provided)
Optional
indicesAccessor: AccessorOptional index accessor for indexed rendering
Sets the index buffer for this primitive, enabling indexed rendering.
The accessor containing index data
Registers a material variant for this primitive with a specific name. Material variants allow switching between different materials at runtime.
The unique name for this material variant
The material to associate with the variant name
Updates the sort key by setting a specific bit range with a value. Sort keys are used to optimize rendering order for transparency and material batching.
The bit offset position where to start writing
The number of bits to write
The value to encode in the specified bit range
Sets or updates a vertex attribute for this primitive.
The accessor containing the attribute data
The semantic meaning of the attribute
Attempts to set a tag on this object. If the tag already exists, it will be replaced.
The tag object containing the name and value to set
True if the tag was successfully set, false if the tag name contains invalid characters
Attempts to set a unique name for this object
The desired unique name
If true, appends UID to make name unique when conflicts occur; if false, fails on conflict
True if the name was successfully set, false if there was a conflict and toAddNameIfConflict was false
Static
_resetStatic
createCreates a new primitive from a descriptor containing vertex data. This is a factory method that creates and initializes a primitive in one step.
The primitive descriptor with vertex data and configuration
A new primitive instance with the specified data
Static
getStatic
getStatic
getStatic
getStatic
getStatic
getStatic
searchSearches for the first object that has a specific tag with the given value
The tag name to search for
The tag value to match
WeakRef to the first matching object, or undefined if not found
A geometric shape class for creating line primitives with optional terminal markers. Extends IShape to provide line-specific geometry generation capabilities.