Class: Scenegraph
Defined in: modules/engine/src/scenegraph/scenegraph.ts:43
One runtime scene with independently movable, batched asset placements.
Extends
Resource
Constructors
Constructor
new Scenegraph():
Scenegraph
Returns
Scenegraph
Inherited from
Resource.constructor
Properties
root
readonlyroot:GroupNode
Defined in: modules/engine/src/scenegraph/scenegraph.ts:45
Transform parent of the scene's placements.
Accessors
destroyed
Get Signature
get destroyed():
boolean
Defined in: modules/core/dist/api/adapter/resources/resource.d.ts:14
Whether destruction has completed, including when cleanup reported an error.
Returns
boolean
Inherited from
Resource.destroyed
ownedResources
Get Signature
get ownedResources(): readonly
Resource[]
Defined in: modules/core/dist/api/adapter/resources/resource.d.ts:12
A snapshot of this resource's children. Mutating the snapshot cannot change ownership.
Returns
readonly Resource[]
Inherited from
Resource.ownedResources
owner
Get Signature
get owner():
Resource|null
Defined in: modules/core/dist/api/adapter/resources/resource.d.ts:10
The resource responsible for destroying this resource, or null for caller-managed lifetime.
Returns
Resource | null
Inherited from
Resource.owner
Methods
[dispose]()
[dispose]():
void
Defined in: modules/core/dist/api/adapter/resources/resource.d.ts:18
Destroy the resource when leaving a using scope.
Returns
void
Inherited from
Resource.[dispose]
attachResource()
attachResource(
resource):void
Defined in: modules/core/dist/api/adapter/resources/resource.d.ts:24
Parameters
resource
Resource
Returns
void
Deprecated
Use resource.transferOwnershipTo(this).
Inherited from
Resource.attachResource
delete()
delete():
this
Defined in: modules/core/dist/api/adapter/resources/resource.d.ts:22
Returns
this
Deprecated
Use destroy().
Inherited from
Resource.delete
destroy()
destroy():
void
Defined in: modules/core/dist/api/adapter/resources/resource.d.ts:20
Destroy children before this resource. Subclasses implement hooks instead of overriding.
Returns
void
Inherited from
Resource.destroy
destroyAttachedResource()
destroyAttachedResource(
resource):void
Defined in: modules/core/dist/api/adapter/resources/resource.d.ts:28
Parameters
resource
Resource
Returns
void
Deprecated
Check resource.owner and call resource.destroy().
Inherited from
Resource.destroyAttachedResource
destroyAttachedResources()
destroyAttachedResources():
void
Defined in: modules/core/dist/api/adapter/resources/resource.d.ts:30
Returns
void
Deprecated
Destroy individually owned resources, or destroy the owner.
Inherited from
Resource.destroyAttachedResources
detachResource()
detachResource(
resource):void
Defined in: modules/core/dist/api/adapter/resources/resource.d.ts:26
Parameters
resource
Resource
Returns
void
Deprecated
Use resource.transferOwnershipTo(null). Only detaches a child owned by this.
Inherited from
Resource.detachResource
draw()
draw(
pass,view):number
Defined in: modules/engine/src/scenegraph/scenegraph.ts:65
Batch visible root placements by asset, composing the scene and placement transforms.
Parameters
pass
RenderPass
view
Returns
number
instantiate()
instantiate(
asset):GroupNode
Defined in: modules/engine/src/scenegraph/scenegraph.ts:50
Place a borrowed asset under the scene root. Destroy the returned group to remove it.
Parameters
asset
Returns
transferOwnershipTo()
transferOwnershipTo(
owner):this
Defined in: modules/core/dist/api/adapter/resources/resource.d.ts:16
Transfer exclusive ownership, or return lifetime responsibility to the caller with null.
Parameters
owner
Resource | null
Returns
this
Inherited from
Resource.transferOwnershipTo