Nebula
Containers

PortalFace

One side of a Portal (docs/portals.md D2): a scope, the container the face is fixed in, and a pose, an absolute Double3 position in that scope and a rotation.

generated from the sources
public readonly struct PortalFace

One side of a Portal (docs/portals.md D2): a scope, the container the face is fixed in, and a pose, an absolute Double3 position in that scope and a rotation. The face's +z axis is the way from the near scope into the far one: in its axes, z < 0 is the near side's region and z ≥ 0 the far side's.

As built, the pose is held in the scope's own absolute space (what ContainerRegistry.ToAbsolutePrecise gives, out of any physics frame the container is in) rather than in the container's local space, which is the form every crossing already compares in; the container is kept for ownership, lookup and the network gateway's rows.

Constructors

PortalFace

public PortalFace(ulong scope, string containerId, Double3 origin, Quaternion rotation);

A face.

Properties

Scope

public ulong Scope { get; }

The scope the face is in (Container.InstanceId; 0 is the public world).

ContainerId

public string ContainerId { get; }

The id of the container the face is fixed in; empty when it is not known yet.

Origin

public Double3 Origin { get; }

The face's origin, absolute in Scope.

Rotation

public Quaternion Rotation { get; }

The face's axes in Scope's space, normalised and rounded to 10⁻⁶ (docs/portals.md D37).

Forward

public Vector3 Forward { get; }

The way through, in the scope's axes.

Methods

ToLocal

public Double3 ToLocal(Double3 absolute);

A point of the scope (absolute) in the face's axes: the offset from the origin, turned back by the face's rotation, in double.

ToAbsolute

public Double3 ToAbsolute(Double3 local);

A point in the face's axes as an absolute point of the scope.

ToString

public override string ToString();

On this page