BuildingsApi (Class)

Namespace: Wrld.Resources.Buildings

Methods

BuildingHighlight CreateHighlight (BuildingHighlightOptions buildingHighlightOptions)

Create a BuildingHighlight object, for displaying graphical highlighting of a building, or for obtaining information about a building on the map. The method returns a BuildingHighlight object instance synchronously, but the result may not be initially populated with information about a building. Internally, an asynchronous web request may be made to fetch data, though locally cached results are used in some cases. Notification of the building information becoming available can be obtained by specifying a handler in the options parameter, via BuildingHighlightOptions.BuildingInformationReceivedHandler. BuildingHighlight.HasPopulatedBuildingInformation() can be called to query whether building information has yet been populated.

Returns: A new BuildingHighlight object.

Argument Type Description
buildingHighlightOptions BuildingHighlightOptions Creation options - see BuildingHighlightOptions for details.

bool TryFindIntersectionWithBuilding (DoubleRay rayEcef, out LatLongAltitude out_intersectionPoint)

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().

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).

Argument Type Description
rayEcef DoubleRay A ray in ECEF coordinates.
out_intersectionPoint LatLongAltitude The point of intersection of the ray and building, if any. The result is only valid if this method returns true.

bool TryFindIntersectionAndNormalWithBuilding (DoubleRay rayEcef, out LatLongAltitude out_intersectionPoint, out DoubleVector3 out_intersectionNormal)

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().

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).

Argument Type Description
rayEcef DoubleRay A ray in ECEF coordinates.
out_intersectionPoint LatLongAltitude The point of intersection of the ray and building, if any. The result is only valid if this method returns true.
out_intersectionNormal DoubleVector3 The surface normal of the intersection, if any. The result is only valid if this method returns true.
v0.8.17