|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--noope.laws.Law | +--noope.output.OutputProjection
This is an output class that can be used to display in real-time an orthogonal projection onto a plane of all the Entity objects in Entities. The plane is specified by its normal (the projection onto all such planes is the same) and is then chosen to pass through the origin for simplicity. If the plane is the x-y plane, the x and y axes are used as the coordinate axes. Otherwise, the x-axis is the intersection of the plane with the x-y plane, the origin is the origin of the 3-d space we are representing and the y-axis is perpendicular to the x-axis. The positive x direction is the one which has a positive x component in the old coordinates. The positive y direction is the vector/cross product of the unit-normal and the new x unit vector.
Field Summary | |
static int |
defaultHeight
The width of the image used by default if nothing is provided in the BlockReader object passed to the constructor. |
static int |
defaultWidth
The height of the image used by default if nothing is provided in the BlockReader object passed to the constructor. |
static int |
defaultXpos
The default x position at which the window should appear. |
static int |
defaultYpos
The default y position at which the window should appear. |
protected boolean |
disabled
True after the window has been disabled (by the user closing it or by dispose()). |
protected java.lang.String |
gifComments
String representing the comments written into the gif file. |
protected int |
gifLoopCount
How many times to play sequence. |
protected java.lang.String |
gifName
The name of the gif file used for outputting the animation, null if animation is displayed directly on screen. |
protected int |
gifUniformDelay
Number of centiseconds to wait between two frames. |
protected int |
height
The height of the image we are displaying. |
protected double |
lastTime
Last time an output was made. |
protected Vector3D |
normal
The unit normal to the plane we are projecting on. |
protected AnimationListener |
outputObject
The AnimationListener used to display the animation. |
protected double |
period
The time between two consecutive outputs. |
protected int |
width
The width of the image we are displaying. |
protected BufferedFrame |
windowFrame
The JFrame used to display window. |
protected double |
xmax
xmin, xmax, ymin and ymax describe the range of new coordinates to draw. |
protected double |
xmin
xmin, xmax, ymin and ymax describe the range of new coordinates to draw. |
protected Vector3D |
xnew
The new x and y unit vectors. |
protected int |
xpos
The x-coordinate of the position at which we are displaying the window. |
protected double |
ymax
xmin, xmax, ymin and ymax describe the range of new coordinates to draw. |
protected double |
ymin
xmin, xmax, ymin and ymax describe the range of new coordinates to draw. |
protected Vector3D |
ynew
The new x and y unit vectors. |
protected int |
ypos
The y-coordinate of the position at which we are displaying the window. |
Fields inherited from class noope.laws.Law |
physics |
Constructor Summary | |
OutputProjection(BlockReader br,
int lawnumber,
Physics phys)
Constructs a new OutputProjection object from the given BlockReader with the given lawnumber. |
Method Summary | |
void |
act()
Does not exert a force on any objects, just outputs. |
LawPropertyRecord |
constructNewPropertyRecord(BlockReader br,
Entity ent)
Constructs a new OutputProjectionPropertyRecord object. |
void |
dispose()
Closes the windows opened, then calls the inherited method. |
protected void |
outputPosition(Entity e,
double x,
double y)
Outputs the position of the Entity e at x, y in the coordinates of the plane we are projecting onto. |
Methods inherited from class noope.laws.Law |
getName, getNumber, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String gifName
protected java.lang.String gifComments
protected int gifLoopCount
protected int gifUniformDelay
protected boolean disabled
protected double period
protected double lastTime
protected AnimationListener outputObject
protected BufferedFrame windowFrame
protected int width
protected int height
protected int xpos
protected int ypos
protected double xmin
protected double xmax
protected double ymin
protected double ymax
protected Vector3D normal
protected Vector3D xnew
protected Vector3D ynew
public static int defaultWidth
public static int defaultHeight
public static int defaultXpos
public static int defaultYpos
Constructor Detail |
public OutputProjection(BlockReader br, int lawnumber, Physics phys) throws BRLoadingException
Method Detail |
public void act()
act
in class Law
noope.laws.Law
e
- the list of entities that the force should act onEntity.addForce(Vector3D)
protected void outputPosition(Entity e, double x, double y)
public LawPropertyRecord constructNewPropertyRecord(BlockReader br, Entity ent) throws BRLoadingException
constructNewPropertyRecord
in class Law
noope.laws.Law
br
- BlockReader used to read properties froment
- is the instance of Entity, this LawPropertyRecord will be constructed forpublic void dispose()
dispose
in class Law
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |