pslib
Class LinearForce

java.lang.Object
  extended by pslib.PSForce
      extended by pslib.LinearForce
All Implemented Interfaces:
PSBehaviour, PSConstants

public class LinearForce
extends PSForce

LinearForce Class

The LinearForce object extends the PSForce class allowing a linear force vector to be applied to a DynamicParticle object. The force calculated based on the specified minimum and maximum values, decay curve and decay mode.

This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library. If not, see http://www.gnu.org/licenses/.


Field Summary
 
Fields inherited from interface pslib.PSConstants
CAM2D_LOOK, CAM2D_RIGHT, CAM2D_UP, CORNER, INVERSE, INVERSE_TRIANGULAR, LEADING, LINEAR, MIDPOINT, NONE, STATIC, TRAILING, TRIANGULAR
 
Constructor Summary
LinearForce(PSVector v, float m)
           
LinearForce(PSVector v, float mi, float ma, int m, float c)
          Create a new object instance with the specified values
 
Method Summary
 void update(DynamicParticle p)
          Update the specified particle
 
Methods inherited from class pslib.PSForce
getDimensionScalars, getMagnitude, getScale, setCurve, setDimensionScalars, setScale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearForce

public LinearForce(PSVector v,
                   float m)

LinearForce

public LinearForce(PSVector v,
                   float mi,
                   float ma,
                   int m,
                   float c)
Create a new object instance with the specified values

Parameters:
v - force vector
mi - minimum magnitude
ma - maximum magnitude
m - decay mode
c - decay curve exponent
Method Detail

update

public void update(DynamicParticle p)
Update the specified particle

Specified by:
update in interface PSBehaviour
Specified by:
update in class PSForce
Parameters:
p - particle