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 ClassesNested classes/interfaces inherited from class mindustry.ctype.Content
Content.ModContentInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanWhether this planet is listed in the planet access UI.booleanIf true, the player is allowed to change the difficulty/rules in the planet UI.booleanWhether to allow users to specify the resources they take to this map.booleanWhether to allow users to specify a custom launch schematic for this map.booleanIf false, players are unable to land on this planet's numbered sectors.booleanIf true, legacy launch pads can be enabled.booleanWhether to simulate sector invasions from enemy bases.booleanWhether interplanetary accelerators can launch to 'any' procedural sector on this planet's surface.booleanIf true, waves are created on sector loss.booleanWhether to allow sectors to simulate waves in the background.arc.graphics.ColorAtmosphere tint for landable planets.floatAtmosphere radius adjustment parameters.floatAtmosphere radius adjustment parameters.booleanIf true, all content in this planet's tech tree will be assigned this planet in their shownPlanets.booleanWhether the bloom render effect is enabled.Defaults applied to the rules.Global difficulty/modifier settings for this planet's campaign.floatCamera radius offset.arc.struct.Seq<Planet>All planets orbiting this one, in ascending order of radius.booleanIf true, sectors saves are cleared when lost.floatFrustum sphere clip radius.Mesh used for rendering planet clouds.arc.func.Prov<GenericMesh>Loads the mesh.Data indicating attack sector positions and sector mappings.Environment attributes.Default core block for launching.intEnvironment flags for sectors on this planet.booleanWhether to draw the orbital circle.floatMultiplier for enemy rebuild speeds; only applied in campaign (not standard rules)booleanIf true, enemy cores are replaced with spawnpoints on this planet (for invasions)booleanIf true, the enemy team always has infinite items.Generator that will make the planet.Grid used for the sectors on the planet.arc.graphics.MeshMesh used for rendering planet grid outlines.arc.func.Prov<arc.graphics.Mesh>Loads the planet grid outline mesh.booleanWhether this planet has an atmosphere.Icon as displayed in the planet selection dialog.arc.graphics.ColorIcon for appearance in planet list.arc.graphics.ColorTint of clouds displayed when landing.arc.struct.Seq<Planet>Planets that can be launched to from this one.floatmultiplier for core item capacity when launchingarc.audio.MusicPlays in the planet dialog when this planet is selected.arc.graphics.ColorFor suns, this is the color that shines on other planets.floatDay/night cycle parameters.floatDay/night cycle parameters.floatDay/night cycle parameters.floatDay/night cycle parameters.booleanIf true, planet data is loaded as 'planets/{name}.json'.floatMaximum camera zoom value.Mesh used for rendering.arc.func.Prov<GenericMesh>Loads the mesh.floatMinimum camera zoom value.floatRandom orbit angle offset to prevent planets from starting out in a line.floatOrbital radius around the sun.floatDefault spacing between planet orbits in world units.floatTime for the planet to orbit around the sun once, in seconds.Parent body that this planet orbits around.arc.math.geom.Vec3Position in global coordinates.booleanIf true, blocks in the radius of the core will be removed and "built up" in a shockwave upon landing.floatRadius of this planet's sphere.floatTime 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.floatApprox.arc.struct.Seq<Sector>Array of sectors; directly maps to tiles in the grid.intSeed for sector base generation on this planet.booleanIf true, RTS AI can be customized.The root parent of the whole solar system this planet is in.intThe default starting sector displayed to the map dialog.Default root node shown when the tech tree is opened here.booleanWhether this planet is tidally locked relative to its parent - see https://en.wikipedia.org/wiki/Tidal_lockingfloatTotal radius of this planet and all its children.arc.struct.Seq<UnlockableContent>Content (usually planet-specific) that is unlocked upon landing here.booleanIf true, a day/night cycle is simulated.booleanWhether 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, unlockedFields inherited from class mindustry.ctype.MappableContent
name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarc.math.geom.Vec3addParentOffset(arc.math.geom.Vec3 in) Adds this planet's offset relative to its parent to the vector.voidapplyDefaultRules(CampaignRules rules) voidapplyRules(Rules rules) voidapplyRules(Rules rules, boolean customGame) voiddraw(PlanetParams params, arc.math.geom.Mat3D projection, arc.math.geom.Mat3D transform) voiddrawArc(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.voiddrawArcLine(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, float stroke) Draws an arc from one point to another on the planet.voiddrawAtmosphere(arc.graphics.Mesh atmosphere, arc.graphics.g3d.Camera3D cam) voiddrawBorders(arc.graphics.g3d.VertexBatch3D batch, Sector sector, arc.graphics.Color base, float alpha) Draws sector borders.voiddrawClouds(PlanetParams params, arc.math.geom.Mat3D projection, arc.math.geom.Mat3D transform) voiddrawSelection(arc.graphics.g3d.VertexBatch3D batch, Sector sector, arc.graphics.Color color, float stroke, float length) Draws sector when selected.voidDraws sector plane.Returns the type name of this piece of content.getData()arc.math.geom.Vec3floatCalculates orbital rotation based on universe time.floatCalculates 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.Mat3DgetTransform(arc.math.geom.Mat3D mat) arc.math.geom.Vec3getWorldPosition(arc.math.geom.Vec3 in) Gets the absolute world position of this planet, taking into account all parents.booleanhasGrid()voidinit()Called after all content and modules are created.arc.math.geom.Vec3intersect(arc.math.geom.Ray ray, float radius) booleanisHidden()Planets cannot be viewed in the database dialog.booleanvoidload()Called after all content is created, only on non-headless versions.voidarc.math.geom.Vec3voidpreset(int index, SectorPreset preset) arc.math.geom.Vec3voidRegenerates the planet mesh.voidvoidrenderSectors(arc.graphics.g3d.VertexBatch3D batch, arc.graphics.g3d.Camera3D cam, PlanetParams params) Renders sector outlines.voidvoidsetLastSector(Sector sector) voidvoidUpdates wave coverage of bases.voidbooleanvisible()Methods inherited from class mindustry.ctype.UnlockableContent
afterPatch, checkStats, clearUnlock, createIcons, displayDescription, displayExtra, emoji, emojiChar, getDependencies, getLogicId, hasEmoji, isBanned, isOnPlanet, loadIcon, locked, logicVisible, makeOutline, makeOutline, makeOutline, onUnlock, postInit, quietUnlock, researchRequirements, setStats, showUnlock, unlock, unlocked, unlockedHost, unlockedNow, unlockedNowHostMethods inherited from class mindustry.ctype.MappableContent
toStringMethods 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 ifgridis 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. -
maxZoom
public float maxZoomMaximum 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) -
enemyInfiniteItems
public boolean enemyInfiniteItemsIf true, the enemy team always has infinite items. -
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. -
loadPlanetData
public boolean loadPlanetDataIf true, planet data is loaded as 'planets/{name}.json'. This is only tested/functional in vanilla! -
data
Data indicating attack sector positions and sector mappings.
-
-
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. -
reloadMeshAsync
public void reloadMeshAsync() -
load
public void load()Description copied from class:ContentCalled 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:ContentCalled after all content and modules are created. Do not use to load regions or texture data! -
getData
-
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:
isHiddenin classUnlockableContent
-
getContentType
Description copied from class:ContentReturns the type name of this piece of content. This should return the same value for all instances of this content type.- Specified by:
getContentTypein 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 withtrianglevertices. -
fill
public void fill(arc.graphics.g3d.VertexBatch3D batch, Sector sector, arc.graphics.Color color, float offset) Draws sector plane. Supply the batch withtrianglevertices. -
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 withtrianglevertices. -
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. -
drawArcLine
public void drawArcLine(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, float stroke) Draws an arc from one point to another on the planet. Has thickness. -
lookAt
-
project
public arc.math.geom.Vec3 project(Sector sector, arc.graphics.g3d.Camera3D cam, arc.math.geom.Vec3 out) -
setPlane
-