Skip to content

Blueprints API

Davor Bokun edited this page Feb 8, 2020 · 4 revisions

Planetesimal Component

Core component for setting up the atmospheric scattering effect properties.

Utility Functions

EarthRadiiToUU

Converts length unit from Earth radii to Unreal Engine units (with respect to ReferentEarthSize setting).

UUToEarthRadii

Converts length unit from Unreal Engine units to Earth radii (with respect to ReferentEarthSize setting).

KmToUU

Converts length unit from km to Unreal Engine units (with respect to ReferentEarthSize setting).

UUToKm

Converts length unit from Unreal Engine units to km (with respect to ReferentEarthSize setting).

KmToEarthRadii

Converts length unit from km to Earth radii.

EarthRadiiToKm

Converts length unit from Earth radii to km.

Atmosphere Sampling Functions

SampleOpticalDensity

Samples and returns optical density at the location for all layers at once.

SamplePressureAtLocation

Samples and returns atmospheric pressure at the location [kPa].

SampleGasAtLocation

Samples and returns partial pressure of a specific gas at the location [kPa].

SampleAerosolAtLocation

Samples and returns density of a specific aerosol at the location.

SampleEmissiveAtLocation

Samples and returns density of a specific emissive at the location.

SampleGasesAtLocation

Samples and returns partial pressures of all gases at the location [kPa].

SampleAerosolDensitiesAtLocation

Samples and returns densities of all aerosols at the location.

SampleEmissiveDensitiesAtLocation

Samples and returns densities of all emissives at the location.

SampleAtmosphereContentAtLocation

Samples and returns partial pressures of all gases, densities of all aerosols, and densities of all emissives at the location at once.

Update Event Dispatchers

These event dispatchers are used primarily when ManuallyUpdate... switches are set to true and OnMaterialParams...Change interface functions are implemented, to broadcast the changes downstream.

BroadcastSunParamsUpdate

Planetesimal sun material parameters changed.

BroadcastPersistentParamsUpdate

Planetesimal persistent material parameters changed.

BroadcastSlowParamsUpdate

Planetesimal slow material parameters changed.

BroadcastFastParamsUpdate

Planetesimal fast material parameters changed.

Advanced Usage

TickLocation

Update atmosphere's Center of Mass to match Planetesimal Component's location and optionally broadcast the change.

RefreshCachedParams

Forces refresh of cached material parameters for the planetesimal component.

RawUpdateSun

Passes Sun params to RawParamsInterface (gets called automatically in most cases).

RawUpdatePersistent

Passes persistent params to RawParamsInterface (gets called automatically in most cases).

RawUpdateSlow

Passes slow params to RawParamsInterface (gets called automatically in most cases).

RawUpdateFast

Passes fast params to RawParamsInterface (gets called automatically in most cases).

Editor Actions

BroadcastCachedParams

Broadcasts cached material parameters.

RecalculateMaps

Recalculate rho map and phase curves for the Planetesimal (reads rho map from cache if available). Can be used to update atmospheric compounds database changes.

StoreRhoMapCache

Store rho map cache as asset for fast loading. Map are stored as texture assets in directory defined by Maps Cache Directory in the Project Settings for the Planetesimal plugin.

Planetesimal Material Component

Utility component for setting up dynamic material instances in both the editor and in game.

NOTE: Use of this component is optional. The atmospheric scattering effect can be set up without it.

Using Manual Dynamic Material Instances

RegisterMaterialInstance

Manually register material instance for automatic updates.

UnregisterMaterialInstance

Unregister manually registered material instance.

Advanced Usage

UpdateMaterialsSun

Propagates planetesimal parameters to all registered dynamic material instances.

UpdateMaterialsPersistent

Propagates planetesimal parameters to all registered dynamic material instances.

UpdateMaterialsSlow

Propagates planetesimal parameters to all registered dynamic material instances.

UpdateMaterialsFast

Propagates planetesimal parameters to all registered dynamic material instances.

SetupDynamicMaterials

Sets up dynamic material instances according to the selected method.

Interfaces

Planetesimal Actor Interface

OnPlanetScaleChanged

Called when this planetesimal actor's planet mesh scale changes. Scale is relative to the size defined by ReferentEarthSize and PlanetesimalMeshSize.

OnAtmosphereScaleChanged

Called when this planetesimal actor's atmosphere mesh scale changes. Scale is relative to the size defined by ReferentEarthSize and PlanetesimalMeshSize.

OnMaterialParamsSlowChanged

Called when planetesimal bManuallyUpdateSlow is checked. BroadcastMaterialParamsSlow should be called manually on the Planetesimal Component.

OnMaterialParamsFastChanged

Called when planetesimal bManuallyUpdateFast is checked. BroadcastMaterialParamsFast should be called manually on the Planetesimal Component.

Planetesimal Raw Params Interface

OnSetMaterialScalarParameterValue

Called for each updated scalar material parameter for the Planetesimal

OnSetMaterialVectorParameterValue

Called for each updated vector material parameter for the Planetesimal

OnSetMaterialTextureParameterValue

Called for each updated texture material parameter for the Planetesimal

Star Map Interface

RegisterStarMapEventCallback

Planetesimal material parameters changed event.

GetObjectParams

Get star map object's current location and color.

Blueprint Functions Library

Physical Constants

GetGasConstant [pure]

Gets the universal gas constant value at float precision. [N.m/mol.K]

Atmospherics

StoreRhoMap

Stores the planetesimal's rho map as an Unreal Engine Data Asset.

RenderPlanetesimalRhoMap

Renders the planetesimal's rho map into the texture.

OpticalDensity

Optical density for all four layers at a given height.

NOTE: All parameter values are normalized to the planetesimal radius.

HenyeyGreensteinPhase

Henyey-Greenstein phase function value given by the following formula:

CornetteShanksPhase

Cornette-Shanks phase function value given by the following formula:

Clone this wiki locally