Api (Class)

Namespace: Wrld

Fields

Name Type Description
Instance Api Single static instance of the Api class. Is used to access other APIs and methods.

Methods

void Create (String, CoordinateSystem, Transform, ConfigParams)

Initializes the API instance. This starts up the streaming system. Preferably, this should be called from within Awake() and before accessing the Api.Instance. Any subsequent calls to Api.Create will throw an exception.

Argument Type Description
apikey String Your WRLD API key
coordinateSystem CoordinateSystem The world space map behaviour. Cannot be changed once map is loaded.
parentTransformForStreamedObjects Transform Parent object to attach streamed objects to.
configParams ConfigParams Configuration data needed by the map when loading.

void StreamResourcesForCamera (Camera)

Calculates the ECEF origin point from the camera, builds up a frustum and updates these values in the native plugin which then uses this data to make streaming requests. This should be called once per frame in the Update() method.

Argument Type Description
camera Camera A Unity camera that can provide the frustum for streaming.

void StreamResourcesForBuiltInCamera (Camera)

Argument Type Description
camera Camera  

void Update ()

Updates Wrld map resources. Should be called once per frame in Unity Mono Update().

void Destroy ()

Uninitializes the API instance. This frees up any resources allocated by the plugins including all streamed meshes in the scene. Preferably, this should be called from within the OnApplicationQuit() method.

void SetOriginPoint (LatLongAltitude)

This function has different behaviour depending on the coordinate system in use. UnityWorld - Resets the root latitude and longitude of the map so that the local space origin (0,0,0) of the map’s game object is centered at that point. ECEF - Sets the maps world position to that latitude and longitude so that the camera is positioned at that point.

Argument Type Description
lla LatLongAltitude the latitude, longitude and altitude of the new point.

void OnApplicationPaused ()

void OnApplicationResumed ()

void UpdateCollisions (bool, bool, bool)

Allows you to enable or disable the generation of collision meshes for terrain, road and buildings when they stream in. This does not enable or disable collision meshes for terrain, road and buildings which have already streamed in.

Argument Type Description
terrain bool Whether to enable or disable the generation of collision meshes for terrain.
road bool Whether to enable or disable the generation of collision meshes for road.
buildings bool Whether to enable or disable the generation of collision meshes for buildings.

Properties

CameraApi CameraApi

Allows accessing the camera API endpoints to interact with the map.

CameraApi CameraApi { get; private set; } 

BuildingsApi BuildingsApi

Allows accessing the buildings API endpoints to interact with buildings on the map.

BuildingsApi BuildingsApi { get; private set; } 

IndoorMapsApi IndoorMapsApi

Allows access of the indoor map API endpoints to interact with indoor maps.

IndoorMapsApi IndoorMapsApi { get; private set; } 

GeographicApi GeographicApi

Allows accessing the geographic API endpoints to position objects on the map.

GeographicApi GeographicApi { get; private set; } 

SpacesApi SpacesApi

Allows accessing the SpacesAPI endpoints

SpacesApi SpacesApi { get; private set; } 

PositionerApi PositionerApi

Allows accessing the PositionerAPI endpoints

PositionerApi PositionerApi { get; private set; } 

EnvironmentFlatteningApi EnvironmentFlatteningApi

Allows access to the Environment flattening apis

EnvironmentFlatteningApi EnvironmentFlatteningApi { get; private set; } 

PrecacheApi PrecacheApi

Get accessor for the data precaching API

PrecacheApi PrecacheApi { get; private set; }