Class CelestialBodyComponent
- Namespace
- KSP.Sim.impl
- Assembly
- Assembly-CSharp.dll
public class CelestialBodyComponent : ObjectComponent, IGuidIdentity, IRigidbodyDriver, IPositionDriver, IRotationDriver, ILinearMotionDriver, IAngularMotionDriver
- Inheritance
-
CelestialBodyComponent
- Implements
-
- Inherited Members
-
- Extension Methods
-
Constructors
CelestialBodyComponent()
public CelestialBodyComponent()
CelestialBodyComponent(CelestialBodyDefinition, IUniverseModel)
public CelestialBodyComponent(CelestialBodyDefinition definition, IUniverseModel universeModel)
Parameters
definition CelestialBodyDefinition
universeModel IUniverseModel
Fields
AngularVelocityYup
public Vector3d AngularVelocityYup
Field Value
- Vector3d
BodyFrame
public CelestialFrame BodyFrame
Field Value
- CelestialFrame
RotationOffset
public double RotationOffset
Field Value
- double
angularV
Field Value
- double
ringGroupData
public List<CelestialBodyRingData> ringGroupData
Field Value
- List<CelestialBodyRingData>
rotationAngle
public double rotationAngle
Field Value
- double
solarDayLength
public double solarDayLength
Field Value
- double
zUpAngularVelocity
public Vector3d zUpAngularVelocity
Field Value
- Vector3d
Properties
API
[TypeConverterIgnore]
public CelestialDataProvider API { get; }
Property Value
- CelestialDataProvider
AngularVelocity
[TypeConverterIgnore]
public AngularVelocity AngularVelocity { get; }
Property Value
- AngularVelocity
BodyAltitudeFluxCurve
public FloatCurve BodyAltitudeFluxCurve { get; }
Property Value
- FloatCurve
BodyAltitudeRelativeHumidityCurve
public FloatCurve BodyAltitudeRelativeHumidityCurve { get; }
Property Value
- FloatCurve
BodyAltitudeSurfaceFluxCurve
public FloatCurve BodyAltitudeSurfaceFluxCurve { get; }
Property Value
- FloatCurve
BodyAltitudeTemperatureCurve
public FloatCurve BodyAltitudeTemperatureCurve { get; }
Property Value
- FloatCurve
BodySurfaceFluxMapPath
public string BodySurfaceFluxMapPath { get; }
Property Value
- string
BodySurfaceFluxScale
public double BodySurfaceFluxScale { get; }
Property Value
- double
CanAcceptRotationUpdate
[TypeConverterIgnore]
public bool CanAcceptRotationUpdate { get; }
Property Value
- bool
DefinitionType
[TypeConverterIgnore]
public override Type DefinitionType { get; }
Property Value
- Type
Guid
[TypeConverterIgnore]
public string Guid { get; }
Property Value
- string
HasLocalSpace
public bool HasLocalSpace { get; }
Property Value
- bool
IsStar
public bool IsStar { get; }
Property Value
- bool
Mass
[TypeConverterIgnore]
public double Mass { get; }
Property Value
- double
MaxTerrainHeight
public double MaxTerrainHeight { get; }
Property Value
- double
MinTerrainHeight
public double MinTerrainHeight { get; }
Property Value
- double
Orbit
[TypeConverterIgnore]
public PatchedConicsOrbit Orbit { get; }
Property Value
- PatchedConicsOrbit
Orbiter
[TypeConverterIgnore]
public OrbiterComponent Orbiter { get; }
Property Value
- OrbiterComponent
Position
[TypeConverterIgnore]
public Position Position { get; }
Property Value
- Position
Rotation
[TypeConverterIgnore]
public Rotation Rotation { get; }
Property Value
- Rotation
SphereOfInfluenceCalculationType
public int SphereOfInfluenceCalculationType { get; }
Property Value
- int
StarLuminosity
public double StarLuminosity { get; }
Property Value
- double
State
[TypeConverterIgnore]
public CelestialBodyState State { get; set; }
Property Value
- CelestialBodyState
StateType
[TypeConverterIgnore]
public override Type StateType { get; }
Property Value
- Type
SurfaceProvider
[TypeConverterIgnore]
public ISurfaceProvider SurfaceProvider { get; set; }
Property Value
- ISurfaceProvider
TerrainHeightScale
public double TerrainHeightScale { get; }
Property Value
- double
TimeWarpAltitudeOffset
public double TimeWarpAltitudeOffset { get; }
Property Value
- double
Type
[TypeConverterIgnore]
public override Type Type { get; }
Property Value
- Type
Velocity
[TypeConverterIgnore]
public Velocity Velocity { get; }
Property Value
- Velocity
ViewObjectComponentType
[TypeConverterIgnore]
public override Type ViewObjectComponentType { get; }
Property Value
- Type
albedo
public double albedo { get; }
Property Value
- double
assetKeyScaled
public string assetKeyScaled { get; }
Property Value
- string
assetKeySimulation
public string assetKeySimulation { get; }
Property Value
- string
atmosphereAdiabaticIndex
public double atmosphereAdiabaticIndex { get; }
Property Value
- double
atmosphereContainsOxygen
public bool atmosphereContainsOxygen { get; }
Property Value
- bool
atmosphereDensityASL
[TypeConverterIgnore]
public double atmosphereDensityASL { get; }
Property Value
- double
atmosphereDepth
public double atmosphereDepth { get; }
Property Value
- double
atmosphereGasMassLapseRate
public double atmosphereGasMassLapseRate { get; }
Property Value
- double
atmosphereMolarMass
public double atmosphereMolarMass { get; }
Property Value
- double
atmospherePressureCurve
public FloatCurve atmospherePressureCurve { get; }
Property Value
- FloatCurve
atmospherePressureSeaLevel
public double atmospherePressureSeaLevel { get; }
Property Value
- double
atmosphereTemperatureLapseRate
public double atmosphereTemperatureLapseRate { get; }
Property Value
- double
atmosphereTemperatureSeaLevel
public double atmosphereTemperatureSeaLevel { get; }
Property Value
- double
axialTilt
public QuaternionD axialTilt { get; }
Property Value
- QuaternionD
bodyDescription
public string bodyDescription { get; }
Property Value
- string
bodyDisplayName
public string bodyDisplayName { get; }
Property Value
- string
bodyMotionFrame
[TypeConverterIgnore]
public IMotionFrame bodyMotionFrame { get; }
Property Value
- IMotionFrame
bodyName
public string bodyName { get; }
Property Value
- string
celestialMotionFrame
[TypeConverterIgnore]
public IMotionFrame celestialMotionFrame { get; }
Property Value
- IMotionFrame
clampInverseRotThreshold
public bool clampInverseRotThreshold { get; }
Property Value
- bool
convectionMultiplier
public double convectionMultiplier { get; }
Property Value
- double
coordinateSystem
[TypeConverterIgnore]
public ICoordinateSystem coordinateSystem { get; }
Property Value
- ICoordinateSystem
coreTemperatureOffset
public double coreTemperatureOffset { get; }
Property Value
- double
density
[TypeConverterIgnore]
public double density { get; }
Property Value
- double
directRotAngle
[TypeConverterIgnore]
public double directRotAngle { get; }
Property Value
- double
emissivity
public double emissivity { get; }
Property Value
- double
gMagnitudeAtCenter
[TypeConverterIgnore]
public double gMagnitudeAtCenter { get; }
Property Value
- double
gravParameter
[TypeConverterIgnore]
public double gravParameter { get; }
Property Value
- double
gravityASL
public double gravityASL { get; }
Property Value
- double
hasAtmosphere
public bool hasAtmosphere { get; }
Property Value
- bool
hasInverseRotation
[TypeConverterIgnore]
public bool hasInverseRotation { get; }
Property Value
- bool
hasOcean
public bool hasOcean { get; }
Property Value
- bool
hasSolarRotationPeriod
public bool hasSolarRotationPeriod { get; }
Property Value
- bool
hasSolidSurface
public bool hasSolidSurface { get; }
Property Value
- bool
hillSphere
[TypeConverterIgnore]
public double hillSphere { get; }
Property Value
- double
initialRotation
public double initialRotation { get; }
Property Value
- double
inverseRotThresholdAltitude
public float inverseRotThresholdAltitude { get; }
Property Value
- float
isAtmospherePressureCurveNormalized
public bool isAtmospherePressureCurveNormalized { get; }
Property Value
- bool
isAtmosphereTemperatureCurveNormalized
public bool isAtmosphereTemperatureCurveNormalized { get; }
Property Value
- bool
isHomeWorld
public bool isHomeWorld { get; }
Property Value
- bool
isTidallyLocked
public bool isTidallyLocked { get; }
Property Value
- bool
localPosition
[TypeConverterIgnore]
public Vector3d localPosition { get; }
Property Value
- Vector3d
localRotation
[TypeConverterIgnore]
public QuaternionD localRotation { get; }
Property Value
- QuaternionD
maxAxialDot
[TypeConverterIgnore]
public double maxAxialDot { get; }
Property Value
- double
minOrbitalDistance
public double minOrbitalDistance { get; }
Property Value
- double
navballSwitchAltitudeHigh
public double navballSwitchAltitudeHigh { get; }
Property Value
- double
navballSwitchAltitudeLow
public double navballSwitchAltitudeLow { get; }
Property Value
- double
oceanAFGAltMult
public float oceanAFGAltMult { get; }
Property Value
- float
oceanAFGBase
public float oceanAFGBase { get; }
Property Value
- float
oceanAFGLerp
public bool oceanAFGLerp { get; }
Property Value
- bool
oceanAFGMin
public float oceanAFGMin { get; }
Property Value
- float
oceanAlbedoDistanceScalar
public float oceanAlbedoDistanceScalar { get; }
Property Value
- float
oceanAlphaDistanceScalar
public float oceanAlphaDistanceScalar { get; }
Property Value
- float
oceanAltitude
public double oceanAltitude { get; }
Property Value
- double
oceanDensity
public double oceanDensity { get; }
Property Value
- double
oceanFogColorEnd
public Color oceanFogColorEnd { get; }
Property Value
- Color
oceanFogColorStart
public Color oceanFogColorStart { get; }
Property Value
- Color
oceanFogDawnFactor
public float oceanFogDawnFactor { get; }
Property Value
- float
oceanFogDensityAltScalar
public float oceanFogDensityAltScalar { get; }
Property Value
- float
oceanFogDensityEnd
public float oceanFogDensityEnd { get; }
Property Value
- float
oceanFogDensityExponent
public float oceanFogDensityExponent { get; }
Property Value
- float
oceanFogDensityPQSMult
public float oceanFogDensityPQSMult { get; }
Property Value
- float
oceanFogDensityStart
public float oceanFogDensityStart { get; }
Property Value
- float
oceanFogPQSDepth
public double oceanFogPQSDepth { get; }
Property Value
- double
oceanFogPQSDepthRecip
public float oceanFogPQSDepthRecip { get; }
Property Value
- float
oceanMaxAlbedoFog
public float oceanMaxAlbedoFog { get; }
Property Value
- float
oceanMaxAlphaFog
public float oceanMaxAlphaFog { get; }
Property Value
- float
oceanMinAlphaFogDistance
public float oceanMinAlphaFogDistance { get; }
Property Value
- float
oceanSkyColorMult
public float oceanSkyColorMult { get; }
Property Value
- float
oceanSkyColorOpacityAltMult
public float oceanSkyColorOpacityAltMult { get; }
Property Value
- float
oceanSkyColorOpacityBase
public float oceanSkyColorOpacityBase { get; }
Property Value
- float
oceanSunAltMult
public float oceanSunAltMult { get; }
Property Value
- float
oceanSunBase
public float oceanSunBase { get; }
Property Value
- float
oceanSunMin
public float oceanSunMin { get; }
Property Value
- float
oceanUseFog
public bool oceanUseFog { get; }
Property Value
- bool
orbitingBodies
[TypeConverterIgnore]
public List<CelestialBodyComponent> orbitingBodies { get; }
Property Value
- List<CelestialBodyComponent>
radius
public double radius { get; }
Property Value
- double
radiusAtmosphereFactor
[TypeConverterIgnore]
public double radiusAtmosphereFactor { get; }
Property Value
- double
referenceBody
[TypeConverterIgnore]
public CelestialBodyComponent referenceBody { get; }
Property Value
- CelestialBodyComponent
relativeAngularVelocity
[TypeConverterIgnore]
public Vector relativeAngularVelocity { get; set; }
Property Value
- Vector
relativeToMotion
[TypeConverterIgnore]
public IMotion relativeToMotion { get; }
Property Value
- IMotion
relativeVelocity
[TypeConverterIgnore]
public Vector relativeVelocity { get; }
Property Value
- Vector
rotPeriodRecip
[TypeConverterIgnore]
public double rotPeriodRecip { get; }
Property Value
- double
rotates
public bool rotates { get; }
Property Value
- bool
rotationPeriod
public double rotationPeriod { get; }
Property Value
- double
scaledElipRadMult
public Vector3d scaledElipRadMult { get; }
Property Value
- Vector3d
scaledRadiusHorizMultiplier
public double scaledRadiusHorizMultiplier { get; }
Property Value
- double
shockTemperatureMultiplier
public double shockTemperatureMultiplier { get; }
Property Value
- double
sphereOfInfluence
[TypeConverterIgnore]
public double sphereOfInfluence { get; }
Property Value
- double
sunlightPrefab
public string sunlightPrefab { get; }
Property Value
- string
surfaceArea
[TypeConverterIgnore]
public double surfaceArea { get; }
Property Value
- double
universeModel
[TypeConverterIgnore]
public IUniverseModel universeModel { get; }
Property Value
- IUniverseModel
useAtmosphereHumidityCurve
public bool useAtmosphereHumidityCurve { get; }
Property Value
- bool
useAtmospherePressureCurve
public bool useAtmospherePressureCurve { get; }
Property Value
- bool
useAtmosphereTemperatureCurve
public bool useAtmosphereTemperatureCurve { get; }
Property Value
- bool
Methods
AddChild(CelestialBodyComponent)
public void AddChild(CelestialBodyComponent childBody)
Parameters
childBody CelestialBodyComponent
CalculateGeosyncAltitudeFromRadius()
public double CalculateGeosyncAltitudeFromRadius()
Returns
- double
CalculateGeosyncDistFromCenter()
public double CalculateGeosyncDistFromCenter()
Returns
- double
CelestialBodyOrderedUpdate(double)
public void CelestialBodyOrderedUpdate(double universalTime)
Parameters
universalTime double
GetAltitudeFromRadius(Position)
public double GetAltitudeFromRadius(Position position)
Parameters
position Position
Returns
- double
GetAltitudeFromRadius(Vector3d, ICoordinateSystem)
public double GetAltitudeFromRadius(Vector3d position, ICoordinateSystem positionCoordinateSystem)
Parameters
position Vector3d
positionCoordinateSystem ICoordinateSystem
Returns
- double
GetAltitudeFromTerrain(Position, out double, out double)
public void GetAltitudeFromTerrain(Position position, out double terrainAltitude, out double sceneryOffset)
Parameters
position Position
terrainAltitude double
sceneryOffset double
GetBiomeDataAtPosition(Position)
public PQSData.BiomeSurfaceData GetBiomeDataAtPosition(Position position)
Parameters
position Position
Returns
- PQSData.BiomeSurfaceData
GetBiomeDataAtPosition(Vector3)
public PQSData.BiomeSurfaceData GetBiomeDataAtPosition(Vector3 position)
Parameters
position Vector3
Returns
- PQSData.BiomeSurfaceData
GetBiomeTypeAtPosition(Position)
public PQSData.KSP2BiomeType GetBiomeTypeAtPosition(Position position)
Parameters
position Position
Returns
- PQSData.KSP2BiomeType
GetBiomeTypeAtPosition(Vector3)
public PQSData.KSP2BiomeType GetBiomeTypeAtPosition(Vector3 position)
Parameters
position Vector3
Returns
- PQSData.KSP2BiomeType
GetDefinition()
public override object GetDefinition()
Returns
- object
GetDensity(double, double)
public double GetDensity(double pressure, double temperature)
Parameters
pressure double
temperature double
Returns
- double
GetDensityRecip()
public double GetDensityRecip()
Returns
- double
GetDynamicPressurekPa(double, double, ITransformFrame, ITransformModel)
public double GetDynamicPressurekPa(double pressure, double temperature, ITransformFrame bodyReferenceFrame, ITransformModel targetTransform)
Parameters
pressure double
temperature double
bodyReferenceFrame ITransformFrame
targetTransform ITransformModel
Returns
- double
GetFrameVelAtUTZup(double)
public Vector3d GetFrameVelAtUTZup(double UT)
Parameters
UT double
Returns
- Vector3d
GetFrameVelZup()
public Vector3d GetFrameVelZup()
Returns
- Vector3d
GetLatLonAltFromRadius(ICoordinateSystem, Vector3d, out double, out double, out double)
public void GetLatLonAltFromRadius(ICoordinateSystem coordinateSystem, Vector3d localPosition, out double lat, out double lon, out double altFromRadius)
Parameters
coordinateSystem ICoordinateSystem
localPosition Vector3d
lat double
lon double
altFromRadius double
GetLatLonAltFromRadius(Position, out double, out double, out double)
public void GetLatLonAltFromRadius(Position pos, out double lat, out double lon, out double altFromRadius)
Parameters
pos Position
lat double
lon double
altFromRadius double
GetPressure(double)
public double GetPressure(double altitudeFromSeaLevel)
Parameters
altitudeFromSeaLevel double
Returns
- double
GetRelSurfaceDirection(Vector3d)
public Vector3d GetRelSurfaceDirection(Vector3d worldDirection)
Parameters
worldDirection Vector3d
Returns
- Vector3d
GetRelSurfaceNVector(double, double)
public Vector3d GetRelSurfaceNVector(double lat, double lon)
Parameters
lat double
lon double
Returns
- Vector3d
GetRelSurfacePosition(ICoordinateSystem, Vector3d)
public Vector3d GetRelSurfacePosition(ICoordinateSystem coordinateSystem, Vector3d localPosition)
Parameters
coordinateSystem ICoordinateSystem
localPosition Vector3d
Returns
- Vector3d
GetRelSurfacePosition(double, double, double)
public Vector3d GetRelSurfacePosition(double lat, double lon, double altFromRadius)
Parameters
lat double
lon double
altFromRadius double
Returns
- Vector3d
GetRelSurfacePosition(double, double, double, out Vector3d)
public Vector3d GetRelSurfacePosition(double lat, double lon, double radiusAlt, out Vector3d normal)
Parameters
lat double
lon double
radiusAlt double
normal Vector3d
Returns
- Vector3d
GetRelativeHumidityPercentage(double)
public double GetRelativeHumidityPercentage(double altitude)
Parameters
altitude double
Returns
- double
GetRelevantStar()
public CelestialBodyComponent GetRelevantStar()
Returns
- CelestialBodyComponent
GetSolarAtmosphericEffects(double, double, out double, out double)
public void GetSolarAtmosphericEffects(double sunDot, double density, out double solarAirMass, out double solarFluxMultiplier)
Parameters
sunDot double
density double
solarAirMass double
solarFluxMultiplier double
GetSolarPowerFactor(double)
public double GetSolarPowerFactor(double density)
Parameters
density double
Returns
- double
GetState()
public override object GetState()
Returns
- object
GetSurfaceNVector(double, double)
public Vector3d GetSurfaceNVector(double lat, double lon)
Parameters
lat double
lon double
Returns
- Vector3d
GetTemperature(double)
public double GetTemperature(double altitude)
Parameters
altitude double
Returns
- double
GetTruePositionAtT(double)
public Position GetTruePositionAtT(double T)
Parameters
T double
Returns
- Position
GetTruePositionAtT(double, ICoordinateSystem)
public Vector3d GetTruePositionAtT(double T, ICoordinateSystem coordinateSystem)
Parameters
T double
coordinateSystem ICoordinateSystem
Returns
- Vector3d
GetTruePositionAtUT(double)
public Position GetTruePositionAtUT(double UT)
Parameters
UT double
Returns
- Position
GetTruePositionAtUT(double, ICoordinateSystem)
public Vector3d GetTruePositionAtUT(double UT, ICoordinateSystem coordinateSystem)
Parameters
UT double
coordinateSystem ICoordinateSystem
Returns
- Vector3d
GetWorldSurfacePosition(double, double, double, ICoordinateSystem)
public Vector3d GetWorldSurfacePosition(double lat, double lon, double altFromRadius, ICoordinateSystem coordinateSystem)
Parameters
lat double
lon double
altFromRadius double
coordinateSystem ICoordinateSystem
Returns
- Vector3d
HasChild(CelestialBodyComponent)
public bool HasChild(CelestialBodyComponent body)
Parameters
body CelestialBodyComponent
Returns
- bool
HasParent(CelestialBodyComponent)
public bool HasParent(CelestialBodyComponent body)
Parameters
body CelestialBodyComponent
Returns
- bool
OnAdded(SimulationObjectModel, double)
public override void OnAdded(SimulationObjectModel simulationObject, double universalTime)
Parameters
simulationObject SimulationObjectModel
universalTime double
OnFixedUpdate(double, double)
public override void OnFixedUpdate(double universalTime, double universalTimeDelta)
Parameters
universalTime double
universalTimeDelta double
OnRemoved(SimulationObjectModel, double)
public override void OnRemoved(SimulationObjectModel simulationObject, double universalTime)
Parameters
simulationObject SimulationObjectModel
universalTime double
OnStart(double)
public override void OnStart(double universalTime)
Parameters
universalTime double
RevealAltitude()
public double RevealAltitude()
Returns
- double
RevealMass()
public float RevealMass()
Returns
- float
RevealSpeed()
public double RevealSpeed()
Returns
- double
SetDefinition(object)
public override void SetDefinition(object definitionData)
Parameters
definitionData object
SetState(object, ISimulationModelMap)
public override object SetState(object state, ISimulationModelMap simulationModelMap)
Parameters
state object
simulationModelMap ISimulationModelMap
Returns
- object
SetTerrainPhysicsAtCachedPosition(KSP2BiomeType)
public void SetTerrainPhysicsAtCachedPosition(PQSData.KSP2BiomeType biomeType)
Parameters
biomeType PQSData.KSP2BiomeType
SetupConstants()
public void SetupConstants()
TryGetSurfaceObjectPosition(string, out Position, out Rotation)
public bool TryGetSurfaceObjectPosition(string surfaceObjectName, out Position position, out Rotation rotation)
Parameters
surfaceObjectName string
position Position
rotation Rotation
Returns
- bool
UpdateAngularVelocity(AngularVelocity)
public void UpdateAngularVelocity(AngularVelocity newAngularVelocity)
Parameters
newAngularVelocity AngularVelocity
UpdatePosition(Position)
public void UpdatePosition(Position newPosition)
Parameters
newPosition Position
UpdateRotation(Rotation)
public void UpdateRotation(Rotation newRotation)
Parameters
newRotation Rotation
UpdateVelocity(Velocity)
public void UpdateVelocity(Velocity newVelocity)
Parameters
newVelocity Velocity
ValidateState(object, ISimulationModelMap)
public override bool ValidateState(object stateData, ISimulationModelMap simulationModelMap)
Parameters
stateData object
simulationModelMap ISimulationModelMap
Returns
- bool
Events
AngularVelocityUpdated
public event Action<AngularVelocity> AngularVelocityUpdated
Event Type
- Action<AngularVelocity>
PositionUpdated
public event Action<Position> PositionUpdated
Event Type
- Action<Position>
RotationUpdated
public event Action<Rotation> RotationUpdated
Event Type
- Action<Rotation>
VelocityUpdated
public event Action<Velocity> VelocityUpdated
Event Type
- Action<Velocity>