|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.concord.collisions.engine.JWorldElement | +--org.concord.collisions.engine.JDaemon | +--org.concord.collisions.engine.JBooster
Booster element in the world
A booster is a special daemon that affects only atoms when they collide with it.
It changes instantly the velocity of the atom, adding to it its specific deltaVx and deltaVy.
JDaemon
, Serialized FormField Summary | |
protected boolean |
dragDeltaVx
|
protected boolean |
dragDeltaVy
|
Fields inherited from class org.concord.collisions.engine.JDaemon |
activationSteps, activeColor, collisionHistory, currentActivationStep, DEFAULT_PAINT_RADIUS, doCollisionsHistory, minDistance, timeColor |
Fields inherited from class org.concord.collisions.engine.JWorldElement |
acx, acy, areaListener, areaTables, collSensitive, controllable, DEFAULT_MAX_CONSTRAINT, DEFAULT_MIN_CONSTRAINT, doProjection, draggable, elementListeners, flashing, iconHeight, iconWidth, index, iviewer, mass, name, pressedState, propertyListeners, qtIcon, qtMovie, rectsForListener, scaleIcon, showAcceleration, showVelocity, showVelocityNumber, suggestedCollisionTime, swingIcon, vel_scale, vx, vy, wasLastStepCollision |
Constructor Summary | |
JBooster()
|
Method Summary | |
static JBooster |
createBooster(float x,
float y,
float width,
float height,
float deltaVx,
float deltaVy)
Creates a new booster |
void |
doDrag(CCCoordinateTuner tuner,
int x,
int y)
|
int |
getArrowThickness()
Get the thickness of the delta velocity arrows |
java.awt.Color |
getDeltaVelColor()
Returns the color of the arrows for the delta velocity of the daemon |
float |
getDeltaVx()
Returns the delta velocity on the x component |
float |
getDeltaVy()
Returns the delta velocity on the y component |
float |
getXTemperature()
|
float |
getYTemperature()
|
boolean |
isCollisionSensitive()
|
boolean |
isPointInside(float px,
float py)
Returns if a specific world coordinates point is inside the element or not |
boolean |
manageCollision(JWorldElement element)
This method is called by JPartWorld when the booster collides with an element |
boolean |
manageNoCollision(JWorldElement element)
This method is called by JPartWorld every step while the booster is colliding with an element |
void |
paint(java.awt.Graphics g,
java.awt.Graphics sg)
|
void |
resetDefaultColors()
Reset default colors for the booster. |
void |
setArrowThickness(int thick)
Set the thickness of the delta velocity arrows |
void |
setDeltaVelColor(java.awt.Color col)
Sets the color that will be displayed for the delta velocity's arrows |
void |
setDeltaVx(float v)
Sets the delta velocity on the x component for the daemon |
void |
setDeltaVy(float v)
Sets the delta velocity on the y component for the daemon |
void |
setGeometry(java.lang.Object object)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean dragDeltaVx
protected boolean dragDeltaVy
Constructor Detail |
public JBooster()
Method Detail |
public static JBooster createBooster(float x, float y, float width, float height, float deltaVx, float deltaVy)
x
- booster's x coordinate in pixelsy
- booster's y coordinate in pixelsw
- booster's width (minimum 1) in pixelsh
- booster's height (minimum 1) inpixelsdeltaVx
- x coordinate of booster's delta velocity (in Cm)deltaVy
- y coordinate of booster's delta velocity (in Cm)public void setGeometry(java.lang.Object object) throws java.lang.Exception
setGeometry
in class JWorldElement
public void paint(java.awt.Graphics g, java.awt.Graphics sg)
paint
in class JWorldElement
public float getXTemperature()
getXTemperature
in class JWorldElement
public float getYTemperature()
getYTemperature
in class JWorldElement
public boolean manageCollision(JWorldElement element)
manageCollision
in class JDaemon
element
- element the booster collided withpublic boolean manageNoCollision(JWorldElement element)
manageNoCollision
in class JDaemon
element
- element the booster is colliding withpublic void setDeltaVx(float v)
v
- x coordinate of delta velocitypublic void setDeltaVy(float v)
v
- y coordinate of delta velocitypublic float getDeltaVx()
public float getDeltaVy()
public java.awt.Color getDeltaVelColor()
By default, the delta vel arrows have the same color as the daemon.
public void setDeltaVelColor(java.awt.Color col)
color
- to be setpublic void resetDefaultColors()
Sets the default colors for boosters: Orange for inactive, green for active.
public int getArrowThickness()
public void setArrowThickness(int thick)
public boolean isCollisionSensitive()
isCollisionSensitive
in class JWorldElement
public void doDrag(CCCoordinateTuner tuner, int x, int y)
doDrag
in class JDaemon
public boolean isPointInside(float px, float py)
isPointInside
in class JDaemon
px
- world x coordinate of the pointpy
- world y coordinate of the pointJDaemon.isPointInside(float, float)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |