Lineclass

Represents a line in 3D space.

objectLine
Namespace
global
Assembly
Sandbox.System
Declaration
public sealed struct Line

Constructors2

Showing 2 constructors

Methods7

Showing 7 methods

public float SqrDistance(Vector3 pos)PUBLIC

Returns closest squared distance from this line to given point.

ParameterTypeDescription
posVector3
Returns:float

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

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

ParameterTypeDescription
rayRayThe ray to test against.
radiusfloatRadius of this line, which essentially makes this a capsule, since direct line-to-line intersections are very improbable. Must be above 0.
maxDistance = 3.4028235E+38floatMaximum allowed distance from the origin of the ray to the intersection.
Returns:boolWhether there was an intersection or not.

Properties4

Showing 4 properties

public Vector3 Line.Center { get; set; }PUBLICGETSET

Returns the midpoint between a and b

Returns:Vector3

public Vector3 Line.Delta { get; set; }PUBLICGETSET

Returns the result of b - a

Returns:Vector3

public Vector3 Line.End { get; set; }PUBLICGETSET

End position of the line.

Returns:Vector3

public Vector3 Line.Start { get; set; }PUBLICGETSET

Start position of the line.

Returns:Vector3

On this page