We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Given the strength and utility of PVector, it is perhaps surprising that common methods have not been overloaded to accommodate encapsulated PVector (so that PVector fields do not need to be continually boxed and, particularly, unboxed). We have created a small set of such overloads "as necessary" but it seems that such an extensions to the base processing PApplet would be generally useful.
Comments
I'm not sure what your question is?
Can you provide us an example of one of these methods and a scenario where it comes in handy?
have you made a lib?
could you post the link?
thank you!
;-)
P
such as PVector, it should integrate it more across its API! 8-|Processing is open-source. If you really want those functions, you can add them.
I would argue that they don't belong in the Processing core because they don't really add much functionality that you can't add yourself in 3 lines or so. And the PApplet class is already long enough!
You can still build from the source and add whatever methods you want. You could even fork the project and put your own version up on GitHub. If that sounds like a lot of work, then you're starting to understand why they don't accept every single code addition.
You're "reducing the clutter" by 3 whole lines.
The people working on the code.
Actually we are not talking about overloading the PVector class rather PApplet and PGrahics (plus its subclasses).
There must be hundreds of methods that use the screen coordinates which could be overloaded to accept PVector parameters. That's a shed load of code to write and maintain.
I doubt it is that much by looking at Processing's API reference:
https://processing.org/reference/
Those are merely unboxing code. Like this 1 for example:
They could even implement some helper class to place those overloaded functions there. *-:)
As I highlighted, PVector is a Processing's invention. And it surely feels very isolated right now.
Integrating PVector across Processing's API have lotsa good effects:
Make the "language" easier, uncluttered and more streamlined! :-bd