def test_init(self): c = Camera() self.assertEqual(c.pitch, angle.rad(0)) self.assertEqual(c.yaw, angle.rad(0)) self.assertEqual(c.roll, angle.rad(0)) self.assertEqual(c.position, gl.vec3f()) self.assertFalse(c.has_frustum) self.assertEqual(c.right, gl.vec3f(1, 0, 0)) self.assertEqual(c.front, gl.vec3f(0, 0, -1)) self.assertEqual(c.up, gl.vec3f(0, 1, 0))
def test_look_at_identity(self): c = Camera() c.look_at(c.front) self.assertEqual(c.yaw, angle.deg(0)) self.assertEqual(c.roll, angle.rad(0)) self.assertEqual(c.pitch, angle.rad(0))