problem with wrapping
in
Programming Questions
•
1 year ago
I try to wrap all the methods from PVector in a class called CVector.
For most things it goes fine, however not for everything:
(i do it in a java file, in case that matters)
in PVector there is this function:
- static public PVector random2D() {
- // stuff
- }
My CVector class has a PVector called pos.
To wrap the method into my class i tried:
- static public PVector random2D() {
- return pos.random2D();
- }
But that gives me:
// cannot make a static reference to the non static field pos
This is my other attempt:
- static public PVector random2D() {
- return PVector.random2D();
- }
But then i get:
// the method random2D is undefied for the type PVector
How can i get around this?
In case it helps:
1