RayMeshGeometry3DHitTestResult.DistanceToRayOrigin Property

Definition

Gets the distance between the point of intersection and the ray's origin in the coordinate space of Visual3D which initiated the hit test.

C#
public override double DistanceToRayOrigin { get; }

Property Value

Double that indicates the distance between the point of intersection and the ray's origin in the coordinate space of Visual3D which initiated the hit test.

Examples

The following code excerpt reads this property.

C#
public void UpdateResultInfo(RayMeshGeometry3DHitTestResult rayMeshResult)
{
    HitVisualInfo.Text = rayMeshResult.VisualHit.ToString();
    HitModelInfo.Text = rayMeshResult.ModelHit.ToString();
    HitMeshInfo.Text = rayMeshResult.MeshHit.ToString();
    //HitMaterialInfo.Text = (rayMeshResult.ModelHit as GeometryModel3D).Material.GetType().Name;
    //HitMaterialBrushInfo.Text = ((rayMeshResult.ModelHit as GeometryModel3D).Material as DiffuseMaterial).Brush.ToString();
    HitDistanceInfo.Text = rayMeshResult.DistanceToRayOrigin.ToString();
    Vertex1Info.Text = (rayMeshResult.VertexWeight1 * 100) + "%";
    Vertex2Info.Text = (rayMeshResult.VertexWeight2 * 100) + "%";
    Vertex3Info.Text = (rayMeshResult.VertexWeight3 * 100) + "%";
}

Applies to

Proizvod Verzije
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10