Package mindustry.type
Class Planet
java.lang.Object
mindustry.ctype.Content
mindustry.ctype.MappableContent
mindustry.ctype.UnlockableContent
mindustry.type.Planet
- All Implemented Interfaces:
Comparable<Content>
-
Nested Class Summary
Nested classes/interfaces inherited from class mindustry.ctype.Content
Content.ModContentInfo
-
Field Summary
Modifier and TypeFieldDescriptionboolean
Whether this planet is listed in the planet access UI.boolean
Whether to allow users to specify the resources they take to this map.boolean
Whether to allow users to specify a custom launch schematic for this map.boolean
If false, players are unable to land on this planet's numbered sectors.boolean
Whether to simulate sector invasions from enemy bases.boolean
If true, waves are created on sector loss.boolean
Whether to allow sectors to simulate waves in the background.Atmosphere tint for landable planets.float
Atmosphere radius adjustment parameters.float
Atmosphere radius adjustment parameters.boolean
Whether the bloom render effect is enabled.float
Camera radius offset.All planets orbiting this one, in ascending order of radius.boolean
If true, sectors saves are cleared when lost.float
Frustum sphere clip radius.Mesh used for rendering planet clouds.Loads the mesh.Environment attributes.Default core block for launching.int
Environment flags for sectors on this planet.boolean
Whether to draw the orbital circle.float
Multiplier for enemy rebuild speeds; only applied in campaign (not standard rules)boolean
If true, enemy cores are replaced with spawnpoints on this planet (for invasions)Generator that will make the planet.Grid used for the sectors on the planet.Mesh used for rendering planet grid outlines.Loads the planet grid outline mesh.boolean
Whether this planet has an atmosphere.Items not available on this planet.Icon as displayed in the planet selection dialog.Icon for appearance in planet list.The only items available on this planet, if defined.Tint of clouds displayed when landing.TODO remove? Planets that can be launched to from this one.float
multiplier for core item capacity when launchingFor suns, this is the color that shines on other planets.float
Day/night cycle parameters.float
Day/night cycle parameters.float
Day/night cycle parameters.float
Day/night cycle parameters.Mesh used for rendering.Loads the mesh.float
Minimum camera zoom value.float
Random orbit angle offset to prevent planets from starting out in a line.float
Orbital radius around the sun.float
Default spacing between planet orbits in world units.float
Time for the planet to orbit around the sun once, in seconds.Parent body that this planet orbits around.Position in global coordinates.boolean
If true, blocks in the radius of the core will be removed and "built up" in a shockwave upon landing.float
Radius of this planet's sphere.float
Time for the planet to perform a full revolution, in seconds.Sets up rules on game load for any sector on this planet.float
Approx.Array of sectors; directly maps to tiles in the grid.int
Seed for sector base generation on this planet.The root parent of the whole solar system this planet is in.int
The default starting sector displayed to the map dialog.Default root node shown when the tech tree is opened here.boolean
Whether this planet is tidally locked relative to its parent - see https://en.wikipedia.org/wiki/Tidal_lockingfloat
Total radius of this planet and all its children.Content (usually planet-specific) that is unlocked upon landing here.boolean
If true, a day/night cycle is simulated.boolean
Whether this planet is displayed.Fields inherited from class mindustry.ctype.UnlockableContent
alwaysUnlocked, description, details, fullIcon, generateIcons, hideDetails, iconId, inlineDescription, localizedName, selectionSize, stats, techNode, techNodes, uiIcon, unlocked
Fields inherited from class mindustry.ctype.MappableContent
name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddParentOffset
(Vec3 in) Adds this planet's offset relative to its parent to the vector.void
applyRules
(Rules rules) void
draw
(PlanetParams params, Mat3D projection, Mat3D transform) void
drawArc
(VertexBatch3D batch, Vec3 a, Vec3 b, Color from, Color to, float length, float timeScale, int pointCount) Draws an arc from one point to another on the planet.void
drawAtmosphere
(Mesh atmosphere, Camera3D cam) void
drawBorders
(VertexBatch3D batch, Sector sector, Color base, float alpha) Draws sector borders.void
drawClouds
(PlanetParams params, Mat3D projection, Mat3D transform) void
drawSelection
(VertexBatch3D batch, Sector sector, Color color, float stroke, float length) Draws sector when selected.void
fill
(VertexBatch3D batch, Sector sector, Color color, float offset) Draws sector plane.Returns the type name of this piece of content.float
Calculates orbital rotation based on universe time.float
Calculates rotation on own axis based on universe time.getSector
(PlanetGrid.Ptile tile) Gets a sector a tile position.getTransform
(Mat3D mat) getWorldPosition
(Vec3 in) Gets the absolute world position of this planet, taking into account all parents.boolean
hasGrid()
void
init()
Called after all content and modules are created.boolean
isHidden()
Planets cannot be viewed in the database dialog.boolean
void
load()
Called after all content is created, only on non-headless versions.void
preset
(int index, SectorPreset preset) void
Regenerates the planet mesh.void
renderSectors
(VertexBatch3D batch, Camera3D cam, PlanetParams params) Renders sector outlines.void
setLastSector
(Sector sector) void
Updates wave coverage of bases.void
boolean
visible()
Methods inherited from class mindustry.ctype.UnlockableContent
checkStats, clearUnlock, createIcons, displayDescription, displayExtra, emoji, getDependencies, getLogicId, hasEmoji, loadIcon, locked, logicVisible, makeOutline, makeOutline, makeOutline, onUnlock, quietUnlock, researchRequirements, setStats, showUnlock, unlock, unlocked, unlockedNow, unlockedNowHost
Methods inherited from class mindustry.ctype.MappableContent
toString
Methods inherited from class mindustry.ctype.Content
compareTo, hasErrored, isModded, isVanilla
-
Field Details
-
mesh
Mesh used for rendering. Created on load() - will be null on the server! -
cloudMesh
Mesh used for rendering planet clouds. Null if no clouds are present. -
gridMesh
Mesh used for rendering planet grid outlines. Null on server or ifgrid
is null. -
position
Position in global coordinates. Will be 0,0,0 until the Universe updates it. -
grid
Grid used for the sectors on the planet. Null if this planet can't be landed on. -
generator
Generator that will make the planet. Can be null for planets that don't need to be landed on. -
sectors
Array of sectors; directly maps to tiles in the grid. -
orbitSpacing
public float orbitSpacingDefault spacing between planet orbits in world units. This is defined per-parent! -
radius
public float radiusRadius of this planet's sphere. Does not take into account satellites. -
camRadius
public float camRadiusCamera radius offset. -
minZoom
public float minZoomMinimum camera zoom value. -
drawOrbit
public boolean drawOrbitWhether to draw the orbital circle. -
atmosphereRadIn
public float atmosphereRadInAtmosphere radius adjustment parameters. -
atmosphereRadOut
public float atmosphereRadOutAtmosphere radius adjustment parameters. -
clipRadius
public float clipRadiusFrustum sphere clip radius. -
orbitRadius
public float orbitRadiusOrbital radius around the sun. Do not change unless you know exactly what you are doing. -
totalRadius
public float totalRadiusTotal radius of this planet and all its children. -
orbitTime
public float orbitTimeTime for the planet to orbit around the sun once, in seconds. One year. -
rotateTime
public float rotateTimeTime for the planet to perform a full revolution, in seconds. One day. -
orbitOffset
public float orbitOffsetRandom orbit angle offset to prevent planets from starting out in a line. -
sectorApproxRadius
public float sectorApproxRadiusApprox. radius of one sector. -
tidalLock
public boolean tidalLockWhether this planet is tidally locked relative to its parent - see https://en.wikipedia.org/wiki/Tidal_locking -
accessible
public boolean accessibleWhether this planet is listed in the planet access UI. -
defaultEnv
public int defaultEnvEnvironment flags for sectors on this planet. -
defaultAttributes
Environment attributes. -
updateLighting
public boolean updateLightingIf true, a day/night cycle is simulated. -
lightSrcFrom
public float lightSrcFromDay/night cycle parameters. -
lightSrcTo
public float lightSrcToDay/night cycle parameters. -
lightDstFrom
public float lightDstFromDay/night cycle parameters. -
lightDstTo
public float lightDstToDay/night cycle parameters. -
startSector
public int startSectorThe default starting sector displayed to the map dialog. -
sectorSeed
public int sectorSeedSeed for sector base generation on this planet. -1 to use a random one based on ID. -
launchCapacityMultiplier
public float launchCapacityMultipliermultiplier for core item capacity when launching -
bloom
public boolean bloomWhether the bloom render effect is enabled. -
visible
public boolean visibleWhether this planet is displayed. -
landCloudColor
Tint of clouds displayed when landing. -
lightColor
For suns, this is the color that shines on other planets. Does nothing for children. -
atmosphereColor
Atmosphere tint for landable planets. -
iconColor
Icon for appearance in planet list. -
hasAtmosphere
public boolean hasAtmosphereWhether this planet has an atmosphere. -
allowLaunchSchematics
public boolean allowLaunchSchematicsWhether to allow users to specify a custom launch schematic for this map. -
allowLaunchLoadout
public boolean allowLaunchLoadoutWhether to allow users to specify the resources they take to this map. -
allowWaveSimulation
public boolean allowWaveSimulationWhether to allow sectors to simulate waves in the background. -
allowSectorInvasion
public boolean allowSectorInvasionWhether to simulate sector invasions from enemy bases. -
clearSectorOnLose
public boolean clearSectorOnLoseIf true, sectors saves are cleared when lost. -
enemyBuildSpeedMultiplier
public float enemyBuildSpeedMultiplierMultiplier for enemy rebuild speeds; only applied in campaign (not standard rules) -
enemyCoreSpawnReplace
public boolean enemyCoreSpawnReplaceIf true, enemy cores are replaced with spawnpoints on this planet (for invasions) -
prebuildBase
public boolean prebuildBaseIf true, blocks in the radius of the core will be removed and "built up" in a shockwave upon landing. -
allowWaves
public boolean allowWavesIf true, waves are created on sector loss. TODO remove. -
allowLaunchToNumbered
public boolean allowLaunchToNumberedIf false, players are unable to land on this planet's numbered sectors. -
icon
Icon as displayed in the planet selection dialog. This is a string, as drawables are null at load time. -
defaultCore
Default core block for launching. -
ruleSetter
Sets up rules on game load for any sector on this planet. -
parent
Parent body that this planet orbits around. If null, this planet is considered to be in the middle of the solar system. -
solarSystem
The root parent of the whole solar system this planet is in. -
children
All planets orbiting this one, in ascending order of radius. -
techTree
Default root node shown when the tech tree is opened here. -
launchCandidates
TODO remove? Planets that can be launched to from this one. Made mutual in init(). -
itemWhitelist
The only items available on this planet, if defined. -
unlockedOnLand
Content (usually planet-specific) that is unlocked upon landing here. -
meshLoader
Loads the mesh. Clientside only. Defaults to a boring sphere mesh. -
cloudMeshLoader
Loads the mesh. Clientside only. Defaults to a boring sphere mesh. -
gridMeshLoader
Loads the planet grid outline mesh. Clientside only.
-
-
Constructor Details
-
Planet
-
Planet
-
-
Method Details
-
getStartSector
-
applyRules
-
getLastSector
-
setLastSector
-
preset
-
hasGrid
public boolean hasGrid()- Returns:
- whether this planet has a sector grid to select.
-
isLandable
public boolean isLandable()- Returns:
- whether this planet has any sectors to land on.
-
updateTotalRadius
public void updateTotalRadius() -
getLightNormal
-
getOrbitAngle
public float getOrbitAngle()Calculates orbital rotation based on universe time. -
getRotation
public float getRotation()Calculates rotation on own axis based on universe time. -
addParentOffset
Adds this planet's offset relative to its parent to the vector. Used for calculating world positions. -
getWorldPosition
Gets the absolute world position of this planet, taking into account all parents. O(n) complexity. -
updateBaseCoverage
public void updateBaseCoverage()Updates wave coverage of bases. -
getTransform
- Returns:
- the supplied matrix with transformation applied.
-
reloadMesh
public void reloadMesh()Regenerates the planet mesh. For debugging only. -
load
public void load()Description copied from class:Content
Called after all content is created, only on non-headless versions. Use for loading regions or other image data. -
init
public void init()Description copied from class:Content
Called after all content and modules are created. Do not use to load regions or texture data! -
getSector
Gets a sector a tile position. -
getSector
- Returns:
- the sector that is hit by this ray, or null if nothing intersects it.
-
getSector
- Returns:
- the sector that is hit by this ray, or null if nothing intersects it.
-
intersect
- Returns:
- the sector that is hit by this ray, or null if nothing intersects it.
-
isHidden
public boolean isHidden()Planets cannot be viewed in the database dialog.- Overrides:
isHidden
in classUnlockableContent
-
getContentType
Description copied from class:Content
Returns the type name of this piece of content. This should return the same value for all instances of this content type.- Specified by:
getContentType
in classContent
-
visible
public boolean visible() -
draw
-
drawAtmosphere
-
drawClouds
-
drawBorders
Draws sector borders. Supply the batch withtriangle
vertices. -
fill
Draws sector plane. Supply the batch withtriangle
vertices. -
drawSelection
public void drawSelection(VertexBatch3D batch, Sector sector, Color color, float stroke, float length) Draws sector when selected. Supply the batch withtriangle
vertices. -
renderSectors
Renders sector outlines. -
drawArc
public void drawArc(VertexBatch3D batch, Vec3 a, Vec3 b, Color from, Color to, float length, float timeScale, int pointCount) Draws an arc from one point to another on the planet.
-