RayMeshGeometry3DHitTestResult.DistanceToRayOrigin Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the distance between the point of intersection and the ray's origin in the coordinate space of Visual3D which initiated the hit test.
public:
virtual property double DistanceToRayOrigin { double get(); };
public override double DistanceToRayOrigin { get; }
member this.DistanceToRayOrigin : double
Public Overrides ReadOnly Property DistanceToRayOrigin As Double
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.
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) + "%";
}
Public Sub UpdateResultInfo(ByVal rayMeshResult As RayMeshGeometry3DHitTestResult)
HitVisualInfo.Text = rayMeshResult.VisualHit.ToString()
HitModelInfo.Text = rayMeshResult.ModelHit.ToString()
HitMeshInfo.Text = rayMeshResult.MeshHit.ToString()
HitDistanceInfo.Text = rayMeshResult.DistanceToRayOrigin.ToString()
Vertex1Info.Text = (rayMeshResult.VertexWeight1 * 100) & "%"
Vertex2Info.Text = (rayMeshResult.VertexWeight2 * 100) & "%"
Vertex3Info.Text = (rayMeshResult.VertexWeight3 * 100) & "%"
End Sub
Applies to
Colaborar con nosotros en GitHub
El origen de este contenido se puede encontrar en GitHub, donde también puede crear y revisar problemas y solicitudes de incorporación de cambios. Para más información, consulte nuestra guía para colaboradores.