         // Reset grounded flag for next frame
         onGround = false;
     }
-}+}

    else
    {
        // Third person camera: position behind the character
        Vector3 aimPoint = characterNode.position + rot * Vector3(0.0f, 1.7f, 0.0f);

        // Collide camera ray with static physics objects (layer bitmask 2) to ensure we see the character properly
        Vector3 rayDir = dir * Vector3(0.0f, 0.0f, -1.0f);
        float rayDistance = CAMERA_MAX_DIST;
        PhysicsRaycastResult result = scene_.physicsWorld.RaycastSingle(Ray(aimPoint, rayDir), rayDistance, 2);
        if (result.body !is null)

//     - Manual control of a bone scene node
//     - Implementing 1st and 3rd person cameras, using raycasts to avoid the 3rd person camera clipping into scenery
//     - Saving and loading the variables of a script object
//     - Using touch inputs/gyroscope for iOS/Android (implemented through an external file)

#include "Scripts/Utilities/Sample.as"
#include "Scripts/Utilities/Touch.as"

const int CTRL_FORWARD = 1;
const int CTRL_BACK = 2;
