volatileprototypes.fvlib
Class Point

java.lang.Object
  extended by processing.core.PVector
      extended by volatileprototypes.fvlib.Point
All Implemented Interfaces:
java.io.Serializable

public class Point
extends processing.core.PVector

Since:
0.2.0
See Also:
Serialized Form

Field Summary
protected  float c
           
protected  processing.core.PVector old
           
protected  float r
           
protected  float r2
           
 processing.core.PVector sforce
           
protected  boolean U
           
protected  processing.core.PVector uMult
           
protected  float w
           
protected  float w1
           
 
Fields inherited from class processing.core.PVector
array, x, y, z
 
Constructor Summary
Point(float xin, float yin, float zin)
          Constructor.
Point(float xin, float yin, float zin, float win)
          Constructor.
Point(float xin, float yin, float zin, float win, float cin, float rin)
          Constructor.
Point(processing.core.PVector v)
          Constructor.
Point(processing.core.PVector v, float win)
          Constructor.
Point(processing.core.PVector v, float win, float cin, float rin)
          Constructor.
 
Method Summary
 Point copy()
          Get a copy of this Point.
 Point copy(boolean copyVelocityAndForce)
          Get a copy of this Point.
 float distance2To(Point p)
          Get the squared distance to another Point (fast).
 double distanceTo(Point p)
          Get the distance to another Point.
 float getC()
           
 float getR()
           
 boolean getU()
           
 processing.core.PVector getUMult()
           
 processing.core.PVector getV()
          Get the current velocity vector as a PVector.
 float getW()
           
 Point setC(float cin)
          Set the charge.
 Point setPos(processing.core.PVector pos)
           
 Point setR(float rin)
          Set the range.
 void setU(boolean uin)
          Set whether the object is unyielding.
 Point setUMult(processing.core.PVector umin)
          Set the unyielding multiplier.
 Point setW(float win)
          Set the weight.
 
Methods inherited from class processing.core.PVector
add, add, add, add, angleBetween, array, cross, cross, cross, dist, dist, div, div, div, div, div, div, dot, dot, dot, equals, get, get, hashCode, heading2D, limit, mag, mult, mult, mult, mult, mult, mult, normalize, normalize, rotate, scaleTo, scaleTo, set, set, set, sub, sub, sub, sub, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

w

protected float w

w1

protected float w1

c

protected float c

r

protected float r

r2

protected float r2

sforce

public processing.core.PVector sforce

old

protected processing.core.PVector old

uMult

protected processing.core.PVector uMult

U

protected boolean U
Constructor Detail

Point

public Point(float xin,
             float yin,
             float zin)
Constructor. Constructor, generates a new class instance using coordinates.

Parameters:
xin - X-Position of the Point.
yin - Y-Position of the Point.
zin - Z-Position of the Point.

Point

public Point(float xin,
             float yin,
             float zin,
             float win)
Constructor. Constructor, generates a new class instance using coordinates and weight. Weight is not yet implemented for use during the simulation.

Parameters:
xin - X-Position of the Point.
yin - Y-Position of the Point.
zin - Z-Position of the Point.
win - Weight of the Point.

Point

public Point(float xin,
             float yin,
             float zin,
             float win,
             float cin,
             float rin)
Constructor. Constructor, generates a new class instance using coordinates, weight, charge and range. Weight is not yet implemented for use during the simulation. Charge is used in electric Charge simulations (BehaviorCharge / BehaviorChargePair). Range is used to check for point-to-point interactions.

Parameters:
xin - X-Position of the Point.
yin - Y-Position of the Point.
zin - Z-Position of the Point.
win - Weight of the Point.
cin - Charge of the Point.
rin - Range of the Point.

Point

public Point(processing.core.PVector v)
Constructor. Constructor, generates a new class instance using a PVector.

Parameters:
v - The PVector with the coordinates of the Point.

Point

public Point(processing.core.PVector v,
             float win)
Constructor. Constructor, generates a new class instance a PVector and weight. Weight is not yet implemented for use during the simulation.

Parameters:
v - The PVector with the coordinates of the Point.
win - Weight of the Point.

Point

public Point(processing.core.PVector v,
             float win,
             float cin,
             float rin)
Constructor. Constructor, generates a new class instance using a PVector, weight, charge and range. Weight is not yet implemented for use during the simulation. Charge is used in electric Charge simulations (BehaviorCharge / BehaviorChargePair). Range is used to check for point-to-point interactions.

Parameters:
v - The PVector with the coordinates of the Point.
win - Weight of the Point.
cin - Charge of the Point.
rin - Range of the Point.
Method Detail

copy

public Point copy()
Get a copy of this Point. Velocity, charge and force information is not copied.

Returns:
The copy.

copy

public Point copy(boolean copyVelocityAndForce)
Get a copy of this Point.

Parameters:
copyVelocityAndForce - Whether to copy velocity, charge and force also.
Returns:
The copy.

setW

public Point setW(float win)
Set the weight.

Parameters:
win - The weight value.

getW

public float getW()

setC

public Point setC(float cin)
Set the charge.

Parameters:
cin - The charge value.

getC

public float getC()

setR

public Point setR(float rin)
Set the range.

Parameters:
rin - The range value.

getR

public float getR()

setU

public void setU(boolean uin)
Set whether the object is unyielding.

Parameters:
uin - The unyielding flag.

getU

public boolean getU()

setUMult

public Point setUMult(processing.core.PVector umin)
Set the unyielding multiplier. The unyielding multiplier indicated whether the object should drift around it's position when unyielding (pinned)

Parameters:
umin - The weight value.

getUMult

public processing.core.PVector getUMult()

getV

public processing.core.PVector getV()
Get the current velocity vector as a PVector.

Returns:
The current velocity vector as a PVector.

setPos

public Point setPos(processing.core.PVector pos)

distance2To

public float distance2To(Point p)
Get the squared distance to another Point (fast).

Returns:
The squared distance value.

distanceTo

public double distanceTo(Point p)
Get the distance to another Point.

Returns:
The distance value.