Nebula
Containers

ContainerPlacement

Where a runtime container goes and what kind of container it is: its parent, its box, its authority and whether it gets its own physics frame.

generated from the sources
public struct ContainerPlacement

Where a runtime container goes and what kind of container it is: its parent, its box, its authority and whether it gets its own physics frame. This is what a lease row carries (LeaseInfo.Placement) and what NebulaWorker.RequestRuntimeContainer and ContainerRegistry.RegisterRuntime take.

A root (no ParentId) is placed in its scope: Center is absolute and kept in double, so a root far from the origin is placed exactly. A child is placed in its parent's frame: Center is local to the parent's origin and the box is axis-aligned in the parent's frame, so it moves and turns with the parent. See docs/container-tree.md.

A Bounds converts to a root placement, so every call that took an absolute box still compiles.

Fields

ParentId

public string ParentId;

The parent container's id, or empty for a root of its scope.

Center

public Double3 Center;

Box centre: absolute for a root, parent-local for a child.

Size

public Vector3 Size;

Box size, in the parent's frame.

Authority

public ContainerAuthority Authority;

Who simulates what is inside (ContainerAuthority); ContainerAuthority.Auto is leased.

OwnPhysicsFrame

public bool OwnPhysicsFrame;

The container gets a physics frame of its own (docs/container-tree.md §3).

FrameInterest

public FrameInterestMode FrameInterest;

How a framed container's contents are bucketed for interest (FrameInterestMode).

FrameApproachMargin

public float FrameApproachMargin;

For a frame with FrameInterestMode.OwnRegions: metres from its box within which a client in the space around it also looks into it (Container.FrameApproachMargin). 0 is off.

Properties

IsRoot

public bool IsRoot { get; }

No parent: the box is placed in its scope.

IsInherited

public bool IsInherited { get; }

Whether what is inside is simulated by the parent's owner rather than by a lease of its own.

Bounds

public Bounds Bounds { get; }

The box with its centre narrowed to float, as given (absolute for a root, local for a child).

Methods

Root

public static ContainerPlacement Root(Double3 center, Vector3 size, ContainerAuthority authority = ContainerAuthority.Auto);
public static ContainerPlacement Root(Bounds absolute);

A root box at an absolute centre.

Child

public static ContainerPlacement Child(string parentId, Vector3 localCenter, Vector3 size, ContainerAuthority authority = ContainerAuthority.Auto);

A child box, centred at localCenter in parentId's frame.

WithPhysicsFrame

public ContainerPlacement WithPhysicsFrame(FrameInterestMode interest = FrameInterestMode.WithCarrier, float approachMargin = 0f);

The same placement with its own physics frame.

implicit operator ContainerPlacement

public static implicit operator ContainerPlacement(Bounds absolute);

ToString

public override string ToString();

On this page