From cf71af2644e17aa3bce3f72b8a60ae8cd19f2eaf Mon Sep 17 00:00:00 2001 From: "A. J. Andrews" <86714785+DragonMoffon@users.noreply.github.com> Date: Fri, 15 Nov 2024 18:22:57 +1300 Subject: [PATCH] add comment about vec2 operations in point_in_view --- arcade/camera/camera_2d.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arcade/camera/camera_2d.py b/arcade/camera/camera_2d.py index 19785d954..549009b3f 100644 --- a/arcade/camera/camera_2d.py +++ b/arcade/camera/camera_2d.py @@ -482,6 +482,10 @@ def point_in_view(self, point: Point2) -> bool: Take a 2D point in the world, and return whether the point is inside the visible area of the camera. """ + # This is unwrapped from standard Vec2 operations, + # The construction and garbage collection of the vectors would + # increase this method's cost by ~4x + pos = self.position diff = point[0] - pos[0], point[1] - pos[1]