ZGroup
16 items
- All (16)
- Constructors (1)
- Functions (6)
- Properties (9)
All
16constructorZGroup
constructor()
varchildren
@Transient open override var children: Array
An array of ZObjects that are children of this object, allowing for a hierarchical structure.
valhasParent
open val hasParent: Boolean
val isInitialized: Boolean
A boolean indicating whether the object has been initialized. This is set to true after the first call to initialize.
valisRoot
open val isRoot: Boolean
varname
var name: String
The name of the object. If not explicitly set, a default name is generated based on the object's type and ID.
valparent
open override val parent: ZObject?
A reference to the parent ZObject, if any. Null if the object has no parent, making it a root object.
valrefId
open override val refId: String
Represents the unique identifier for a reference-based component. The refId is used as a distinctive key for retrieving or linking this component within reference-dependent systems.
vartransform
var transform: ZTransform
An instance of ZTransform representing the object's position, rotation, and scale in the 3D space.
valtype
open override val type: ZObjectType
funaddChild
fun addChild(child: ZObject)
Adds a child object to this object, establishing a parent-child relationship. The child object will be rendered relative to this object's transform.
funinitialize
fun initialize(ctx: ZContext)
Initializes the object and its children, preparing them for rendering. This function should be called before the object is rendered for the first time. It sets the object's state to initialized and recursively initializes all child objects.
funlookAt
fun lookAt(look: ZVector3)
fun lookAt(look: ZVector3, up: ZVector3)
Adjusts the object's orientation so that it "looks at" a specified point in space.Adjusts the object's orientation so that it "looks at" a specified point in space, with a specified up direction. This changes the object's rotation to face the point, while aligning its up direction with the specified up vector.
fun onViewportResize(ctx: ZContext, width: Int, height: Int)
Event handler for the viewport resizing. This method should not be called by the user
funrender
fun render(ctx: ZContext)
Renders the object and its children to the screen. This function is responsible for drawing the object on the screen. It should be called every frame to update the object's appearance based on its current state and transformations.
funtranslate
fun translate(x: Float, y: Float, z: Float)
Moves the object by a specified amount along each axis. This changes the object's position based on the given x, y, and z offsets.
Constructors
1constructorZGroup
constructor()
Functions
6funaddChild
fun addChild(child: ZObject)
Adds a child object to this object, establishing a parent-child relationship. The child object will be rendered relative to this object's transform.
funinitialize
fun initialize(ctx: ZContext)
Initializes the object and its children, preparing them for rendering. This function should be called before the object is rendered for the first time. It sets the object's state to initialized and recursively initializes all child objects.
funlookAt
fun lookAt(look: ZVector3)
fun lookAt(look: ZVector3, up: ZVector3)
Adjusts the object's orientation so that it "looks at" a specified point in space.Adjusts the object's orientation so that it "looks at" a specified point in space, with a specified up direction. This changes the object's rotation to face the point, while aligning its up direction with the specified up vector.
fun onViewportResize(ctx: ZContext, width: Int, height: Int)
Event handler for the viewport resizing. This method should not be called by the user
funrender
fun render(ctx: ZContext)
Renders the object and its children to the screen. This function is responsible for drawing the object on the screen. It should be called every frame to update the object's appearance based on its current state and transformations.
funtranslate
fun translate(x: Float, y: Float, z: Float)
Moves the object by a specified amount along each axis. This changes the object's position based on the given x, y, and z offsets.
Properties
9varchildren
@Transient open override var children: Array
An array of ZObjects that are children of this object, allowing for a hierarchical structure.
valhasParent
open val hasParent: Boolean
val isInitialized: Boolean
A boolean indicating whether the object has been initialized. This is set to true after the first call to initialize.
valisRoot
open val isRoot: Boolean
varname
var name: String
The name of the object. If not explicitly set, a default name is generated based on the object's type and ID.
valparent
open override val parent: ZObject?
A reference to the parent ZObject, if any. Null if the object has no parent, making it a root object.
valrefId
open override val refId: String
Represents the unique identifier for a reference-based component. The refId is used as a distinctive key for retrieving or linking this component within reference-dependent systems.
vartransform
var transform: ZTransform
An instance of ZTransform representing the object's position, rotation, and scale in the 3D space.
valtype
open override val type: ZObjectType