SgGroup
A container node that holds and organizes child scene objects. Allows hierarchical transformations and grouping of related elements. Useful for moving, rotating, or scaling multiple objects as a unit.
Inherits from
Usage
To use this class, add the following require at the top of your script:
Reference
create
Create a new group object in the scenegraph.
Parameters
selfoptions(table): A table of options to fill the parametersparent(SceneObject): The parent scene object to add this to
Returns
Promise: promise which will resolve to the created object
Example
-- Options can be omitted. This example shows the defaults,
-- only specify the ones you want different.
SgGroup.create({
active = true,
name = "",
transform = Transform.new(),
layers = {0},
tags = {},
receiveShadow = false,
castShadow = false
})
Properties
You can access these properties directly on the object or through :get("propertyName") or :set("propertyName", value) methods.
| Property | Type | Default | Description |
|---|---|---|---|
| active | Boolean | true | A Boolean attribute indicating whether the 3D object is active or not. When set to true, the object is considered active in the scene. |
| static | Boolean | false | A Boolean attribute indicating whether the 3D object is static or not. Static objects can and will never be transformed during runtime. |
| transform | Transform | Transform.new() | Specifies the transformation properties of the 3D object, including its position, rotation, and scale in the scene. |
| layers | Layers | [0] | Determines the layers the 3D object belongs to. Layers are used to organize objects in the scene for various purposes like rendering and interaction. |
| tags | Tags | [] | A list of tags associated with the 3D object. Tags are used for categorizing and identifying objects for scripting and scene management. |
| rendered | Boolean | true | Indicates if the 3D object is being rendered. |