- Sort Posts
- 6 replies
- Last post
You're welcome.
resolved
yes i had resolved in the same way.
assert(result->getType() == QCAR::TrackableResult::IMAGE_TARGET_RESULT);
const QCAR::ImageTargetResult* imageResult = static_cast<
const QCAR::ImageTargetResult*>(result);
const QCAR::ImageTarget& imageTarget = imageResult->getTrackable();
thanks a lot :)
Specifically for the code you
Specifically for the code you mention, the sample code I report here below compiles correcty, and you can use it as reference:
#include <QCAR/Trackable.h>
#include <QCAR/TrackableResult.h#include <QCAR/ImageTarget.h>
#include <QCAR/ImageTargetResult.h>
...
for(int tIdx = 0; tIdx < state.getNumTrackableResults(); tIdx++)
{
const QCAR::TrackableResult* result = state.getTrackableResult(tIdx);
const QCAR::ImageTargetResult* imageTargetResult = static_cast<const QCAR::ImageTargetResult*>(result);
const QCAR::Trackable& trackable = result->getTrackable();
const QCAR::ImageTarget& imageTarget = static_cast<const QCAR::ImageTarget&>(trackable);
Hi, Vuforia 2.0 has
Hi, Vuforia 2.0 has introduced some changes in the API;
these are explained in detail in the migration guide here:
https://developer.vuforia.com/resources/dev-guide/migrating-your-android-sdk-project
Note that the migration guide has three sections:
-one section about new API
-one section about modified API
-one section about how to migrate your code using Image Targets as a reference
I hope this will answer your questions.
cast not working
Re: How can I get defined width and height in xml of an trackabl
If you know your trackable is an ImageTarget you can cast it and call getSize:
QCAR::ImageTarget* imageTarget = static_cast<QCAR::ImageTarget*>(trackable); QCAR::Vec2F targetSize = imageTarget->getSize();
Make sure you add the ImageTarget.h include:
#include <QCAR/ImageTarget.h>
- Kim
You're welcome.