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
FieldsModifier and TypeFieldDescriptionboolean
Whether this planet is listed in the planet access UI.boolean
If true, the player is allowed to change the difficulty/rules in the planet 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
If true, legacy launch pads can be enabled.boolean
Whether to simulate sector invasions from enemy bases.boolean
Whether interplanetary accelerators can launch to 'any' procedural sector on this planet's surface.boolean
If true, waves are created on sector loss.boolean
Whether to allow sectors to simulate waves in the background.arc.graphics.Color
Atmosphere tint for landable planets.float
Atmosphere radius adjustment parameters.float
Atmosphere radius adjustment parameters.boolean
If true, all content in this planet's tech tree will be assigned this planet in their shownPlanets.boolean
Whether the bloom render effect is enabled.Defaults applied to the rules.Global difficulty/modifier settings for this planet's campaign.float
Camera radius offset.arc.struct.Seq<Planet>
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.arc.func.Prov<GenericMesh>
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.arc.graphics.Mesh
Mesh used for rendering planet grid outlines.arc.func.Prov<arc.graphics.Mesh>
Loads the planet grid outline mesh.boolean
Whether this planet has an atmosphere.Icon as displayed in the planet selection dialog.arc.graphics.Color
Icon for appearance in planet list.arc.graphics.Color
Tint of clouds displayed when landing.arc.struct.Seq<Planet>
Planets that can be launched to from this one.float
multiplier for core item capacity when launchingarc.audio.Music
Plays in the planet dialog when this planet is selected.arc.graphics.Color
For 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.arc.func.Prov<GenericMesh>
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.arc.math.geom.Vec3
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.arc.func.Cons<Rules>
Sets up rules on game load for any sector on this planet.float
Approx.arc.struct.Seq<Sector>
Array of sectors; directly maps to tiles in the grid.int
Seed for sector base generation on this planet.boolean
If true, RTS AI can be customized.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.arc.struct.Seq<UnlockableContent>
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
allDatabaseTabs, alwaysUnlocked, databaseTabs, description, details, fullIcon, fullOverride, generateIcons, hideDatabase, hideDetails, inlineDescription, localizedName, selectionSize, shownPlanets, stats, techNode, techNodes, uiIcon, unlocked
Fields inherited from class mindustry.ctype.MappableContent
name
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarc.math.geom.Vec3
addParentOffset
(arc.math.geom.Vec3 in) Adds this planet's offset relative to its parent to the vector.void
applyDefaultRules
(CampaignRules rules) void
applyRules
(Rules rules) void
applyRules
(Rules rules, boolean customGame) void
draw
(PlanetParams params, arc.math.geom.Mat3D projection, arc.math.geom.Mat3D transform) void
drawArc
(arc.graphics.g3d.VertexBatch3D batch, arc.math.geom.Vec3 a, arc.math.geom.Vec3 b, arc.graphics.Color from, arc.graphics.Color to, float length, float timeScale, int pointCount) Draws an arc from one point to another on the planet.void
drawAtmosphere
(arc.graphics.Mesh atmosphere, arc.graphics.g3d.Camera3D cam) void
drawBorders
(arc.graphics.g3d.VertexBatch3D batch, Sector sector, arc.graphics.Color base, float alpha) Draws sector borders.void
drawClouds
(PlanetParams params, arc.math.geom.Mat3D projection, arc.math.geom.Mat3D transform) void
drawSelection
(arc.graphics.g3d.VertexBatch3D batch, Sector sector, arc.graphics.Color color, float stroke, float length) Draws sector when selected.void
Draws sector plane.Returns the type name of this piece of content.arc.math.geom.Vec3
float
Calculates orbital rotation based on universe time.float
Calculates rotation on own axis based on universe time.getSector
(arc.math.geom.Ray ray) getSector
(arc.math.geom.Ray ray, float radius) getSector
(PlanetGrid.Ptile tile) Gets a sector a tile position.arc.math.geom.Mat3D
getTransform
(arc.math.geom.Mat3D mat) arc.math.geom.Vec3
getWorldPosition
(arc.math.geom.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.arc.math.geom.Vec3
intersect
(arc.math.geom.Ray ray, float radius) 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
arc.math.geom.Vec3
void
preset
(int index, SectorPreset preset) arc.math.geom.Vec3
void
Regenerates the planet mesh.void
renderSectors
(arc.graphics.g3d.VertexBatch3D batch, arc.graphics.g3d.Camera3D cam, PlanetParams params) Renders sector outlines.void
void
setLastSector
(Sector sector) void
void
Updates wave coverage of bases.void
boolean
visible()
Methods inherited from class mindustry.ctype.UnlockableContent
checkStats, clearUnlock, createIcons, displayDescription, displayExtra, emoji, emojiChar, getDependencies, getLogicId, hasEmoji, isOnPlanet, loadIcon, locked, logicVisible, makeOutline, makeOutline, makeOutline, onUnlock, postInit, quietUnlock, researchRequirements, setStats, showUnlock, unlock, unlocked, unlockedHost, 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
@Nullable public arc.graphics.Mesh gridMeshMesh used for rendering planet grid outlines. Null on server or ifgrid
is null. -
position
public arc.math.geom.Vec3 positionPosition 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
public arc.graphics.Color landCloudColorTint of clouds displayed when landing. -
lightColor
public arc.graphics.Color lightColorFor suns, this is the color that shines on other planets. Does nothing for children. -
atmosphereColor
public arc.graphics.Color atmosphereColorAtmosphere tint for landable planets. -
iconColor
public arc.graphics.Color iconColorIcon 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. -
allowLegacyLaunchPads
public boolean allowLegacyLaunchPadsIf true, legacy launch pads can be enabled. -
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. -
allowCampaignRules
public boolean allowCampaignRulesIf true, the player is allowed to change the difficulty/rules in the planet UI. -
icon
Icon as displayed in the planet selection dialog. This is a string, as drawables are null at load time. -
launchMusic
public arc.audio.Music launchMusicPlays in the planet dialog when this planet is selected. -
defaultCore
Default core block for launching. -
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
Planets that can be launched to from this one. -
allowSelfSectorLaunch
public boolean allowSelfSectorLaunchWhether interplanetary accelerators can launch to 'any' procedural sector on this planet's surface. -
autoAssignPlanet
public boolean autoAssignPlanetIf true, all content in this planet's tech tree will be assigned this planet in their shownPlanets. -
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
public arc.func.Prov<arc.graphics.Mesh> gridMeshLoaderLoads the planet grid outline mesh. Clientside only. -
campaignRules
Global difficulty/modifier settings for this planet's campaign. -
campaignRuleDefaults
Defaults applied to the rules. -
ruleSetter
Sets up rules on game load for any sector on this planet. -
showRtsAIRule
public boolean showRtsAIRuleIf true, RTS AI can be customized.
-
-
Constructor Details
-
Planet
-
Planet
-
-
Method Details
-
saveRules
public void saveRules() -
loadRules
public void loadRules() -
getStartSector
-
applyRules
-
applyRules
-
applyDefaultRules
-
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
public arc.math.geom.Vec3 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
public arc.math.geom.Vec3 addParentOffset(arc.math.geom.Vec3 in) Adds this planet's offset relative to its parent to the vector. Used for calculating world positions. -
getWorldPosition
public arc.math.geom.Vec3 getWorldPosition(arc.math.geom.Vec3 in) 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
public arc.math.geom.Mat3D getTransform(arc.math.geom.Mat3D mat) - 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
@Nullable public arc.math.geom.Vec3 intersect(arc.math.geom.Ray ray, float radius) - 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
public void draw(PlanetParams params, arc.math.geom.Mat3D projection, arc.math.geom.Mat3D transform) -
drawAtmosphere
public void drawAtmosphere(arc.graphics.Mesh atmosphere, arc.graphics.g3d.Camera3D cam) -
drawClouds
public void drawClouds(PlanetParams params, arc.math.geom.Mat3D projection, arc.math.geom.Mat3D transform) -
drawBorders
public void drawBorders(arc.graphics.g3d.VertexBatch3D batch, Sector sector, arc.graphics.Color base, float alpha) Draws sector borders. Supply the batch withtriangle
vertices. -
fill
public void fill(arc.graphics.g3d.VertexBatch3D batch, Sector sector, arc.graphics.Color color, float offset) Draws sector plane. Supply the batch withtriangle
vertices. -
drawSelection
public void drawSelection(arc.graphics.g3d.VertexBatch3D batch, Sector sector, arc.graphics.Color color, float stroke, float length) Draws sector when selected. Supply the batch withtriangle
vertices. -
renderSectors
public void renderSectors(arc.graphics.g3d.VertexBatch3D batch, arc.graphics.g3d.Camera3D cam, PlanetParams params) Renders sector outlines. -
drawArc
public void drawArc(arc.graphics.g3d.VertexBatch3D batch, arc.math.geom.Vec3 a, arc.math.geom.Vec3 b, arc.graphics.Color from, arc.graphics.Color to, float length, float timeScale, int pointCount) Draws an arc from one point to another on the planet. -
lookAt
-
project
public arc.math.geom.Vec3 project(Sector sector, arc.graphics.g3d.Camera3D cam, arc.math.geom.Vec3 out) -
setPlane
-