Ejemplo n.º 1
0
void
Camera::setViewUp(const vec3& value)
//[]---------------------------------------------------[]
//|  Set the camera's view up                           |
//[]---------------------------------------------------[]
{
  if (value.isNull())
    error("View up cannot be null");
  if (directionOfProjection.cross(value).isNull())
    error("View up cannot be parallel to DOP");

  vec3 vup = value.versor();

  if (viewUp != vup)
  {
    viewUp = vup;
    viewModified = true;
  }
}
Ejemplo n.º 2
0
void
Camera::setDirectionOfProjection(const vec3& value)
//[]---------------------------------------------------[]
//|  Set the direction of projection                    |
//|                                                     |
//|  Setting the direction of projection will not       |
//|  change the distance between the position and the   |
//|  focal point. The focal point will be moved along   |
//|  the direction of projection.                       |
//[]---------------------------------------------------[]
{
  if (value.isNull())
    error("Direction of projection cannot be null");

  vec3 dop = value.versor();

  if (directionOfProjection != dop)
  {
    directionOfProjection = dop;
    updateFocalPoint();
  }
}