Skip to content

Conversation

@maphineth
Copy link

I modified the point_in_view method to improve its clarity and readability. Currently, it calculates the dot product manually and uses intermediate variables. We can simplify it using vectorized operations to make it more concise and efficient.

Explanation:

  • Vec2 Class: I assumed that Vec2 supports vector operations like dot().
  • Readability: The right vector is calculated to represent the camera's horizontal axis, perpendicular to up.
  • Clarity: The dot() method is used to project the diff vector onto the right and up vectors, making the math cleaner and more intuitive.
  • Efficiency: Vectorized operations make the code easier to read and maintain while ensuring mathematical operations remain efficient.

@DragonMoffon
Copy link
Collaborator

This PR has been closed as it makes no functional or performance improvements to the point_in_view method. It also reads like it was written using LLM. While we appreciate all PR's made into Arcade, we require them to be authored and written by people.

@einarf
Copy link
Member

einarf commented Nov 15, 2024

Also: The existing method is optimized. Introducing Vec2 will make it 10x slower. "High performance" in python is a completely different beast and needs careful human crafting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants