Class SlipstreamEntityPlugin2

java.lang.Object
com.fs.starfarer.api.impl.campaign.BaseCustomEntityPlugin
com.fs.starfarer.api.impl.campaign.velfield.SlipstreamEntityPlugin2
All Implemented Interfaces:
CustomCampaignEntityPlugin

public class SlipstreamEntityPlugin2 extends BaseCustomEntityPlugin
  • Field Details

  • Constructor Details

    • SlipstreamEntityPlugin2

      public SlipstreamEntityPlugin2()
  • Method Details

    • rotateAroundOrigin

      public static org.lwjgl.util.vector.Vector2f rotateAroundOrigin(org.lwjgl.util.vector.Vector2f v, float cos, float sin)
    • setNeedsRecompute

      public void setNeedsRecompute()
    • updateLengthToIndexMap

      public void updateLengthToIndexMap()
    • getSegmentForDist

      public SlipstreamEntityPlugin2.SlipstreamSegment getSegmentForDist(float distAlongStream)
    • addSegment

      public void addSegment(org.lwjgl.util.vector.Vector2f loc, float width)
    • init

      public void init(SectorEntityToken entity, Object pluginParams)
      Specified by:
      init in interface CustomCampaignEntityPlugin
      Overrides:
      init in class BaseCustomEntityPlugin
    • 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 interface CustomCampaignEntityPlugin
      Overrides:
      getRenderRange in class BaseCustomEntityPlugin
      Returns:
    • advance

      public void advance(float amount)
      Specified by:
      advance in interface CustomCampaignEntityPlugin
      Overrides:
      advance in class BaseCustomEntityPlugin
      Parameters:
      amount - in seconds. Use SectorAPI.getClock() to figure out how many campaign days that is.
    • recomputeIfNeeded

      public void recomputeIfNeeded()
    • recompute

      public void recompute()
    • updateBoundingBoxes

      protected void updateBoundingBoxes()
    • advanceNearbySegments

      protected void advanceNearbySegments(float amount)
    • addParticles

      public void addParticles()
    • advanceParticles

      public void advanceParticles(float amount)
    • getWidthBasedSpeedMult

      public float getWidthBasedSpeedMult(float distAlong)
    • getIntensity

      public float getIntensity(float yOff)
    • getFaderBrightness

      public float getFaderBrightness(float distAlong)
    • render

      public void render(CampaignEngineLayers layer, ViewportAPI viewport)
      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 interface CustomCampaignEntityPlugin
      Overrides:
      render in class BaseCustomEntityPlugin
    • renderSegments

      public void renderSegments(SpriteAPI sprite, SpriteAPI edge, float alpha, List<SlipstreamEntityPlugin2.SlipstreamSegment> segments)
    • getRandomColor

      public Color getRandomColor()
    • getLengthAndWidthFractionWithinStream

      public float[] getLengthAndWidthFractionWithinStream(org.lwjgl.util.vector.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
      Parameters:
      loc -
      Returns:
    • applyEffectToFleets

      public void applyEffectToFleets(float amount)
    • applyEffect

      public void applyEffect(SectorEntityToken other, float days)
    • getPointAt

      public org.lwjgl.util.vector.Vector2f getPointAt(float lengthAlongStream, float offset)
    • getNoWobblePointAt

      public org.lwjgl.util.vector.Vector2f getNoWobblePointAt(float lengthAlongStream, float offset)
    • getNormalAt

      public org.lwjgl.util.vector.Vector2f getNormalAt(float lengthAlongStream)
    • getSegmentsNear

      public List<SlipstreamEntityPlugin2.SlipstreamSegment> getSegmentsNear(org.lwjgl.util.vector.Vector2f loc, float range)