PortalWindow
One side's window of a portal (docs/portals.md D3, D20): the cross-section of the aperture grown by the portal's WindowMargin sideways and extruded WindowDepth into that side, an oriented box in the face's axes.
Nebula · Packages/com.1by3.nebula/Runtime/Protocol/PortalWindow.cspublic readonly struct PortalWindowOne side's window of a portal (docs/portals.md D3, D20): the cross-section of the aperture grown by the portal's WindowMargin sideways and extruded WindowDepth into that side, an oriented box in the face's axes. The near side's window is the part of the face's axes with z < 0, the far side's the part with z ≥ 0 (D2). Pure geometry, in double, built from a PortalRecord alone so the network gateway, which runs no game code, can decide who may look through a link (D21) and a client can learn what it was sent.
Constructors
PortalWindow
public PortalWindow(ulong scope, Double3 origin, Quaternion rotation, float halfWidth, float halfHeight, float depth, bool isNearSide);A window.
Properties
Scope
public ulong Scope { get; }The scope this window is in: the scope its face is in.
Origin
public Double3 Origin { get; }The face's origin, absolute in Scope.
Rotation
public Quaternion Rotation { get; }The face's axes in Scope.
HalfWidth
public float HalfWidth { get; }Half the window's width in the face's x axis: the aperture's plus the margin.
HalfHeight
public float HalfHeight { get; }Half the window's height in the face's y axis: the aperture's plus the margin.
Depth
public float Depth { get; }How far the window reaches into its side, in meters.
IsNearSide
public bool IsNearSide { get; }True for the near side, whose window is z ∈ [−Depth, 0] in the face's axes; false for the far side, z ∈ [0, Depth].
IsEmpty
public bool IsEmpty { get; }Whether the window has any volume. A portal whose depth is zero has no window and nobody looks through it.
Forward
public Vector3 Forward { get; }The face's +z axis in the scope's axes: the way from the near side into the far one.
Methods
ToLocal
public Double3 ToLocal(Double3 absolute);A point of the scope (absolute) in the face's axes, in double.
ToAbsolute
public Double3 ToAbsolute(Double3 local);A point in the face's axes as an absolute point of the scope.
Contains
public bool Contains(Double3 absolute);Whether an absolute point of Scope is inside the window. The box is closed: a point on its boundary is inside.
Bounds
public void Bounds(out Double3 min, out Double3 max);The smallest axis-aligned box of Scope's space that holds the window: what a region subscription and a container query are asked.
ToString
public override string ToString();