Struct Rubikon.TraceResult ​
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Ray trace hit result with position, normal, and distance.
public record struct Rubikon.TraceResult : IEquatable<Rubikon.TraceResult>Implements ​
IEquatable<Rubikon.TraceResult>
Constructors ​
TraceResult(bool, Vector3, Vector3, float, int) ​
Ray trace hit result with position, normal, and distance.
public TraceResult(bool Hit, Vector3 HitPosition, Vector3 HitNormal, float Distance, int TriangleIndex)Parameters ​
Hit bool
HitPosition Vector3
HitNormal Vector3
Distance float
TriangleIndex int
TraceResult() ​
Initializes a default representing a miss at maximum distance.
public TraceResult()Properties ​
ContactPoint ​
Gets or sets the point of contact on the hit surface. For swept box traces this is the closest point on the hit triangle to the box center at the time of impact, while is the center of the swept shape itself.
public Vector3 ContactPoint { readonly get; set; }Property Value ​
Distance ​
public float Distance { readonly get; set; }Property Value ​
Hit ​
public bool Hit { readonly get; set; }Property Value ​
HitNormal ​
public Vector3 HitNormal { readonly get; set; }Property Value ​
HitPosition ​
public Vector3 HitPosition { readonly get; set; }Property Value ​
IsMinimalDistance ​
Did we hit something very close to the starting position?
public readonly bool IsMinimalDistance { get; }Property Value ​
IsValid ​
Gets or sets a value indicating whether the trace actually fired. false when the sweep was rejected (sub- length): the result is reported as a miss but carries no information about the geometry, so callers must not treat the sweep as validated.
public bool IsValid { readonly get; set; }Property Value ​
StartSolid ​
Gets or sets a value indicating whether the swept shape already overlapped geometry at the start position. When set, is 0 and the reported normal belongs to one arbitrary overlapping triangle.
public bool StartSolid { readonly get; set; }Property Value ​
TriangleIndex ​
public int TriangleIndex { readonly get; set; }Property Value ​
Methods ​
MinimizeWith(TraceResult) ​
Updates this if the other is closer. Returns true if updated.
public bool MinimizeWith(Rubikon.TraceResult other)Parameters ​
other Rubikon.TraceResult
Returns ​
StopsScanning(bool) ​
Whether shape scanning can stop at this result: the hit is as close as it can get, and if the trace is probing for start-solid, only an actual overlap qualifies - an exact-touch zero-distance hit must not mask an embedded shape tested later.
public readonly bool StopsScanning(bool detectStartSolid)Parameters ​
detectStartSolid bool

