function toggleSnappingFn() {

        if (World.appearingAnimation.isRunning()) {
            World.appearingAnimation.stop();
        }
        World.snapped = !World.snapped;
        World.trackable.snapToScreen.enabled = World.snapped;

        if (World.snapped) {
            World.applyLayout(World.layout.snapped);

        } else {
            World.applyLayout(World.layout.normal);
        }
    }
/*
        This function is used to either snap the trackable onto the screen or to detach it.
        World.trackable.snapToScreen.enabled is therefore used. Depending on the snap state a new layout for the
        position and size of certain drawables is set. To allow rotation and scale changes only in the snapped
        state, event handler are added or removed based on the new snap state.
    */
This function is used to either snap the trackable onto the screen or to detach it.
This function is used to either snap the trackable onto the screen or to detach it .
function toggleSnappingFn() {
        if (World.appearingAnimation.isRunning()) {
            World.appearingAnimation.stop();
        }
        World.snapped = !World.snapped;
        World.trackable.snapToScreen.enabled = World.snapped;
        if (World.snapped) {
            World.applyLayout(World.layout.snapped);
        } else {
            World.applyLayout(World.layout.normal);
        }
    }
function toggleSnappingFn ( ) { if ( World . appearingAnimation . isRunning ( ) ) { World . appearingAnimation . stop ( ) ; } World . snapped = ! World . snapped ; World . trackable . snapToScreen . enabled = World . snapped ; if ( World . snapped ) { World . applyLayout ( World . layout . snapped ) ; } else { World . applyLayout ( World . layout . normal ) ; } }
This function is used to either snap the trackable onto the screen or to detach it.
This function is used to either snap the trackable onto the screen or to detach it .