Class SlipstreamEntityPlugin
java.lang.Object
com.fs.starfarer.api.impl.campaign.BaseCustomEntityPlugin
com.fs.starfarer.api.impl.campaign.velfield.SlipstreamEntityPlugin
- All Implemented Interfaces:
CustomCampaignEntityPlugin
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FaderUtil
static float
protected SlipstreamEntityPlugin.SlipstreamParams
protected List<SlipstreamEntityPlugin.SlipstreamParticle>
protected boolean
static float
protected float
protected float
protected float
protected float
Fields inherited from class com.fs.starfarer.api.impl.campaign.BaseCustomEntityPlugin
entity
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
advance
(float amount) void
applyEffect
(SectorEntityToken other, float days) void
applyEffectToFleets
(float amount) float[]
getLengthAndWidthFractionWithinStream
(org.lwjgl.util.vector.Vector2f loc) result[0] = along the length of the field, 0 = at start, 1 = at tail result[1] = along the width of the field, 0 = on center, 1 = on edge, no directional information null if outside stream Assumes rectangular, non-tapered streamfloat
How far away from the viewport the center of this entity can be before it stops being rendered.void
init
(SectorEntityToken entity, Object pluginParams) void
render
(CampaignEngineLayers layer, ViewportAPI viewport) Should only render for specified layer.void
renderLayer
(SpriteAPI sprite, float texProgress, float alpha) static org.lwjgl.util.vector.Vector2f
rotateAroundOrigin
(org.lwjgl.util.vector.Vector2f v, float cos, float sin) Methods inherited from class com.fs.starfarer.api.impl.campaign.BaseCustomEntityPlugin
appendToCampaignTooltip, createMapTooltip, getMapTooltipWidth, hasCustomMapTooltip, isMapTooltipExpandable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.fs.starfarer.api.campaign.CustomCampaignEntityPlugin
isRenderWhenViewportAlphaMultIsZero
-
Field Details
-
MAX_PARTICLES_ADD_PER_FRAME
public static float MAX_PARTICLES_ADD_PER_FRAME -
RAD_PER_DEG
public static float RAD_PER_DEG -
params
-
texelsPerPixel
protected float texelsPerPixel -
particles
-
texProgress1
protected float texProgress1 -
texProgress2
protected float texProgress2 -
texProgress3
protected float texProgress3 -
fader
-
playerWasInSlipstream
protected boolean playerWasInSlipstream
-
-
Constructor Details
-
SlipstreamEntityPlugin
public SlipstreamEntityPlugin()
-
-
Method Details
-
rotateAroundOrigin
public static org.lwjgl.util.vector.Vector2f rotateAroundOrigin(org.lwjgl.util.vector.Vector2f v, float cos, float sin) -
init
- Specified by:
init
in interfaceCustomCampaignEntityPlugin
- Overrides:
init
in classBaseCustomEntityPlugin
-
getRenderRange
public float getRenderRange()Description copied from interface:CustomCampaignEntityPlugin
How far away from the viewport the center of this entity can be before it stops being rendered. Should at least be the radius of the entity; sometimes more may be necessary depending on the visual effect desired.- Specified by:
getRenderRange
in interfaceCustomCampaignEntityPlugin
- Overrides:
getRenderRange
in classBaseCustomEntityPlugin
- Returns:
-
advance
public void advance(float amount) - Specified by:
advance
in interfaceCustomCampaignEntityPlugin
- Overrides:
advance
in classBaseCustomEntityPlugin
- Parameters:
amount
- in seconds. Use SectorAPI.getClock() to figure out how many campaign days that is.
-
render
Description copied from interface:CustomCampaignEntityPlugin
Should only render for specified layer. Will be called once per each layer, per frame. Needs to respect viewport.getAlphaMult() - i.e. use that alpha value for rendering. Needs to render at the entity's location - there's no translation before this method call. If a sprite is specified, it will be rendered in the bottommost layer of the layers this entity renders for. This method will be called after the sprite has rendered.- Specified by:
render
in interfaceCustomCampaignEntityPlugin
- Overrides:
render
in classBaseCustomEntityPlugin
-
renderLayer
-
getRandomColor
-
getLengthAndWidthFractionWithinStream
public float[] getLengthAndWidthFractionWithinStream(org.lwjgl.util.vector.Vector2f loc) result[0] = along the length of the field, 0 = at start, 1 = at tail result[1] = along the width of the field, 0 = on center, 1 = on edge, no directional information null if outside stream Assumes rectangular, non-tapered stream- Parameters:
loc
-- Returns:
-
applyEffectToFleets
public void applyEffectToFleets(float amount) -
applyEffect
-