Beispiel #1
0
void SphericalCamera::MoveFocusUp(double amount)
{
  double focusPos[3];
  GetFocusPosition(focusPos);
  focusPos[0] += amount * yAxis[0];
  focusPos[1] += amount * yAxis[1];
  focusPos[2] += amount * yAxis[2];
  SetFocusPosition(focusPos);
}
Beispiel #2
0
//////////////////////////////////////////////////////////////////////////
/// Adjust camera height. 
///
/// @param  height          - The new height. 
//////////////////////////////////////////////////////////////////////////
void Camera::AdjustCameraHeight(VCNFloat height)
{
  const Vector3& camPos = GetViewerPosition();
  const Vector3& camTarget = GetFocusPosition();

  const float oldViewerHeight = camPos.y;
  SetViewerPosition(Vector3(camPos.x, height, camPos.z));

  const float adjustHeight = height - oldViewerHeight;
  SetFocusPosition(Vector3(camTarget.x, camTarget.y + adjustHeight, camTarget.z));
}