Partilhar via


RayMeshGeometry3DHitTestResult.DistanceToRayOrigin Propriedade

Definição

Obtém a distância entre o ponto de interseção e a origem do raio no espaço de coordenada do Visual3D que iniciou o teste de clique.

public:
 virtual property double DistanceToRayOrigin { double get(); };
public override double DistanceToRayOrigin { get; }
member this.DistanceToRayOrigin : double
Public Overrides ReadOnly Property DistanceToRayOrigin As Double

Valor da propriedade

Double

O dobro que indica a distância entre o ponto de interseção e a origem do raio no espaço de coordenadas do qual iniciou o teste de Visual3D ocorrência.

Exemplos

O trecho de código a seguir lê essa propriedade.

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

Aplica-se a