Example #1
0
  void Start()
  {
      // I beleive these are required setting to make adjustments to the ambient light in the scene. I could be wrong about that.
      GraphicsSettings.lightsUseLinearIntensity  = true;
      GraphicsSettings.lightsUseColorTemperature = true;
      // set up pixel format
        #if UNITY_EDITOR
      mPixelFormat = Image.PIXEL_FORMAT.GRAYSCALE; // Need Grayscale for Editor
        #else
      mPixelFormat = Image.PIXEL_FORMAT.RGB888;    // Use RGB888 for mobile
        #endif

      // API for getting Vuforia Callbacks as of Unity 2018.1.0f2.
      //The OnVuforiaStarted event is required for getting the camera pixel data for sure
      VuforiaARController.Instance.RegisterVuforiaStartedCallback(OnVuforiaStarted);
      // not sure if this is really needed but leaving in just to be safe
      VuforiaARController.Instance.RegisterOnPauseCallback(OnVuforiaPaused);
      //This behaves much like Update() - Most of the magic happens in OnTrackablesUpdated
      VuforiaARController.Instance.RegisterTrackablesUpdatedCallback(OnTrackablesUpdated);
      // not needed. just thought I'd leave it incase anybody needs to access these callbacks
      //  DeviceTrackerARController.Instance.RegisterTrackerStartedCallback(OnTrackerStarted);
      //  DeviceTrackerARController.Instance.RegisterDevicePoseStatusChangedCallback(OnDevicePoseStatusChanged);

      //text used for debugging
//        LightOutput1.text = "";
//        LightOutput2.text = "";
  }
Example #2
0
    void Start()
    {
        #if UNITY_EDITOR
        mPixelFormat = Image.PIXEL_FORMAT.GRAYSCALE; // Need Grayscale for Editor
        #else
        mPixelFormat = Image.PIXEL_FORMAT.RGB888;    // Use RGB888 for mobile
        #endif

        // Register Vuforia life-cycle callbacks:
        VuforiaARController.Instance.RegisterVuforiaStartedCallback(OnVuforiaStarted);
        VuforiaARController.Instance.RegisterTrackablesUpdatedCallback(OnTrackablesUpdated);
        VuforiaARController.Instance.RegisterOnPauseCallback(OnPause);
    }