def test_constructor(self): v = Vector() v.setX(3) v.setY(2) self.assertEqual(v.x, 3) self.assertEqual(v.y, 2) self.assertEqual(v.z, 0) v.setZ(1) self.assertEqual(v.z, 1)
def getPointOfRay(self, t): result = Vector() result.setX(self.startPoint.x + (t * self.direction.x)) result.setY(self.startPoint.y + (t * self.direction.y)) result.setZ(self.startPoint.z + (t * self.direction.z)) return result