s&box docs

public sealed struct Line

Represents a line in 3D space.

Broader workflow and conceptual references connected to this API.

Constructors

Showing 2 constructors

Methods

Showing 7 methods

public float SqrDistance(Vector3 pos)

Returns closest squared distance from this line to given point.

public bool Trace(Ray ray, float radius, float maxDistance = 3.4028235E+38)

Perform a "trace" between this line and given ray. If the 2 lines intersect, returns true.

Parameters

  • ray: The ray to test against.
  • radius: Radius of this line, which essentially makes this a capsule, since direct line-to-line intersections are very improbable. Must be above 0.
  • maxDistance: Maximum allowed distance from the origin of the ray to the intersection. Default: 3.4028235E+38

Returns

Whether there was an intersection or not.

Properties

Showing 4 properties

public Vector3 Line.Center { get; set; }

Returns the midpoint between a and b

public Vector3 Line.Delta { get; set; }

Returns the result of b - a

public Vector3 Line.End { get; set; }

End position of the line.

public Vector3 Line.Start { get; set; }

Start position of the line.

Metadata

FieldValue
Namespaceglobal
Typeclass
AssemblySandbox.System
Doc IDT:Line

On this page