Log in or register to post comments

Flow of control in Dominoes

March 15, 2012 - 7:57am #1

Hey need some lil help in understanding the flow of control in Dominoes app..I could figure out the most of it..

The place where im stuck is the flow of program when user selects a domino.
->user selects one of the domino
->a delete button appears[I got why the delete button appears]

could you tel me how the augmented domino acts as a button..?
each domino acts like a button .. could you tel me how this works?
[You may give reference thru the flow of control in Dominoes.cpp]

Thank you

-Mukundan

Re: Flow of control in Dominoes

March 23, 2012 - 10:40am #5

Unfortunately right now you have to download the entire dataset, there is no way to add new targets to an existing dataset.

- Kim

Re: Flow of control in Dominoes

March 23, 2012 - 1:40am #4

Thank you Ksiva..That was enlightening and you had explained what i was actually looking for.

Hey i'd also like to know if there is a way to partially update the xml and dat file of the dataset after loading them.
The reason why im asking for this is, in the app we are working we have to have a dataset of 5 Mb to 6 mb of data.. It is going be updated on a adaily basis.

Im looking for any means to avoid the user from downloading the entire dataset again but just the updated trackables.
thank you

Re: Flow of control in Dominoes

March 15, 2012 - 7:32pm #3

Maybe you weren't asking about the virtual buttons though... If you're asking how the user selects a domino by tapping it, that is through the "picking" algorithm included in the sample. Picking is how a 2D screen point is projected into the scene to pick a 3D object.

Each domino has a picking transform that describes how to modify a unit cube to surround the domino. This cube becomes an object-oriented bounding box for collision detection. On each tap, the projectScreenPointToPlane function projects the tap point to the target plane. Then the checkIntersectionLine function checks to see if this line passes through any of the domino bounding boxes. If so, that domino is selected.

- Kim

Re: Flow of control in Dominoes

March 15, 2012 - 7:26pm #2

Only the "leading" domino acts like a button. A virtual button is dynamically placed under the first domino. The button is created in the onQCARInitializedNative method (addVirtualButton). In dropDomino, if the domino count is zero the button is moved under the newly added domino (moveVirtualButton). If that domino is later deleted (deleteSelectedDomino) the button is moved to the next domino.

Note that all of these button updates (adding, moving, etc.) are flagged to occur on the next call to QCAR_onUpdate. Virtual buttons can only be modified when the tracker is inactive and the dataset is deactivated. QCAR_onUpdate is called after each tracking phase is over for the frame, and the dataset is then deactivated in that method. Look for VirtualButton_UpdateCallback::QCAR_onUpdate.

- Kim

Log in or register to post comments