Skip to content

Commit

Permalink
add comment about vec2 operations in point_in_view
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonMoffon authored Nov 15, 2024
1 parent 575d662 commit cf71af2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arcade/camera/camera_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit cf71af2

Please sign in to comment.