Fancier way of logging the camera's parameters

This commit is contained in:
Eryn Wells 2014-08-03 20:12:00 -07:00
parent 5ac721d601
commit 08bd04d8da
2 changed files with 26 additions and 8 deletions

View file

@ -150,11 +150,19 @@ Camera::LookAt(const Vector3& pt)
}
std::string
Camera::GetTypeString()
const
{
return "GENERIC";
}
void
Camera::WriteType(std::ostream& ost)
const
{
ost << "UNKNOWN";
ost << GetTypeString();
}
#pragma mark - Perspective Camera
@ -190,11 +198,11 @@ PerspectiveCamera::compute_primary_ray(const int x,
}
void
PerspectiveCamera::WriteType(std::ostream& ost)
std::string
PerspectiveCamera::GetTypeString()
const
{
ost << "perspective";
return "perspective";
}
#pragma mark - Orthographic Camera
@ -239,11 +247,11 @@ OrthographicCamera::compute_primary_ray(const int x,
}
void
OrthographicCamera::WriteType(std::ostream& ost)
std::string
OrthographicCamera::GetTypeString()
const
{
ost << "orthographic";
return "orthographic";
}

View file

@ -336,7 +336,17 @@ void
Scene::LogCamera()
const
{
LOG_DEBUG << *mCamera;
const Camera& c = *mCamera;
LOG_DEBUG << "BEGIN CAMERA";
LOG_DEBUG << " type = " << c.GetTypeString();
LOG_DEBUG << " origin = " << c.GetOrigin();
LOG_DEBUG << " direction = " << c.get_direction();
LOG_DEBUG << " right = " << c.GetRight();
LOG_DEBUG << " up = " << c.GetUp();
LOG_DEBUG << " coordinate system is "
<< (c.IsLeftHanded() ? "left-handed" : "right-handed");
LOG_DEBUG << "END CAMERA";
}