Add Up and Right vectors to the camera
This commit is contained in:
parent
8336753bcf
commit
8eb98270af
1 changed files with 28 additions and 9 deletions
|
@ -14,7 +14,9 @@
|
||||||
Camera::Camera()
|
Camera::Camera()
|
||||||
: height(Vector3::Y),
|
: height(Vector3::Y),
|
||||||
width(4.0 / 3.0 * Vector3::X),
|
width(4.0 / 3.0 * Vector3::X),
|
||||||
direction(Vector3::Z)
|
direction(Vector3::Z),
|
||||||
|
mRight(1.33, 0, 0),
|
||||||
|
mUp(Vector3::Y)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,16 +79,33 @@ Camera::set_direction(const Vector3 &d)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
const Vector3&
|
||||||
* Camera::get_angle --
|
Camera::GetRight()
|
||||||
*
|
|
||||||
* Get the angle of view.
|
|
||||||
*/
|
|
||||||
float
|
|
||||||
Camera::get_angle()
|
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
return angle;
|
return mRight;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Camera::SetRight(const Vector3& right)
|
||||||
|
{
|
||||||
|
mRight = right;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Vector3&
|
||||||
|
Camera::GetUp()
|
||||||
|
const
|
||||||
|
{
|
||||||
|
return mUp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Camera::SetUp(const Vector3& up)
|
||||||
|
{
|
||||||
|
mUp = up;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Orthographic Camera
|
#pragma mark - Orthographic Camera
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue