cs567.particles
Class Particle

java.lang.Object
  extended by cs567.particles.Particle

public class Particle
extends java.lang.Object

Simple particle implementation, with miscellaneous adornments.


Field Summary
(package private)  javax.vecmath.Vector2d f
          Force accumulator.
(package private)  double m
          Default mass.
static double PARTICLE_RADIUS
          Radius of particle's circle graphic.
(package private)  javax.vecmath.Vector2d v
          Velocity.
(package private)  javax.vecmath.Point2d x
          Deformed Position.
(package private)  javax.vecmath.Point2d x0
          Undeformed/material Position.
 
Constructor Summary
Particle(javax.vecmath.Point2d x0)
          Constructs particle with the specified material/undeformed coordinate, p0.
 
Method Summary
 void display(javax.media.opengl.GL gl)
          Draws circular particle using a display list.
 boolean getHighlight()
          True if particle should be drawn highlighted.
 boolean isPinned()
          Returns true if currently pinned.
 void setHighlight(boolean highlight)
          Specifies whether particle should be drawn highlighted.
 void setPin(boolean fix)
          Specifies whether or not this particle is fixed in space via a pin constraint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARTICLE_RADIUS

public static final double PARTICLE_RADIUS
Radius of particle's circle graphic.

See Also:
Constant Field Values

m

double m
Default mass.


x

javax.vecmath.Point2d x
Deformed Position.


x0

javax.vecmath.Point2d x0
Undeformed/material Position.


v

javax.vecmath.Vector2d v
Velocity.


f

javax.vecmath.Vector2d f
Force accumulator.

Constructor Detail

Particle

Particle(javax.vecmath.Point2d x0)
Constructs particle with the specified material/undeformed coordinate, p0.

Method Detail

display

public void display(javax.media.opengl.GL gl)
Draws circular particle using a display list.


setHighlight

public void setHighlight(boolean highlight)
Specifies whether particle should be drawn highlighted.


getHighlight

public boolean getHighlight()
True if particle should be drawn highlighted.


setPin

public void setPin(boolean fix)
Specifies whether or not this particle is fixed in space via a pin constraint. (Should probably be elsewhere in a generic constraint list).


isPinned

public boolean isPinned()
Returns true if currently pinned.