WebAR SDK vr1.5.3
  • Introduction
  • GETTING STARTED
    • SignUp and Get a License
    • Manage Your Licenses
    • Download WebAR SDK
    • Installing WebAR SDK
  • INTEGRATIONS
    • A-frame Integration
      • Build a Basic Surface Tracking Experience
      • Build a Marker Tracking Experience
      • Build an Advanced Portal Experience
    • Babylon.Js Integration
      • Build a Basic Surface Tracking Experience
      • Build a Basic Marker Tracking Experience
    • Unity Integration
      • Package Installation
      • Build a Basic Surface Tracking Experience
      • Build a Basic Marker Tracking Experience
      • Customize Loading Screen
      • Use Cases
      • Unity API References
    • PlayCanvas Integration
      • Build a Basic Surface Tracking Experience
      • Build a Basic Marker Tracking Experience
    • What Makes a Good Marker
  • API
    • API Ref 1.5.1
      • A-frame
      • SDK Configuration Properties
      • Functions
    • API Ref Unity
      • SDK Configuration Properties
      • Functions
    • API Customization
  • PUBLISH YOUR CREATION
    • Develop Locally
    • Launch the Experience
  • MORE INFORMATION
    • Pricing
    • Terms & Conditions
    • FAQs
  • Support
    • Contact Support
Powered by GitBook
On this page
  • StartTracking()
  • StopTracking()
  • GetTrackingStatus()
  • GetDetectedMarkerID()
  • GetLostMarkerID()
  • GetTrackingQuality()
  • GetSelectedTracking()
  • OnTrackingFoundCallBack()
  • OnTrackingLostCallBack()
  • GetCurrentPosition
  • GetCurrentScale
  • GetCurrentRotation
  • OnTrackingStarted()
  • OnTrackingStopped()
  1. API
  2. API Ref Unity

Functions

Refer various functions applicable for Unity integration

PreviousSDK Configuration PropertiesNextAPI Customization

Last updated 1 year ago

The WebAR’s functions are accessed through the global variableWEBARSDK, which is available after the WebAR SDK script has been loaded.

StartTracking()

Usage

WEBARSDK.StartTracking();
WEBARSDK.StartTracking(KeepARAfterLost);

Description

If the SDK script attribute auto-start is set to false, then the Surface Tracking experience has to be started manually by calling StartTracking() method. For example, this will be useful when the user has to be displayed some information only after the user clicks a button to enter into the Surface tracking experience.

If the user keeps the flag ‘keeARAfterLost’ to true, AR will move with the camera when tracking goes in lost mode, this can be used to implement the “peel-off” feature.

StopTracking()

Usage

WEBARSDK.StopTracking();
WEBARSDK.StopTracking(KeepARVisible);

Description

Surface Tracking experience has to be stopped manually by calling StopTracking() method. For example, this will be useful when the user has to be stop the tracking after a specific event .

keepARVisible = true, keeps AR object visible after user stops tracking. Default value is false.

GetTrackingStatus()

Usage

WEBARSDK.GetTrackingStatus();

Description

This API gives a callback once the surface tracking experience loads. It a return method and user will get the Status like TRACKING, TRACKED, STOPPED.

GetDetectedMarkerID()

Usage

WEBARSDK.GetDetectedMarkerID();

Description

This function is used to get the marker I of detected marker.

GetLostMarkerID()

Usage

WEBARSDK.GetLostMarkerID();

Description

This function will return a lost markerID or last detected marker ID.

GetTrackingQuality()

Usage

WEBARSDK.GetTrackingQuality();

Description

This function is defined for a Surface tracking and will return a tracking quality in HIGH, MEDIUM, LOW, LOST.

GetSelectedTracking()

Usage

WEBARSDK.GetSelectedTracking();

Description

This function is return an tracking method selected for current proejct(Surface Tracking, Marker Tracking)

OnTrackingFoundCallBack()

Usage

Description

On Target Found is an event attached to the WEBARSDK, user can subscribe any method and this will get execute after the tracking found.this will apply for both Marker Tracking as well as Surface Tracking

OnTrackingLostCallBack()

Usage

Description

On Target Lost is an event attached to the WEBARSDK, user can subscribe any method and this will get execute after the tracking Lost, this will apply for both Marker Tracking as well as Surface Tracking.

GetCurrentPosition

Usage

WEBARSDK.GetTransform().position;

Description

Returns the position of the stage/camera object based on attribute 'static-camera'. Please note that tracking assumes a Static-Camera-With-A-Moving-Stage by default. However, it can be changed to Moving-Camera-With-A-Static-Stage using attribute 'static-camera'.

GetCurrentScale

Usage

WEBARSDK.GetTransform().localScale;

Description

Returns the scale of the stage object.

GetCurrentRotation

Usage

WEBARSDK.GetTransform().rotation;

Description

Returns a rotation of the stage/camera object based on attribute'static-camera'. It is the orientation of stage/camera with respect to the world.

OnTrackingStarted()

Usage

Description

On Tracking Started is an event attached to the WEBARSDK, user can subscribe any method and this will get execute after the tracking started, this will apply for both Marker Tracking as well as Surface Tracking.

OnTrackingStopped()

Usage

Description

On Tracking Stopped is an event attached to the WEBARSDK, user can subscribe any method and this will get execute after the tracking stopped, this will apply for both Marker Tracking as well as Surface Tracking.

Blippar Documentation Centre
Example
Example
Example
Example