コード例 #1
0
 def apply_inverse_view_transform(self, vector: Vector2) -> Vector2:
     """Transform a vector from the camera coordinate system of this camera to the world coordinate system"""
     result = vector.copy()
     result.y = self.viewport.y - result.y
     result -= self.__offset
     result /= self.zoom
     result.rotate(self.orientation)
     result += self.position
     return result
コード例 #2
0
 def apply_world_transform(self, vector: Vector2) -> Vector2:
     """Transform a vector from the local coordinate system of this object to the world coordinate system"""
     result = vector.copy()
     result.rotate(self.orientation)
     result += self.position
     return result