Table of Contents

Class HitTestResult

Namespace
HelixToolkit.SharpDX
Assembly
HelixToolkit.SharpDX.dll

Provides a hit test result.

public class HitTestResult : IComparable<HitTestResult>
Inheritance
HitTestResult
Implements
Derived
Inherited Members

Properties

Distance

Gets or sets the distance from the hit ray origin to the PointHit

public double Distance { get; set; }

Property Value

double

The distance.

Geometry

Gets or sets the geometry.

public Geometry3D? Geometry { get; set; }

Property Value

Geometry3D

The geometry.

IndiceStartLocation

Gets or sets the indice start location in indice list.

public int IndiceStartLocation { get; set; }

Property Value

int

The indice start location.

IsValid

Indicates if this Result has data from a valid hit.

public bool IsValid { get; set; }

Property Value

bool

ModelHit

Gets the Model3D intersected by the ray along which the hit test was performed. Model3D intersected by the ray.

public object? ModelHit { get; set; }

Property Value

object

NormalAtHit

The normal vector of the triangle hit.

public Vector3 NormalAtHit { get; set; }

Property Value

Vector3

PointHit

Gets the Point at the intersection between the ray along which the hit test was performed and the hit object. Point at which the hit object was intersected by the ray.

public Vector3 PointHit { get; set; }

Property Value

Vector3

Tag

This is a tag to add additional data.

public object? Tag { get; set; }

Property Value

object

TriangleIndices

The hitted triangle vertex indices.

public Tuple<int, int, int>? TriangleIndices { get; set; }

Property Value

Tuple<int, int, int>

Methods

CompareTo(HitTestResult?)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(HitTestResult? other)

Parameters

other HitTestResult

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

ShallowCopy(HitTestResult)

Shallow copy all the properties from another result.

public void ShallowCopy(HitTestResult result)

Parameters

result HitTestResult

The result.

ToString()

Get a descirption of the HitTestResult

public override string ToString()

Returns

string