public class SlipstreamEntityPlugin2 extends BaseCustomEntityPlugin
Modifier and Type | Class and Description |
---|---|
static class |
SlipstreamEntityPlugin2.SlipstreamParams2 |
static class |
SlipstreamEntityPlugin2.SlipstreamParticle |
static class |
SlipstreamEntityPlugin2.SlipstreamSegment |
Modifier and Type | Field and Description |
---|---|
protected java.util.List<BoundingBox> |
bounds |
protected FaderUtil |
fader |
protected int |
lengthDivisor |
protected int[] |
lengthToIndexMap |
static int |
MAX_PARTICLES_ADD_PER_FRAME |
protected boolean |
needsRecompute |
protected SlipstreamEntityPlugin2.SlipstreamParams2 |
params |
protected java.util.List<SlipstreamEntityPlugin2.SlipstreamParticle> |
particles |
protected int |
playerWasInSlipstreamFramesAgo |
static float |
RAD_PER_DEG |
protected java.util.List<SlipstreamEntityPlugin2.SlipstreamSegment> |
segments |
protected int |
segmentsPerBox |
protected float |
totalLength |
entity
Constructor and Description |
---|
SlipstreamEntityPlugin2() |
Modifier and Type | Method and Description |
---|---|
void |
addParticles() |
void |
addSegment(Vector2f loc,
float width) |
void |
advance(float amount) |
protected void |
advanceNearbySegments(float amount) |
void |
advanceParticles(float amount) |
void |
applyEffect(SectorEntityToken other,
float days) |
void |
applyEffectToFleets(float amount) |
float |
getFaderBrightness(float distAlong) |
float |
getIntensity(float yOff) |
float[] |
getLengthAndWidthFractionWithinStream(Vector2f loc)
result[0] = actual distance along the length of the slipstream
result[1] = offset along the width of the slipstream,
0 = on center, 1 = on edge along normal, -1 = on edge along negative of normal
null if outside stream
Assumes rectangular, non-tapered stream
|
Vector2f |
getNormalAt(float lengthAlongStream) |
Vector2f |
getNoWobblePointAt(float lengthAlongStream,
float offset) |
Vector2f |
getPointAt(float lengthAlongStream,
float offset) |
java.awt.Color |
getRandomColor() |
float |
getRenderRange()
How far away from the viewport the center of this entity can be before it stops being rendered.
|
SlipstreamEntityPlugin2.SlipstreamSegment |
getSegmentForDist(float distAlongStream) |
java.util.List<SlipstreamEntityPlugin2.SlipstreamSegment> |
getSegmentsNear(Vector2f loc,
float range) |
float |
getWidthBasedSpeedMult(float distAlong) |
void |
init(SectorEntityToken entity,
java.lang.Object pluginParams) |
void |
recompute() |
void |
recomputeIfNeeded() |
void |
render(CampaignEngineLayers layer,
ViewportAPI viewport)
Should only render for specified layer.
|
void |
renderSegments(SpriteAPI sprite,
SpriteAPI edge,
float alpha,
java.util.List<SlipstreamEntityPlugin2.SlipstreamSegment> segments) |
static Vector2f |
rotateAroundOrigin(Vector2f v,
float cos,
float sin) |
void |
setNeedsRecompute() |
protected void |
updateBoundingBoxes() |
void |
updateLengthToIndexMap() |
appendToCampaignTooltip, createMapTooltip, getMapTooltipWidth, hasCustomMapTooltip, isMapTooltipExpandable
public static int MAX_PARTICLES_ADD_PER_FRAME
public static float RAD_PER_DEG
protected SlipstreamEntityPlugin2.SlipstreamParams2 params
protected java.util.List<SlipstreamEntityPlugin2.SlipstreamSegment> segments
protected float totalLength
protected transient java.util.List<SlipstreamEntityPlugin2.SlipstreamParticle> particles
protected transient int[] lengthToIndexMap
protected transient int lengthDivisor
protected boolean needsRecompute
protected java.util.List<BoundingBox> bounds
protected int segmentsPerBox
protected FaderUtil fader
protected int playerWasInSlipstreamFramesAgo
public static Vector2f rotateAroundOrigin(Vector2f v, float cos, float sin)
public void setNeedsRecompute()
public void updateLengthToIndexMap()
public SlipstreamEntityPlugin2.SlipstreamSegment getSegmentForDist(float distAlongStream)
public void addSegment(Vector2f loc, float width)
public void init(SectorEntityToken entity, java.lang.Object pluginParams)
init
in interface CustomCampaignEntityPlugin
init
in class BaseCustomEntityPlugin
public float getRenderRange()
CustomCampaignEntityPlugin
getRenderRange
in interface CustomCampaignEntityPlugin
getRenderRange
in class BaseCustomEntityPlugin
public void advance(float amount)
advance
in interface CustomCampaignEntityPlugin
advance
in class BaseCustomEntityPlugin
amount
- in seconds. Use SectorAPI.getClock() to figure out how many campaign days that is.public void recomputeIfNeeded()
public void recompute()
protected void updateBoundingBoxes()
protected void advanceNearbySegments(float amount)
public void addParticles()
public void advanceParticles(float amount)
public float getWidthBasedSpeedMult(float distAlong)
public float getIntensity(float yOff)
public float getFaderBrightness(float distAlong)
public void render(CampaignEngineLayers layer, ViewportAPI viewport)
CustomCampaignEntityPlugin
render
in interface CustomCampaignEntityPlugin
render
in class BaseCustomEntityPlugin
public void renderSegments(SpriteAPI sprite, SpriteAPI edge, float alpha, java.util.List<SlipstreamEntityPlugin2.SlipstreamSegment> segments)
public java.awt.Color getRandomColor()
public float[] getLengthAndWidthFractionWithinStream(Vector2f loc)
loc
- public void applyEffectToFleets(float amount)
public void applyEffect(SectorEntityToken other, float days)
public Vector2f getPointAt(float lengthAlongStream, float offset)
public Vector2f getNoWobblePointAt(float lengthAlongStream, float offset)
public Vector2f getNormalAt(float lengthAlongStream)
public java.util.List<SlipstreamEntityPlugin2.SlipstreamSegment> getSegmentsNear(Vector2f loc, float range)
Copyright © 2013 Fractal Softworks, LLC. All Rights Reserved.