1package com.fs.starfarer.api.impl.campaign;
5import org.lwjgl.opengl.GL11;
6import org.lwjgl.util.vector.Vector2f;
8import com.fs.starfarer.api.Global;
9import com.fs.starfarer.api.campaign.SectorEntityToken;
10import com.fs.starfarer.api.graphics.SpriteAPI;
11import com.fs.starfarer.api.impl.campaign.ids.Tags;
12import com.fs.starfarer.api.util.FaderUtil;
13import com.fs.starfarer.api.util.Misc;
28 protected Vector2f
loc =
new Vector2f();
29 protected Vector2f
vel =
new Vector2f();
60 int cols = (int) (w / cellSize);
61 int rows = (int) (h / cellSize);
64 float cellX = (int) (Math.random() * cols);
65 float cellY = (int) (Math.random() * rows);
93 facing = (float) Math.random() * 360f;
94 angVel = (float) Math.random() * 360f - 180f;
96 float r = (float) Math.random();
97 r = (float) Math.sqrt(r);
98 float dist = r * spawnRadius;
107 vel.x += off - (float) Math.random() * 0.5f * off;
108 vel.y += off - (float) Math.random() * 0.5f * off;
109 if ((
float) Math.random() > 0.5f) {
114 float speed = 10f + (float) Math.random() * 10f;
117 timeLeft = 1f + (float) Math.random();
124 if (alphaMult <= 0)
return;
143 GL11.glColorMask(
false,
false,
false,
true);
145 GL11.glTranslatef(
loc.x,
loc.y, 0);
157 GL11.glColorMask(
true,
true,
true,
false);
181 loc.x += vel.x * days;
182 loc.y += vel.y * days;
static SettingsAPI getSettings()
void render(float alphaMult)
GenericFieldItemSprite(SectorEntityToken entity, String category, String key, float cellSize, float size, float spawnRadius)
void advance(float amount)
static Vector2f getUnitVectorAtDegreeAngle(float degrees)
static void renderQuadAlpha(float x, float y, float width, float height, Color color, float alphaMult)
static Vector2f getPerp(Vector2f v)
static float getAngleInDegreesStrict(Vector2f v)
static Vector2f normalise(Vector2f v)
SpriteAPI getSprite(String filename)
SectorEntityToken getLightSource()
boolean hasTag(String tag)
void setSize(float width, float height)
void setBlendFunc(int src, int dest)
void setTexWidth(float texWidth)
void setAngle(float angle)
void renderAtCenter(float x, float y)
void setColor(Color color)
void setAlphaMult(float alphaMult)
void setTexHeight(float texHeight)