World objects allow you to populate the app world with items that the player can interact with.
AR World Objects
In AR apps, world objects include any AR items (3D models, images, media) you add to your experience:
- Location AR objects are positioned at GPS coordinates.
- “Scene” AR objects are positioned relative to the user. If the device supports SLAM (ARKit, ARCore, etc.), the app will use this tracking to move the object around the scene. Otherwise, if location services are enabled, the app will use the device’s GPS information to position the objects.
- Marker AR objects use marker-based AR (like Vuforia) to attach AR objects
AR World Objects have a set of properties the control how they are rendered:
- Always face viewer: primarily useful for image and video, makes sure the object is always oriented facing the user.
- Distance variation
- Fixed: object is at a set distance from the player, similar to Pokemon Go
- Linear: object’s distance varies as the user moves closer/farther
- Distance range: if set, the distance is clamped to this range (e.g. no farther away than 5m, no closer than 1m, etc.)
- Distance scale: how does the item’s size scale with distance
- Visible range: defines the range inside of which the item can be seen. E.g., only show the item if the user is within 10m.
AR World objects are primarily managed through the ARWorld singleton. Each type of AR World object has a “world adapter” that handles the specific positioning. Each AR object is an instance of ARWorldObject which allows your code to work with AR objects no matter how they are created an positioned. ARTaskDriver, ObjectInspectorManager, and WorldObjectManager are good examples of classes that show the value of having a single treatment for all AR object types. You can monitor the state of ARWorldObjects and listen for a set of events:
- Visible – true if the object can be seen by its AR camera.
- Focus – a “focused” object is the object nearest to the center of the screen. Only one object is in focus at a time.
- Gaze – an object is being “gazed” at if it is the closest object directly in the center of the screen, determined by a raycast from its AR camera.
- Select – fired when the object is selected (usually because it has been tapped by the user). Only one object can be “selected” at a time.
- Click – fired any time the user taps an object on the screen.
Inspectors allow you to attach persistent content to an object. The inspectors are usually rendered on the screen canvas and not on the object itself which makes them easier to read. However, it would be quite straightforward to implement an inspector that was directly attached to the object in the scene.
Object Inspectors are handled by the ObjectInspectorManager singleton.
You can use Object Effects to change the state of world objects. Currently the only effect supported by the Motive SDK is animation. Because of Unity’s powerful animation system, however, animation effects give you a huge amount of control over objects in your app.
Object Effects are handled by the WorldObjectManager singleton.