Log in or register to post comments

C# namespace unity3d

April 19, 2012 - 10:53pm #1

Hi,
I am trying to modify the default trackable event handler script, but I am new to C#, and more experienced with javascript. Anyway, I am wondering how to set the namespace and then how to call the getVideoBackgroundConfig from inside a class method.

From the docs, I see the function is
QCAR::Renderer::getInstance().getVideoBackgroundConfig();

but when I type in the following(below), I get an error(unity does not like "::"). Please advise

QCAR::VideoBackgroundConfig config = QCAR::Renderer::getInstance().getVideoBackgroundConfig();

Re: C# namespace unity3d

April 20, 2012 - 8:45am #2

The API docs are referencing the native Android/iOS SDK. That's C++ code, which is why it doesn't work in Unity. We are working on a similar set of docs for Unity.

In Unity, you can call this:

VideoBGCfgData config = QCARRenderer.Instance.GetVideoBackgroundConfig();

You can use this to find the position and size of the camera image on the screen. Note that in Unity all augmentations are drawn to a viewport that matches the size of the screen, even if the camera is drawn to a viewport that is slightly larger than the screen.

- Kim

Log in or register to post comments