Class SlipstreamBuilder
java.lang.Object
com.fs.starfarer.api.impl.campaign.velfield.SlipstreamBuilder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected float[]
protected int
protected int
protected int
protected int
static final int
static float
static float
static float
static final int
static float
static float
static float
static final int
static float
static final int
static float
protected float[][]
static float
static float
static float
static float
static float
protected float
protected float
static float
static float
static float
static float
static float
protected SlipstreamTerrainPlugin2
protected Random
protected List<SlipstreamBuilder.SlipstreamSection>
protected org.lwjgl.util.vector.Vector2f
protected SlipstreamBuilder.StreamType
static final int
static float
static float
static final int
static float
static float
static final int
static float
static float
protected float[][]
static final int
static final int
static float
static final int
static final int
protected float[][]
static final int
static float
static final int
static float
static final int
static float
static final int
static float
protected float[][]
-
Constructor Summary
ConstructorsConstructorDescriptionSlipstreamBuilder
(org.lwjgl.util.vector.Vector2f start, SlipstreamTerrainPlugin2 plugin, SlipstreamBuilder.StreamType type, Random random) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSection
(org.lwjgl.util.vector.Vector2f to) void
addSection
(org.lwjgl.util.vector.Vector2f to, boolean alreadyPicked) void
addSection
(org.lwjgl.util.vector.Vector2f to, int width, int wrand, int wchange, int fluct) void
addSection
(org.lwjgl.util.vector.Vector2f to, int width, int wrand, int wchange, int fluct, int insertIndex) protected void
void
void
void
buildToDestination
(org.lwjgl.util.vector.Vector2f to) void
buildToDestination
(org.lwjgl.util.vector.Vector2f control, org.lwjgl.util.vector.Vector2f to) void
buildToDestination
(org.lwjgl.util.vector.Vector2f control, org.lwjgl.util.vector.Vector2f control2, org.lwjgl.util.vector.Vector2f to) protected void
void
generate()
static void
genNoise1D
(Random random, float[] noise, int size, float spikes) static void
genNoise1DFill
(Random random, float[] noise, int x1, int x2, int iter, float spikes) static float
getApproximateBezierLength
(org.lwjgl.util.vector.Vector2f p0, org.lwjgl.util.vector.Vector2f p1, org.lwjgl.util.vector.Vector2f p2) static float
getApproximateBezierLength
(org.lwjgl.util.vector.Vector2f p0, org.lwjgl.util.vector.Vector2f p1, org.lwjgl.util.vector.Vector2f p2, org.lwjgl.util.vector.Vector2f p3) protected float
protected float
getFluctuationFunc
(float t) protected float
static float
getInterpNoise
(float[] noise, float t) float
float
protected float
protected float
static float[]
initNoise1D
(Random random, int size, float spikes) void
static void
normalizeNoise1D
(float[] noise) To [0, 1]void
int
pickFluct
(int curr) int
pickNext
(int curr, float[][] matrix) int
pickWChange
(int curr) int
pickWidth
(int curr) int
pickWRand
(int curr) void
renderDebug
(float alpha) void
setMaxAngleVariance
(float maxAngleVariance) void
setMaxAngleVarianceForCurve
(float maxAngleVarianceForCurve)
-
Field Details
-
MIN_SPACING
public static float MIN_SPACING -
MAX_SPACING
public static float MAX_SPACING -
WIDTH_TO_SPACING_MULT
public static float WIDTH_TO_SPACING_MULT -
MIN_NARROW
public static float MIN_NARROW -
MAX_NARROW
public static float MAX_NARROW -
MIN_NORMAL
public static float MIN_NORMAL -
MAX_NORMAL
public static float MAX_NORMAL -
MIN_WIDE
public static float MIN_WIDE -
MAX_WIDE
public static float MAX_WIDE -
MIN_VERY_WIDE
public static float MIN_VERY_WIDE -
MAX_VERY_WIDE
public static float MAX_VERY_WIDE -
WCHANGE_SLOW_T_MULT_MIN
public static float WCHANGE_SLOW_T_MULT_MIN -
WCHANGE_SLOW_T_MULT_MIN_MAX
public static float WCHANGE_SLOW_T_MULT_MIN_MAX -
WCHANGE_MEDIUM_T_MULT_MIN
public static float WCHANGE_MEDIUM_T_MULT_MIN -
WCHANGE_MEDIUM_T_MULT_MAX
public static float WCHANGE_MEDIUM_T_MULT_MAX -
WCHANGE_FAST_T_MULT_MIN
public static float WCHANGE_FAST_T_MULT_MIN -
WCHANGE_FAST_T_MULT_MAX
public static float WCHANGE_FAST_T_MULT_MAX -
WRAND_NONE_MULT
public static float WRAND_NONE_MULT -
WRAND_LOW_MULT
public static float WRAND_LOW_MULT -
WRAND_MEDIUM_MULT
public static float WRAND_MEDIUM_MULT -
WRAND_HIGH_MULT
public static float WRAND_HIGH_MULT -
FLUCT_LENGTH_MIN
public static float FLUCT_LENGTH_MIN -
FLUCT_LENGTH_MAX
public static float FLUCT_LENGTH_MAX -
FLUCT_MAG_MIN
public static float FLUCT_MAG_MIN -
FLUCT_MAG_MAX
public static float FLUCT_MAG_MAX -
FLUCT_NONE_MULT
public static float FLUCT_NONE_MULT -
FLUCT_LOW_MULT
public static float FLUCT_LOW_MULT -
FLUCT_MEDIUM_MULT
public static float FLUCT_MEDIUM_MULT -
FLUCT_HIGH_MULT
public static float FLUCT_HIGH_MULT -
WIDTH_NARROW
public static final int WIDTH_NARROW- See Also:
-
WIDTH_NORMAL
public static final int WIDTH_NORMAL- See Also:
-
WIDTH_WIDE
public static final int WIDTH_WIDE- See Also:
-
WIDTH_VERY_WIDE
public static final int WIDTH_VERY_WIDE- See Also:
-
WRAND_NONE
public static final int WRAND_NONE- See Also:
-
WRAND_LOW
public static final int WRAND_LOW- See Also:
-
WRAND_MEDIUM
public static final int WRAND_MEDIUM- See Also:
-
WRAND_HIGH
public static final int WRAND_HIGH- See Also:
-
WCHANGE_SLOW
public static final int WCHANGE_SLOW- See Also:
-
WCHANGE_MEDIUM
public static final int WCHANGE_MEDIUM- See Also:
-
WCHANGE_FAST
public static final int WCHANGE_FAST- See Also:
-
FLUCT_NONE
public static final int FLUCT_NONE- See Also:
-
FLUCT_LOW
public static final int FLUCT_LOW- See Also:
-
FLUCT_MEDIUM
public static final int FLUCT_MEDIUM- See Also:
-
FLUCT_HIGH
public static final int FLUCT_HIGH- See Also:
-
widthTM
protected float[][] widthTM -
wrandTM
protected float[][] wrandTM -
wchangeTM
protected float[][] wchangeTM -
fluctTM
protected float[][] fluctTM -
random
-
params
-
plugin
-
sections
-
currWidth
protected int currWidth -
currWRand
protected int currWRand -
currWChange
protected int currWChange -
currFluct
protected int currFluct -
start
protected org.lwjgl.util.vector.Vector2f start -
type
-
maxAngleVarianceForCurve
protected float maxAngleVarianceForCurve -
maxAngleVariance
protected float maxAngleVariance -
buildNoise
protected float[] buildNoise
-
-
Constructor Details
-
SlipstreamBuilder
public SlipstreamBuilder(org.lwjgl.util.vector.Vector2f start, SlipstreamTerrainPlugin2 plugin, SlipstreamBuilder.StreamType type, Random random)
-
-
Method Details
-
initTransitionMatrices
public void initTransitionMatrices() -
getMaxAngleVariance
public float getMaxAngleVariance() -
setMaxAngleVariance
public void setMaxAngleVariance(float maxAngleVariance) -
getMaxAngleVarianceForCurve
public float getMaxAngleVarianceForCurve() -
setMaxAngleVarianceForCurve
public void setMaxAngleVarianceForCurve(float maxAngleVarianceForCurve) -
buildToDestination
public void buildToDestination(org.lwjgl.util.vector.Vector2f control, org.lwjgl.util.vector.Vector2f control2, org.lwjgl.util.vector.Vector2f to) -
buildToDestination
public void buildToDestination(org.lwjgl.util.vector.Vector2f control, org.lwjgl.util.vector.Vector2f to) -
buildToDestination
public void buildToDestination(org.lwjgl.util.vector.Vector2f to) -
buildTest
public void buildTest() -
generate
public void generate() -
buildStream
public void buildStream() -
getFluctuationFunc
protected float getFluctuationFunc(float t) -
adjustSharpInflectionPoints
protected void adjustSharpInflectionPoints() -
getWRandMult
-
getFluctMult
-
getWChangeMult
-
getGoalWidth
-
computeControlPoints
protected void computeControlPoints() -
addSection
public void addSection(org.lwjgl.util.vector.Vector2f to) -
addSection
public void addSection(org.lwjgl.util.vector.Vector2f to, boolean alreadyPicked) -
addSection
public void addSection(org.lwjgl.util.vector.Vector2f to, int width, int wrand, int wchange, int fluct) -
addSection
public void addSection(org.lwjgl.util.vector.Vector2f to, int width, int wrand, int wchange, int fluct, int insertIndex) -
getPrev
-
getNext
-
pickAllNext
public void pickAllNext() -
pickWidth
public int pickWidth(int curr) -
pickWRand
public int pickWRand(int curr) -
pickWChange
public int pickWChange(int curr) -
pickFluct
public int pickFluct(int curr) -
pickNext
public int pickNext(int curr, float[][] matrix) -
renderDebug
public void renderDebug(float alpha) -
getInterpNoise
public static float getInterpNoise(float[] noise, float t) -
normalizeNoise1D
public static void normalizeNoise1D(float[] noise) To [0, 1]- Parameters:
noise
-
-
initNoise1D
-
genNoise1D
-
genNoise1DFill
public static void genNoise1DFill(Random random, float[] noise, int x1, int x2, int iter, float spikes) -
getApproximateBezierLength
public static float getApproximateBezierLength(org.lwjgl.util.vector.Vector2f p0, org.lwjgl.util.vector.Vector2f p1, org.lwjgl.util.vector.Vector2f p2) -
getApproximateBezierLength
public static float getApproximateBezierLength(org.lwjgl.util.vector.Vector2f p0, org.lwjgl.util.vector.Vector2f p1, org.lwjgl.util.vector.Vector2f p2, org.lwjgl.util.vector.Vector2f p3)
-