Package | Description |
---|---|
org.cell2d | |
org.cell2d.space | |
org.cell2d.space.map |
Modifier and Type | Method and Description |
---|---|
CellVector |
CellVector.add(CellVector vector)
Adds the specified CellVector to this CellVector.
|
static CellVector |
CellVector.add(CellVector first,
CellVector second)
Returns a new CellVector that represents the sum of the two specified
CellVectors.
|
CellVector |
CellVector.add(long x,
long y)
Adds the specified coordinates to this CellVector's own.
|
CellVector |
CellVector.changeAngle(double angle)
Changes this CellVector's angle by the specified amount while retaining
its magnitude.
|
CellVector |
CellVector.clear()
Resets this CellVector to represent the origin.
|
CellVector |
CellVector.flip()
Flips this CellVector across both coordinate axes, negating both of its
coordinates.
|
CellVector |
CellVector.flip(boolean xFlip,
boolean yFlip)
Flips this CellVector across either, both, or neither of the coordinate
axes, depending on the parameters.
|
CellVector |
CellVector.flipX()
Flips this CellVector across the x-axis, negating its x-coordinate.
|
CellVector |
CellVector.flipY()
Flips this CellVector across the y-axis, negating its y-coordinate.
|
static CellVector |
CellVector.lineSegmentsIntersectionPoint(CellVector start1,
CellVector diff1,
CellVector start2,
CellVector diff2)
Returns the single point at which the two specified line segments
intersect, or null if they intersect at no points or at an infinity of
points.
|
CellVector |
CellVector.relativeTo(Hitbox hitbox)
Flips this CellVector to reflect the flipped status of the specified
Hitbox and rotates it to reflect the Hitbox's angle of rotation, as if
those properties were formerly relative to the Hitbox.
|
CellVector |
CellVector.relativeTo(SpaceObject object)
Flips this CellVector to reflect the flipped status of the specified
SpaceObject and rotates it to reflect the SpaceObject's angle of
rotation, as if those properties were formerly relative to the
SpaceObject.
|
CellVector |
CellVector.scale(long scaleFactor)
Multiplies this CellVector's coordinates by the specified fracunit-scale
factor.
|
CellVector |
CellVector.setAngle(double angle)
Sets this CellVector's angle to the specified value while retaining its
magnitude.
|
CellVector |
CellVector.setCoordinates(CellVector point)
Sets this CellVector's point to the specified value.
|
CellVector |
CellVector.setCoordinates(long x,
long y)
Sets this CellVector's point to the specified coordinates.
|
CellVector |
CellVector.setMagnitude(long magnitude)
Sets this CellVector's magnitude to the specified value while retaining
its angle.
|
CellVector |
CellVector.setX(long x)
Sets the x-coordinate of this CellVector's point to the specified value.
|
CellVector |
CellVector.setY(long y)
Sets the y-coordinate of this CellVector's point to the specified value.
|
CellVector |
CellVector.sub(CellVector vector)
Subtracts the specified CellVector from this CellVector.
|
static CellVector |
CellVector.sub(CellVector first,
CellVector second)
Returns a new CellVector that represents the second specified
CellVector subtracted from the first.
|
CellVector |
CellVector.sub(long x,
long y)
Subtracts the specified coordinates from this CellVector's own.
|
Modifier and Type | Method and Description |
---|---|
CellVector |
CellVector.add(CellVector vector)
Adds the specified CellVector to this CellVector.
|
static CellVector |
CellVector.add(CellVector first,
CellVector second)
Returns a new CellVector that represents the sum of the two specified
CellVectors.
|
double |
CellVector.angleTo(CellVector point)
Returns the angle from this CellVector's point to that of the specified
CellVector.
|
long |
CellVector.cross(CellVector vector)
Returns the non-zero component in fracunits of the cross product of this
CellVector and the specified one.
|
long |
CellVector.distanceTo(CellVector point)
Returns the distance from this CellVector's point to that of the
specified CellVector.
|
long |
CellVector.dot(CellVector vector)
Returns the dot product in fracunits of this CellVector and the specified
one.
|
static boolean |
CellVector.lineSegmentsIntersect(CellVector start1,
CellVector diff1,
CellVector start2,
CellVector diff2)
Returns whether the two specified line segments share any points.
|
static CellVector |
CellVector.lineSegmentsIntersectionPoint(CellVector start1,
CellVector diff1,
CellVector start2,
CellVector diff2)
Returns the single point at which the two specified line segments
intersect, or null if they intersect at no points or at an infinity of
points.
|
CellVector |
CellVector.setCoordinates(CellVector point)
Sets this CellVector's point to the specified value.
|
CellVector |
CellVector.sub(CellVector vector)
Subtracts the specified CellVector from this CellVector.
|
static CellVector |
CellVector.sub(CellVector first,
CellVector second)
Returns a new CellVector that represents the second specified
CellVector subtracted from the first.
|
Constructor and Description |
---|
CellVector(CellVector point)
Constructs a CellVector that represents the specified point.
|
Modifier and Type | Method and Description |
---|---|
CellVector |
LineHitbox.getAbsDifference()
Returns this LineHitbox's absolute difference.
|
CellVector |
Hitbox.getAbsPosition()
Returns this Hitbox's absolute position.
|
CellVector |
PolygonHitbox.getAbsVertex(int index)
Returns this PolygonHitbox's absolute vertex at the specified index.
|
CellVector |
SpaceObject.getCenter()
Returns the absolute position of this SpaceObject's center.
|
CellVector |
SpaceObject.getCenterOffset()
Returns this SpaceObject's center's offset.
|
CellVector |
MobileObject.getDisplacement()
Returns this MobileObject's displacement during its last movement.
|
CellVector |
SpaceObject.getPosition()
Returns this SpaceObject's position.
|
CellVector |
LineHitbox.getPosition2()
Returns the position of this LineHitbox's second endpoint, the sum of its
absolute position and absolute difference.
|
CellVector |
LineHitbox.getRelDifference()
Returns this LineHitbox's relative difference.
|
CellVector |
Hitbox.getRelPosition()
Returns this Hitbox's relative position.
|
CellVector |
PolygonHitbox.getRelVertex(int index)
Returns this PolygonHitbox's relative vertex at the specified index.
|
CellVector |
SpaceState.getSpacePoint(int x,
int y)
Returns the point in this SpaceState, as seen through one of its
Viewports, that corresponds to the specified point in pixels on the
screen.
|
CellVector |
Viewport.getSpacePoint(int x,
int y)
Returns the point in a SpaceState, as seen through this Viewport, that
corresponds to the specified point in pixels in this Viewport's on-screen
rendering region.
|
CellVector |
MobileObject.getStep()
Returns this MobileObject's step.
|
CellVector |
MobileObject.getVelocity()
Returns this MobileObject's velocity.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<CellVector> |
PolygonHitbox.getAbsVertices()
Returns the List of this PolygonHitbox's absolute vertices.
|
java.util.List<CellVector> |
PolygonHitbox.getRelVertices()
Returns the List of this PolygonHitbox's relative vertices.
|
Modifier and Type | Method and Description |
---|---|
void |
PolygonHitbox.addVertex(CellVector relVertex)
Adds the specified relative vertex to this PolygonHitbox at the index
after its last one, between its last and first relative vertices.
|
void |
PolygonHitbox.addVertex(int index,
CellVector relVertex)
Adds the specified relative vertex to this PolygonHitbox at the specified
index.
|
void |
SpaceObject.changePosition(CellVector change)
Changes this SpaceObject's position by the specified amount.
|
void |
MobileObject.changePosition(CellVector change,
boolean bringFollowers)
Changes this MobileObject's position by the specified amount.
|
void |
Hitbox.changeRelPosition(CellVector change)
Changes this Hitbox's relative position by the specified amount.
|
void |
MobileObject.changeStep(CellVector change)
Changes this MobileObject's step by the specified amount.
|
void |
MobileObject.doMovement(CellVector change)
Moves this MobileObject and its followers and sub-followers by the
specified amount, colliding with solid surfaces if they have collision
enabled.
|
java.awt.Point |
Viewport.getScreenPoint(CellVector spacePoint)
Returns the point in pixels on the screen that corresponds to the
specified point in a SpaceState as seen through this Viewport.
|
void |
SpaceState.loadArea(CellVector origin,
Area<T,U> area)
Loads the specified Area about the specified origin point.
|
void |
MobileObject.moveToward(CellVector point,
long speed)
Sets this MobileObject's velocity to send it moving toward the specified
point at the specified speed.
|
<O extends SpaceObject> |
SpaceState.nearestIntersectingSolidObject(CellVector point,
Hitbox hitbox,
java.lang.Class<O> cls)
Returns this SpaceState's SpaceObject of the specified class whose solid
Hitbox overlaps the specified Hitbox whose center is nearest to the
specified point, or null if there is none.
|
<O extends SpaceObject> |
SpaceState.nearestObject(CellVector point,
java.lang.Class<O> cls)
Returns this SpaceState's SpaceObject of the specified class whose center
is nearest to the specified point, or null if this SpaceState has no
SpaceObjects of that class.
|
<O extends SpaceObject> |
SpaceState.nearestObjectWithinCircle(CellVector point,
CellVector center,
long radius,
java.lang.Class<O> cls)
Returns this SpaceState's SpaceObject of the specified class within the
specified circular region whose center is nearest to the specified point,
or null if there is none.
|
<O extends SpaceObject> |
SpaceObject.nearestObjectWithinCircle(CellVector center,
long radius,
java.lang.Class<O> cls)
Returns the SpaceObject of the specified class within the specified
circular region in this SpaceObject's SpaceState that is nearest to it -
or null if this SpaceObject has no SpaceState, or the region contains no
SpaceObject of that class.
|
<O extends SpaceObject> |
SpaceState.nearestObjectWithinRectangle(CellVector point,
long x1,
long y1,
long x2,
long y2,
java.lang.Class<O> cls)
Returns this SpaceState's SpaceObject of the specified class within the
specified rectangular region whose center is nearest to the specified
point, or null if there is none.
|
<O extends SpaceObject> |
SpaceState.nearestOverlappingObject(CellVector point,
Hitbox hitbox,
java.lang.Class<O> cls)
Returns this SpaceState's SpaceObject of the specified class that
overlaps the specified Hitbox whose center is nearest to the specified
point, or null if there is none.
|
<O extends SpaceObject> |
SpaceState.objectIsWithinCircle(CellVector center,
long radius,
java.lang.Class<O> cls)
Returns whether this SpaceState has any SpaceObjects of the specified
class with their centers within the specified circular region.
|
<O extends SpaceObject> |
SpaceState.objectsWithinCircle(CellVector center,
long radius,
java.lang.Class<O> cls)
Returns all of this SpaceState's SpaceObjects of the specified class with
their centers within the specified circular region.
|
<O extends SpaceObject> |
SpaceState.objectWithinCircle(CellVector center,
long radius,
java.lang.Class<O> cls)
Returns one of this SpaceState's SpaceObjects of the specified class with
its center within the specified circular region, or null if there is
none.
|
void |
SpaceObject.setCenterOffset(CellVector offset)
Sets this SpaceObject's center's offset to the specified value.
|
void |
SpaceObject.setPosition(CellVector position)
Sets this SpaceObject's position to the specified value.
|
void |
MobileObject.setPosition(CellVector position,
boolean bringFollowers)
Sets this MobileObject's position to the specified value.
|
void |
LineHitbox.setRelDifference(CellVector difference)
Sets this LineHitbox's relative difference to the specified value.
|
void |
Hitbox.setRelPosition(CellVector relPosition)
Sets this Hitbox's relative position to the specified value.
|
void |
PolygonHitbox.setRelVertex(int index,
CellVector relVertex)
Sets this PolygonHitbox's relative vertex at the specified index to the
specified value.
|
void |
MobileObject.setStep(CellVector step)
Sets this MobileObject's step to the specified value.
|
void |
MobileObject.setVelocity(CellVector velocity)
Sets this MobileObject's velocity to the specified value.
|
Constructor and Description |
---|
CircleHitbox(CellVector relPosition,
long radius)
Constructs a CircleHitbox with the specified relative position and
radius.
|
CompositeHitbox(CellVector relPosition)
Constructs a CompositeHitbox with the specified relative position.
|
Hitbox(CellVector relPosition)
Constructs a Hitbox with the specified relative position.
|
LineHitbox(CellVector relPosition,
CellVector relDifference)
Constructs a LineHitbox with the specified relative position and
difference.
|
PointHitbox(CellVector relPosition)
Constructs a PointHitbox with the specified relative position.
|
PolygonHitbox(CellVector relPosition)
Constructs a PolygonHitbox with the specified relative position and no
vertices.
|
PolygonHitbox(CellVector relPosition,
CellVector... relVertices)
Constructs a PolygonHitbox with the specified relative position and
sequence of relative vertices.
|
PolygonHitbox(CellVector relPosition,
CellVector... relVertices)
Constructs a PolygonHitbox with the specified relative position and
sequence of relative vertices.
|
PolygonHitbox(long relX,
long relY,
CellVector... relVertices)
Constructs a PolygonHitbox with the specified relative position and
sequence of relative vertices.
|
RectangleHitbox(CellVector relPosition,
long relLeft,
long relRight,
long relTop,
long relBottom)
Constructs a RectangleHitbox with the specified relative position and
dimensions.
|
Constructor and Description |
---|
TileGridObject(CellVector position,
TileGrid grid,
int drawPriority,
boolean addAnimInstances)
Constructs a TileGridObject.
|