protected override bool doSnap(DragEvent toPopulate, int snapToIndex)
    {
        Vector3 direction = snapTo[snapToIndex] - transform.localPosition;

        v      = direction.normalized * speed;
        speed += a * Time.deltaTime;

        //Populate event
        toPopulate.putParam(PARAM_VELOCITY, v);
        toPopulate.putParam(PARAM_OLD_P, transform.position);

        Vector3 desiredNewP;
        bool    retVal;

        if (v.magnitude * Time.deltaTime + 0.001 >= direction.magnitude)
        {
            desiredNewP = snapTo[snapToIndex];
            retVal      = true;
        }
        else
        {
            desiredNewP = (v * Time.deltaTime) + transform.localPosition;
            retVal      = false;
        }

        setPosition(desiredNewP);

        toPopulate.putParam(PARAM_DESIRED_NEW_P, desiredNewP);
        toPopulate.putParam(PARAM_NEW_P, transform.position);

        return(retVal);
    }
    protected override void doDrag(DragEvent toPopulate, Vector3 dragStartMousePosition, Vector3 currentMousePosition)
    {
        float dMouseX = currentMousePosition.x - dragStartMousePosition.x;
        float dMouseY = currentMousePosition.y - dragStartMousePosition.y;

        float dX = (dXPerDMouseX * dMouseX) + (dXPerDMouseY * dMouseY);
        float dY = (dYPerDMouseX * dMouseX) + (dYPerDMouseY * dMouseY);
        float dZ = (dZPerDMouseX * dMouseX) + (dZPerDMouseY * dMouseY);

        Vector3 oldP        = transform.localPosition;
        Vector3 desiredNewP = new Vector3(p.x + dX, p.y + dY, p.z + dZ);

        setPosition(desiredNewP);
        Vector3 newP = transform.localPosition;

        //Update velocity
        v = (newP - oldP) / Time.deltaTime;

        //Populate event
        toPopulate.putParam(PARAM_VELOCITY, this.isActive ? v : new Vector3(0, 0, 0));
        toPopulate.putParam(PARAM_DRAG_STRENGTH, (desiredNewP - oldP) / Time.deltaTime);
        toPopulate.putParam(PARAM_OLD_P, oldP);
        toPopulate.putParam(PARAM_DESIRED_NEW_P, desiredNewP);
        toPopulate.putParam(PARAM_NEW_P, this.isActive ? newP : oldP);
    }
    protected override void doDrag(DragEvent toPopulate, Vector3 dragStartMousePosition, Vector3 currentMousePosition)
    {
        Quaternion oldR        = transform.localRotation;
        Quaternion desiredNewR = Quaternion.Euler(getDirection(currentMousePosition).eulerAngles + dDragRotation);

        setRotation(desiredNewR);
        Quaternion newR = transform.localRotation;

        toPopulate.putParam(PARAM_OLD_R, oldR);
        toPopulate.putParam(PARAM_NEW_R, newR);
        toPopulate.putParam(PARAM_DESIRED_NEW_R, desiredNewR);
//		toPopulate.putParam(PARAM_D_ROTATION_X, dX);
//		toPopulate.putParam(PARAM_D_ROTATION_Y, dY);
//		toPopulate.putParam(PARAM_D_ROTATION_Z, dZ);
    }
    protected override void doDrag(DragEvent toPopulate, Vector3 dragStartMousePosition,
                                   Vector3 currentMousePosition)
    {
        //Vector3 mouseP = CameraController.instance.camera.cameraToWorldMatrix.MultiplyPoint(currentMousePosition);

        float dMouseX = currentMousePosition.x - dragStartMousePosition.x;
        float dMouseY = currentMousePosition.y - dragStartMousePosition.y;

        float fX = (fXPerDMouseX * dMouseX) + (fXPerDMouseY * dMouseY);
        float fY = (fYPerDMouseX * dMouseX) + (fYPerDMouseY * dMouseY);
        float fZ = (fZPerDMouseX * dMouseX) + (fZPerDMouseY * dMouseY);

        Vector3 force = new Vector3(fX, fY, fZ);

        this.constantForce.force = force;

        //Populate event
        toPopulate.putParam(PARAM_FORCE, force);
    }
    protected override void doDrag(DragEvent toPopulate, Vector3 dragStartMousePosition, Vector3 currentMousePosition)
    {
        float dMouseX = currentMousePosition.x - dragStartMousePosition.x;
        float dMouseY = currentMousePosition.y - dragStartMousePosition.y;

        float dX = (dXPerDMouseX * dMouseX) + (dXPerDMouseY * dMouseY);
        float dY = (dYPerDMouseX * dMouseX) + (dYPerDMouseY * dMouseY);
        float dZ = (dZPerDMouseX * dMouseX) + (dZPerDMouseY * dMouseY);

        Quaternion oldR        = transform.localRotation;
        Vector3    newRotation = getNewRotation(dX, dY, dZ);
        Quaternion desiredNewR = Quaternion.Euler(newRotation);

        setRotation(desiredNewR);
        Quaternion newR = transform.localRotation;

        toPopulate.putParam(PARAM_OLD_R, oldR);
        toPopulate.putParam(PARAM_NEW_R, newR);
        toPopulate.putParam(PARAM_DESIRED_NEW_R, desiredNewR);
        toPopulate.putParam(PARAM_D_ROTATION_X, dX);
        toPopulate.putParam(PARAM_D_ROTATION_Y, dY);
        toPopulate.putParam(PARAM_D_ROTATION_Z, dZ);
    }