x


Name Spaces in C# and how to access external libraries

BACKGROUND

I have a free trial of unity pro, and am using QCAR augmented Reality. I am new to C#, (but well versed in JS), so I would appreciate some help using namespaces.

I want to use the method called projectPoint, described in the QCAR documentation here: https://ar.qualcomm.at/qdevnet/api . projectPoint usage is below:

QCAR_API Vec2F QCAR::Tool::projectPoint ( const CameraCalibration & calib, const Matrix34F & pose, const Vec3F & point )

QUESTION

How can I call this function inside C# script? And, what are the necessary imports/include(s)/namespace requirements?

PAST ATTEMPTS

Note, QCAR has been properly installed because the demo code from Qualcomm works fine. However, they don't use projectPoint or any similar function so I couldn't learn the usage from the samples.

I have tried and get the following errors:

  1. include QCAR (Error: QCAR is a type, not a namespace)
  2. using QCAR::Tool (Alias QCAR not found)

just executing the function in my C# class, I also get errors:

  1. QCAR.VideoMode videoMode = QCAR::CameraDevice.getInstance().getVideoMode(CameraDevice.MODE_DEFAULT); (The nested type VideoMode' does not exist in the typeQCAR')
  2. QCAR::VideoBackgroundConfig config = QCAR::Renderer::getInstance().getVideoBackgroundConfig(); (error CS1525: Unexpected symbol `::')
more ▼

asked Apr 14 '12 at 12:51 PM

rawatenator gravatar image

rawatenator
48 6 7 9

Could somebody please suggest how to improve this question...I'm getting stuck and don't know how to get around it

Apr 20 '12 at 04:27 AM rawatenator
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

The code in your question is all C++. Is it possible that you are trying to link/include a C++ library from C#?

If yes, then you would have to find a wrapper dll which exposes your QCAR-library to .NET. You could also write your wrapper library yourself if one does not exist.

This is just my best guess without knowing QCAR. :)

more ▼

answered Apr 20 '12 at 06:47 AM

senad gravatar image

senad
641 3 5

You are correct. I posted on the QCAR website and they said the same thing. I have to wait until the new QCAR docs come out for unity. Thanks.

Apr 20 '12 at 04:53 PM rawatenator
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x4148
x66
x52
x33
x24

asked: Apr 14 '12 at 12:51 PM

Seen: 848 times

Last Updated: Apr 20 '12 at 04:53 PM