|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.nexttext.PLocatableVector
public class PLocatableVector
The PLocatableVector encapsulates a PVector to use as a Locatable object.
The PVector class is part of the Processing core library so we are unable to have it implement the Locatable interface which is used by the behaviours. As a workaround, the PLocatableVector class is used, mainly internally to accept PVectors as argument.
Instead of extending from the PVector class, we store a PVector as variable. This allows to pass a PVector as argument to the constructor and store a pointer to it. This way modifying the PVector outside of the PLocatableVector object will change the value returned by the PLocatableVector object.
Constructor Summary | |
---|---|
PLocatableVector()
Default constructor -- x, y and z gets assigned the value 0 by default. |
|
PLocatableVector(float x,
float y)
Constructs and initialize using xy properties ( z = 0 by default ). |
|
PLocatableVector(float x,
float y,
float z)
Constructs and initialize using xyz properties. |
|
PLocatableVector(processing.core.PVector vector)
Constructs and store pointer to the PVector. |
Method Summary | |
---|---|
processing.core.PVector |
getLocation()
A PLocatableVector implements the Locatable interface so that it can be used as a "location constant". |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PLocatableVector()
public PLocatableVector(float x, float y)
public PLocatableVector(float x, float y, float z)
public PLocatableVector(processing.core.PVector vector)
Method Detail |
---|
public processing.core.PVector getLocation()
getLocation
in interface Locatable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |