What’s New in WRLD Unity SDK v0.6
This document will help you understand what’s new in the v0.6 release of the WRLD Unity SDK.
WRLD Unity SDK v0.6 Release Notes
Features
- Indoor Maps: Added displaying of indoor maps. Added
IndoorMapsApi
to allow developers to query and manipulate indoor maps, along with associated examples. - Positioning: Added
PositionerApi
to simplify placingGameObjects
on the WRLD map. See the updated “Fly Object Over Map” example. - Supported Unity versions: The WRLD Unity SDK now supports Unity Editor version 2017.3.1f1. The minimum Unity version supported remains at 5.5.0f3.
- Input: Touchscreen desktop devices can now use touch and mouse input simultaneously.
- Map Queries: Added
SpacesApi
, which provides API points that create geometric rays from screen or geographic coordinates. These can be used as parameters provided to other API points to query map objects, and perform ray-traces against the world. - Map Interaction: Added
EnvironmentFlatteningApi
, which provides controls to collapse the map in the vertical dimension.
Experimental Features
- Virtual Reality: Added support for Unity VR, with associated example. This has been successfully deployed on Oculus Rift, HTC Vive, and Google Cardboard. Other VR platforms supported by Unity VR are also likely to work, with some minor configuration.
- Augmented Reality: Added support for using the WRLD Unity SDK with AR platforms, with examples for ARKit and ARCore.
- Labels: Added support for displaying labels for road names, place names and indoor map entities. This is an experimental feature, disabled by default. There are currently known issues relating to the scaling of labels on some devices, resulting in displaying labels with incorrect size and incorrect occlusion resolution where labels overlap.
Backwards Compatibility Breaking Changes
- Building Highlights API: In order to support the querying of a richer set of information about buildings on maps, we have substantially revised the BuildingsApi. Updated examples can be found at https://docs.wrld3d.com/unity/latest/docs/examples/ under the “Buildings” section. See also detailed migration notes.
- Geographic Transform API: In order to support scaling transforms required by the new indoor maps and environment flattening features,
GeographicTransform
has been revised to create an additional parentGameObject
in the Unity scene hierarchy. Updated examples can be found at https://docs.wrld3d.com/unity/latest/docs/examples/ under the “Positioning” section. See also detailed migration notes.
Known Issues
- Android with Unity v5.5.0f3: intermittent runtime exception in Picking Buildings example, when picking multiple buildings in rapid succession. Only observed when deployed as standalone build on Android, and only when deployed from macOS or Windows from Unity editor version v5.5.0f3. This defect has not been observed when deployed using Unity v2017.3.1f1.
Migration Instructions
Migrating Buildings API from v0.5 to v0.6
Overview
In order to support the querying of a richer set of information about buildings on maps, we have substantially revised the Buildings API.
Please see the updated examples under the “Buildings” section on https://docs.wrld3d.com/unity/latest/docs/examples/ for code snippets that illustrate how to obtain information about a building at a particular latitude-longitude or screen-space location, and how to add a highlight to a building.
The following types that were present in v0.5 have been removed from the namespace Wrld.Resources.Buildings
:
public struct Building;
public struct Highlight;
The Building Highlight API now collaborates with the following public types, in the same namespace:
public class BuildingInformation;
public class BuildingDimensions;
public class BuildingContour;
public class BuildingHighlights;
public class BuildingHighlightOptions;
Highlighting a Building in v0.6
To highlight a building in v0.5, you would call HighlightBuildingAtLocation(LatLong, Material, HighlightReceivedCallback);
The HighlightReceivedCallback
would execute once the request for a highlight had completed, and it passed a success
boolean and a Highlight
object reference.
In v0.6, this has changed to provide greater flexibility and reliability. Now, you call BuildingHighlight.Create(BuildingHighlightOptions)
.
BuildingHighlightOptions
contains creation parameters for constructing a BuildingHighlight
object. It should be instantiated following the “Builder” pattern, like so:
BuildingHighlight.Create(
new BuildingHighlightOptions(),
.HighlightBuildingAtLocation(buildingLocation)
.Color(new Color(1.0f, 1.0f, 0.0f, 0.5f))
.BuildingInformationReceivedHandler(handler)
);
See the BuildingHighlightOptions
documentation for more parameters.
The BuildingInformationReceivedDelegate
replaces the HighlightReceivedCallback
, and only passes a BuildingHighlight
object reference. Success can be checked by testing if IsDiscarded()
is true on the BuildingHighlight
.
BuildingHighlight
replaces Highlight
, differentiating them from Indoor Map Highlights.
To clear a highlight, you now call Discard()
on the BuildingHighlight
you would like to remove, rather than calling a method in the BuildingsApi
.
Retrieving Building Information in v0.6
In v0.5, there was a Building
class which contained a basic set of information about a building.
In v0.6, this has been replaced with some new classes, which offer more detailed information.
BuildingInformation
can be retrieved from a BuildingHighlight
object. If you want to retrieve building information without creating a highlight, there is an InformationOnly()
parameter available for the BuildingHighlightOptions
builder.
BuildingInformation
provides access to BuildingDimensions
and BuildingContours
, along with the ID of the building.
BuildingDimensions
contains the information previously held in the Building
class.
BuildingContours
is a list of BuildingContour
objects, which represent a building (or part of a building) as a polygon with minimum and maximum altitudes.
Migrating Geographic Transform API from v0.5 to v0.6
Overview
There are new tools to help with placing objects upon the map. There are also some changes to existing tools. Updated examples can be found at https://docs.wrld3d.com/unity/latest/docs/examples/ under the “Positioning” section.
GeographicTransform in v0.6
We do not anticipate issues with most projects utilising GeographicTransform
objects. However, due to changes in the way that the GeographicTransform
manipulates the scene hierarchy, you may need to re-organize your scene and/or the structure of your prefabs.
This change has been made because Unity does not allow direct manipulation of Transform
matrices, so non-uniform scaling (such as environment flattening when entering an indoor map) must be performed by chaining multiple Transform
objects together. This allows the GeographicTransform
to behave appropriately when the environment has been flattened.