RayMeshGeometry3DHitTestResult.DistanceToRayOrigin 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取相交点与射线原点在启动命中测试的 Visual3D 坐标空间中的距离。
public:
virtual property double DistanceToRayOrigin { double get(); };
public override double DistanceToRayOrigin { get; }
member this.DistanceToRayOrigin : double
Public Overrides ReadOnly Property DistanceToRayOrigin As Double
属性值
双精度值,指示相交点与射线原点在启动命中测试的 Visual3D 的坐标空间中的距离。
示例
以下代码摘录读取此属性。
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