|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsource.ucregents.playground.physics.BaseEntity
source.ucregents.playground.physics.MovingEntity
source.ucregents.playground.physics.RangedForceEntity
public class RangedForceEntity
Ranged Force Entity is a force entity that has a force that pulls toward a point in space.
Constructor Summary | |
---|---|
RangedForceEntity()
|
|
RangedForceEntity(double x,
double y,
double width,
double height,
double attractionStrength)
The ranged force entity is a moving entity with the additional attribute of attraction strength |
|
RangedForceEntity(double x,
double y,
double width,
double height,
float orientation,
javax.vecmath.Vector2d inputVelocity,
int inputMass,
double attractionStrength)
The ranged force entity is a moving entity with the additional attribute of attraction strength |
|
RangedForceEntity(PolygonOrCircle forceShape,
double attractionStrength)
Constructs a new ranged force entity |
|
RangedForceEntity(PolygonOrCircle forceShape,
PolygonOrCircle entityShape,
double attractionStrength)
Constructs a new ranged force entity |
Method Summary | |
---|---|
java.lang.Object |
clone()
Clones the entity in its current state |
java.lang.String |
DefaultImageLocation()
Provides the location of the default image |
void |
Draw(java.awt.Graphics2D g,
boolean verbose)
Draws the entity |
double |
getAttraction()
Gets the attraction force |
javax.vecmath.Vector2d |
getForceFor(MovingEntity be)
Gets the force vector to act on another entity |
boolean |
IntersectsWith(MovingEntity entity)
Determines if it intersects with another entity |
boolean |
isCollidable()
Determines whether or not this entity can be collided with by other entities. |
protected void |
OnLocationChange(double deltaX,
double deltaY)
|
void |
setAttraction(double f)
Sets the attraction force |
Methods inherited from class source.ucregents.playground.physics.MovingEntity |
---|
collide, collide, Deserialize, getAngularVelocity, getCurrentTickVelocity, getCurrentVelocity, getMass, increaseVelocity, increaseXVelocity, increaseYVelocity, isStationary, isUnstoppableForce, moveCurrentVelocity, moveVector, Serialize, setAngularVelocity, setCurrentTickVelocity, setCurrentVelocity, setMass, setStationary, setUnstoppableForce |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RangedForceEntity()
public RangedForceEntity(double x, double y, double width, double height, double attractionStrength)
x
- The x coordinatey
- The y coordinatewidth
- The width of the entityheight
- The height of the entityattractionStrength
- The attraction strength of the forcepublic RangedForceEntity(double x, double y, double width, double height, float orientation, javax.vecmath.Vector2d inputVelocity, int inputMass, double attractionStrength)
x
- The x coordinatey
- The y coordinatewidth
- The width of the entityheight
- The height of the entityorientation
- The orientation of the entityinputVelocity
- The initial velocity of the entityinputMass
- The mass of the entityattractionStrength
- The attraction strenght of the entitypublic RangedForceEntity(PolygonOrCircle forceShape, double attractionStrength)
forceShape
- The shape of the forceattractionStrength
- The attration strength of the forcepublic RangedForceEntity(PolygonOrCircle forceShape, PolygonOrCircle entityShape, double attractionStrength)
forceShape
- The shape of the forceentityShape
- The shape of the entity, ie a planetattractionStrength
- The attration strength of the forceMethod Detail |
---|
public java.lang.Object clone()
clone
in class BaseEntity
public java.lang.String DefaultImageLocation()
BaseEntity
DefaultImageLocation
in class MovingEntity
public void Draw(java.awt.Graphics2D g, boolean verbose)
MovingEntity
Draw
in class MovingEntity
g
- The java.awt.Graphics2D objectpublic double getAttraction()
public javax.vecmath.Vector2d getForceFor(MovingEntity be)
getForceFor
in interface IForceEntity
be
- The entity to get a force for
public boolean IntersectsWith(MovingEntity entity)
IntersectsWith
in interface IForceEntity
entity
- Uses the bounding boxes to determine if another entity is
intersecting itpublic boolean isCollidable()
BaseEntity
isCollidable
in class BaseEntity
protected void OnLocationChange(double deltaX, double deltaY)
OnLocationChange
in class BaseEntity
public void setAttraction(double f)
f
- The new attraction force
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |