/// <summary> /// Obtain a ray in ECEF coordinates in a vertically downwards direction, and starting at a point high above the Earth's surface at the specified LatLong point. /// </summary> /// <param name="latLong">A LatLong point through which the vertical ray passes.</param> /// <returns>An ECEF ray.</returns> public DoubleRay LatLongToVerticallyDownRay(LatLong latLong) { var latLongInterop = latLong.ToLatLongInterop(); DoubleRay ray = NativeSpacesApi_LatLongToVerticallyDownRay(NativePluginRunner.API, ref latLongInterop); return(ray); }
/// <summary> /// Obtain a ray in ECEF coordinates from the current camera location and passing through the specified screen point. /// </summary> /// <param name="screenPoint">The screen point, in pixels, with screen origin bottom-left.</param> /// <returns>An ECEF ray.</returns> public DoubleRay ScreenPointToRay(Vector2 screenPoint) { var screenPointOriginTopLeft = new Vector2(screenPoint.x, Screen.height - screenPoint.y); DoubleRay ray = NativeSpacesApi_ScreenPointToRay(NativePluginRunner.API, ref screenPointOriginTopLeft); return(ray); }
public bool TryFindIntersectionWithBuilding(DoubleRay rayEcef, out LatLongAltitude out_intersectionPoint) { LatLongAltitudeInterop intersectionPointInterop; bool didIntersect = NativeBuildingsApi_TryFindIntersectionWithBuilding(NativePluginRunner.API, ref rayEcef.origin, ref rayEcef.direction, out intersectionPointInterop); out_intersectionPoint = intersectionPointInterop.ToLatLongAltitude(); return(didIntersect); }
/// <summary> /// Perform a ray intersection test against the currently streamed map features, returning true if the first intersection with the ray is a building. /// A suitable ray may be obtained with SpacesApi.ScreenPointToRay() or SpacesApi.LatLongToVerticallyDownRay(). /// </summary> /// <param name="rayEcef">A ray in ECEF coordinates.</param> /// <param name="out_intersectionPoint">The point of intersection of the ray and building, if any. The result is only valid if this method returns true.</param> /// <returns>True if the first intersection between the ray and map features is a building; /// false if no intersection is found, or if the ray first intersects with a map feature other than a building (for example, a tree).</returns> public bool TryFindIntersectionWithBuilding(DoubleRay rayEcef, out LatLongAltitude out_intersectionPoint) { return(m_apiInternal.TryFindIntersectionWithBuilding(rayEcef, out out_intersectionPoint)); }
/// <summary> /// Perform a ray intersection test against the currently streamed map features, returning true if the first intersection with the ray is a building. /// A suitable ray may be obtained with SpacesApi.ScreenPointToRay() or SpacesApi.LatLongToVerticallyDownRay(). /// </summary> /// <param name="rayEcef">A ray in ECEF coordinates.</param> /// <param name="out_intersectionPoint">The point of intersection of the ray and building, if any. The result is only valid if this method returns true.</param> /// <param name="out_intersectionNormal">The surface normal of the intersection, if any. The result is only valid if this method returns true.</param> /// <returns>True if the first intersection between the ray and map features is a building; /// false if no intersection is found, or if the ray first intersects with a map feature other than a building (for example, a tree).</returns> public bool TryFindIntersectionAndNormalWithBuilding(DoubleRay rayEcef, out LatLongAltitude out_intersectionPoint, out DoubleVector3 out_intersectionNormal) { return(m_apiInternal.TryFindIntersectionAndNormalWithBuilding(rayEcef, out out_intersectionPoint, out out_intersectionNormal)); }