nifti_user/ocu/src/ViewControllers/VirtualPTZViewController.cpp
void VirtualPTZViewController::updateOrientation(int currentX, int currentY)
                {
                    // Calculate distance from last position
                    int motionX = currentX - lastX;
                    int motionY = currentY - lastY;

                    // Move the camera accordingly
                    virtualPTZmsg.pan += motionX * PAN_SPEED * virtualPTZmsg.horizontalFov;
                    virtualPTZmsg.tilt += motionY * TILT_SPEED * virtualPTZmsg.horizontalFov;

                    // Ensures that the limits are not surpassed (left right are at infinity right now)
                    //if (virtualPTZmsg.pan >= MAX_LEFT)
                    //    virtualPTZmsg.pan = MAX_LEFT;
                    //else if (virtualPTZmsg.pan <= MAX_RIGHT)
                    //    virtualPTZmsg.pan = MAX_RIGHT;
                    if (virtualPTZmsg.tilt >= MAX_UP)
                        virtualPTZmsg.tilt = MAX_UP;
                    else if (virtualPTZmsg.tilt <= MAX_DOWN)
                        virtualPTZmsg.tilt = MAX_DOWN;
                }
/**
                 * This behaviour is not ideal if the user goes out of range while dragging,
                 * and comes back. todo To be improved.
                 * @param currentX
                 * @param currentY
                 */
This behaviour is not ideal if the user goes out of range while dragging,
and comes back. todo To be improved.
@param currentX
@param currentY
This behaviour is not ideal if the user goes out of range while dragging and comes back . todo To be improved . @param currentX @param currentY
void VirtualPTZViewController::updateOrientation(int currentX, int currentY)
                {
                    int motionX = currentX - lastX;
                    int motionY = currentY - lastY;
                    virtualPTZmsg.pan += motionX * PAN_SPEED * virtualPTZmsg.horizontalFov;
                    virtualPTZmsg.tilt += motionY * TILT_SPEED * virtualPTZmsg.horizontalFov;
                    if (virtualPTZmsg.tilt >= MAX_UP)
                        virtualPTZmsg.tilt = MAX_UP;
                    else if (virtualPTZmsg.tilt <= MAX_DOWN)
                        virtualPTZmsg.tilt = MAX_DOWN;
                }
void VirtualPTZViewController :: updateOrientation ( int currentX , int currentY ) { int motionX = currentX - lastX ; int motionY = currentY - lastY ; virtualPTZmsg . pan += motionX * PAN_SPEED * virtualPTZmsg . horizontalFov ; virtualPTZmsg . tilt += motionY * TILT_SPEED * virtualPTZmsg . horizontalFov ; if ( virtualPTZmsg . tilt >= MAX_UP ) virtualPTZmsg . tilt = MAX_UP ; else if ( virtualPTZmsg . tilt <= MAX_DOWN ) virtualPTZmsg . tilt = MAX_DOWN ; }
This behaviour is not ideal if the user goes out of range while dragging,
 and comes back.
This behaviour is not ideal if the user goes out of range while dragging and comes back .
// Calculate distance from last position
 // Move the camera accordingly
 // Ensures that the limits are not surpassed (left right are at infinity right now)
 //if (virtualPTZmsg.pan >= MAX_LEFT)
 //    virtualPTZmsg.pan = MAX_LEFT;
 //else if (virtualPTZmsg.pan <= MAX_RIGHT)
 //    virtualPTZmsg.pan = MAX_RIGHT;
