Group
Groups child scene composables under a single transform. Everything declared inside content is parented to a hidden transform entity, so moving/rotating/scaling the Group moves the whole assembly as a unit. Children's own position/rotation/scale become local to the group, and groups themselves nest cleanly inside other groups.
Group(position = Position(2f, 0f, 0f), rotation = bodyRotation) {
Cube(material = body, size = 1.5f)
Cylinder(material = wheel, position = Position( 0.6f, -0.4f, 0f), radius = 0.2f, height = 0.1f)
Cylinder(material = wheel, position = Position(-0.6f, -0.4f, 0f), radius = 0.2f, height = 0.1f)
}Note: a light inside a Group is parented like any other child, so the group's translation moves it, and (by default) the typed lights re-aim their direction by the group's rotation each frame (followGroupRotation). Pass followGroupRotation = false to keep a light's aim fixed in world space while it still translates with the group.
Parameters
World-space position of the group's pivot (or local-space if this Group is itself nested inside another Group).
Rotation applied to the whole group.
Scale applied to the whole group.
Mesh-space pivot point that rotation/scale revolve around.
Whether the whole subtree is in the scene. False removes every child renderable (cheaply, keeping entities and state alive) — a show/hide toggle for the group.
Runs once when the group's transform entity is created, with the entity and engine in scope (EntityScope).
Scene composables placed under this group's transform.