player
LiG Player SDK for Android (tw.com.lig:player) renders LiG AR scenes with ARCore and Sceneform.
A host app detects a LigTag with the LiG scanner SDK, then hands the light's pose and lightId to the player. The player loads that light's scenes from the LiG cloud, downloads and caches each scene's assets, builds the scene's AR objects under a shared origin anchored to the LigTag, and runs the scene's events and actions. The host receives scene events through listeners on the shared context.
Where to start
LiGPlayerholds the SDK version and locale and exposes the sharedSceneFormContext.SceneFormContextis the entry point: set the access token, load the light's scenes, download and load one scene, attach its origin, then callvisibilityCheckWithevery frame andunloadwhen done.LiGCoordinateSystemturns a detected LigTag's pose into the scene origin's pose.
Requirements
ARCore is a
compileOnlydependency; the host app declares its own ARCore dependency.The Bluetooth shutter feature needs the host app to declare
ACCESS_FINE_LOCATIONandACCESS_COARSE_LOCATION.
Packages
The runtime for scene actions. Each action entry in a scene's JSON (a wire type id plus values) becomes a BaseAction subclass, such as move, rotate, fade, scale, play an animation, video or audio, show or hide, switch scene, or open a web page. Actions run on a node event in ActionGroups: groups run one after another by values.group, and the actions inside a group run concurrently on the main thread. Action types the player does not implement go to the host app through SceneFormContext.actionListener (NonLiGAction); UiAction and PanoramaAction hand off to their own listeners.
The core AR runtime. SceneFormContext loads a light's scenes from the LiG cloud, downloads and caches scene assets, builds the nodes under a shared origin, and passes scene events to the host through listeners. LiGScene is one playable scene. LiGArSceneView is an ArSceneView that sends taps to selectable nodes.
Data models and runtime wrappers for LiG scenes. The Gson payload classes cover the light and scene responses, scene objects, games, bot, user profile, light pose and navigation map. The runtime classes (ArObjectModel, ArEventModel, ArActionModel) turn parsed scene JSON into scene nodes, event triggers and executable actions. The enums decode the numeric model, event, action and vibration codes, and ProgressResponseBody and RetryInterceptor are the OkHttp helpers for download progress and retries.
Sceneform nodes that render the AR objects of a LiG scene. ArBaseNode is the base of every rendered object: it applies the object's transform, loads and caches its assets, wires its events to actions, and handles pinch and rotate gestures. Each subclass renders one AR object type: image planes, 3D models, video and live streams, shapes, snow, dashboards, recommendation boards and polyhedrons. The scene creates them from the scene JSON; integrators usually reach them through SceneFormContext.ligNodeMap to add listeners or control playback. The package also holds helper nodes for navigation (arrow and waypoint markers), debug origin axes and a particle emitter. Ar360BallNode, which renders 360° video, is currently declared without a package and appears in the root package.