I have a main menu with 10 submenus. Each submenu tracks other Trackables. The submenu "Nomen" ist the biggest one with nearly 150 different trackables. My problem at the moment is following.
If I start a submenu, everything runs well for 15 Trackables. After that the trackables will not detected anymore. If I go back to the main menu and start the submenu again, everything runs well again for the next 15 Trackables.
Is this a problem with the memory of the device?
Below the code!
THX for your help!
Max
var wtcFilePath = 'assets/adjektive.wtc';
var videoFilePathPrefix = 'assets/AdjektiveVideo';
var videoFileSuffix = '.mov';
//var cacheSize = 1;
var World = {
loaded: false,
init: function() {
// Momentaner aktiver Index (Target Index = Video Index)
World.currentTrackableIndex = 0;
// Momentan aktives Video
World.currentVideoUrl = '';
// Momentanes VideoDrawable
World.currentVideoDrawable = null;
// Tracker initialisieren mit .wtc file
this.tracker = new AR.ClientTracker(wtcFilePath, {
onLoaded: this.worldLoaded
});
// Trackable initialisieren
World.trackable = new AR.Trackable2DObject(this.tracker, '*', {
// Callback wenn Kamerasucher Target-Image erfasst (trackableIndex = Index des Targets im .wtc File)
onEnterFieldOfVision: function(trackableIndex) {
//alert(trackableIndex);
// Hat sich der Index verändert (anderes Target-Image)?
if (trackableIndex != World.currentTrackableIndex) {
Hi Markus, Your code snippet does not contain any call to a AR objects .destroy() function, so it might actually be the case that you're facing some kind of memory issue. Please keep in mind that you need to destroy any AR objects once you don't need it anymore. This is not done in the background for you, so you need to have a .destroy for each new.
Please try to update your implementation and post the outcome, so that we can discuss next steps if the problem still occurs.
Markus Streibl