Skip to main content

HeatPoint

A class in Root.Township, Alta.Heat.

One point of temperature on an object. The server conducts heat between neighbouring points, heat areas and the ambient air every physics step and syncs the temperature to clients. A component on a prefab, usually under a heat point collection.

Constructors​

MemberWhat it is
HeatPoint()Creates a HeatPoint with default values.

Fields​

MemberWhat it is
protected float internalConductivityMultiplierSerialized base for internal conduction. ConductTo squares this raw field for same-entity points, skipping the global and armour multipliers.
protected float receiveConductivityMultiplierSerialized base for ReceiveConductivityMultiplier.
protected float sourceConductivityMultiplierSerialized base for SourceConductivityMultiplier.
10 private and internal fields
MemberWhat it is
private float armorConductivityConductivity factor from equipped armour, multiplied into all three conductivity values (1 with no armour).
private float baseVolumeStarting Volume set in Awake. More volume means more energy to heat or cool.
private Transform effectParentTransform that heat effects (like glowing) are spawned under.
private EquipmentReference equipmentSlotOptional equipment slot whose armour changes this point's conductivity.
private bool hasChangedSyncLastSyncServer: true while the temperature has changed since the last Sync, read by IsNeedingSync.
private List<int> heatAreaPrioritiesPriorities of the heat areas this point is inside, kept so HighestPriorityHeatArea can be recalculated on exit.
private bool isChangedServer: set when the temperature changes, so the next FixedUpdate runs OnChanged.
private HeatPoint.Neighbour[] neighboursOther heat points this one conducts heat to every physics step, each with a distance multiplier.
private PositionFromOriginHelper positionHelperOptional PositionFromOriginHelper used to build PositionHelper.
private float temperatureBacking field for Temperature. Saved and loaded directly; loaded values beyond 10000 or NaN reset to ambient.

Properties​

MemberWhat it is
AmbientTemperatureChecker AmbientChecker { get; }Works out the ambient temperature for the entity's position and whether a temperature counts as ambient.
NetworkEntity Entity { get; set; }The network entity this point belongs to; set by its collection.
static float GlobalConductivityMultiplier { get; set; }Static multiplier on all conduction, set by a settings console command.
int HighestPriorityHeatArea { get; private set; }Priority of the strongest heat area affecting this point, or -1 when none. Lower priority areas skip it.
float InternalEnergy { get; set; }Temperature times volume. Conduction moves energy, so bigger points change temperature more slowly.
bool IsAmbientTemperature { get; private set; }True when the temperature matches ambient. Ambient points with ambient neighbours disable themselves to save work.
bool IsConductionAllowed { get; set; }When false this point's own energy is not changed by conduction. Heat sources turn it off while burning.
virtual bool IsCountedforMelting { get; }Whether this point must reach GlowingEnd before a melting model counts as melted.
static bool IsDisplayingTemperature { get; set; }Static debug flag for showing temperatures.
bool IsIgnoringAmbienceForced { get; set; }When true the point never conducts to ambient air. Set while embers or a burning heat source hold it.
bool IsIgnoringAmbient { get; set; }Skips ambient conduction for the next physics step; reset to IsIgnoringAmbienceForced after each step.
PositionFromOriginHandler PositionHelper { get; private set; }Gives the point's position relative to the world origin, used for ambient lookups.
virtual float ReceiveConductivityMultiplier { get; }Multiplier when this point takes heat, including the global multiplier and worn armour.
virtual float SourceConductivityMultiplier { get; }Multiplier when this point gives heat, including the global multiplier and worn armour.
float Temperature { get; set; }Current temperature. Setting it runs TemperatureModifier, then on the server marks the entity for sync.
float Volume { get; set; }Heat capacity of the point. Starts at the serialized base volume.
protected PooledObject ActiveEffect { get; private set; }The pooled visual effect currently attached (glow, smoke and so on), or null.
protected virtual float InternalConductivityMultiplier { get; }Conductivity between points on the same entity, including global and armour multipliers. Overridden by metal heat points.
1 private and internal property
MemberWhat it is
private int IBuildRendererBakeable.SortingOrder { get; }Build bake order, always 0.

Events​

MemberWhat it is
event Action<HeatPoint> ChangedRaised when the temperature changes, including when it falls back to ambient.
event TemperatureModifier TemperatureModifierEvent that can change a temperature before it is stored (passed by ref).

Methods​

MemberWhat it is
void Conduct(float temperature, bool isIgnoringAmbient, float weight = 1)Server: moves this point toward a given temperature, scaled by weight, frame time and the receive or source multiplier.
void ConductTo(IHeatReceiver receiver, bool isSource, bool isIgnoringAmbient = false, float weight = 1)Exchanges heat energy with another receiver, limited so neither overshoots. Points on the same entity use the internal multiplier.
virtual void ConductToAmbient(float weight = 1)Conducts toward the ambient temperature and marks the point as ignoring ambient for this step.
void CopyFrom(HeatPoint other)Sets this point's temperature to another point's.
void DeregisterHeatAreaPriority(int heatAreaPriority)Removes a heat area's priority when that area stops affecting this point.
void ForceTemperature(float temperature)Sets the temperature directly (through internal energy).
virtual void Initialize(ChildSyncableCollectionBase<HeatPoint> collection)Hooks up neighbour and ambient change events on the server. On clients the component is disabled, so no conduction runs there.
void InitializeAsServer(SpawnData spawnData)Server: enables the point if it or a neighbour is away from ambient, and pushes the first change.
bool IsEqual(HeatPoint other)True if another point's temperature is within 0.0001.
bool IsNeedingSync()True if the temperature changed since the last sync.
void RegisterHeatAreaPriority(int heatAreaPriority)Called by a heat area when it starts affecting this point; updates HighestPriorityHeatArea.
void Sync(IPlayer player, Stream stream)Writes or reads the temperature (or just an is-ambient flag) for network sync. Clients apply the read value.
protected void AddEffect(PooledObjectDefinition effect)Spawns a pooled effect under the effect parent if no effect is active yet.
protected virtual void Awake()Sets up the position helper, sets Volume to the base volume and listens for armour changes on the linked equipment slot.
protected virtual void NonAmbientChanged()Called when the temperature changes while not ambient. Shows effects (not on headless servers) and raises Changed.
protected virtual void OnDisable()Resets the temperature to ambient whenever the component is disabled.
protected virtual void OnValidate()Empty hook for subclasses.
protected void RemoveEffect()Releases the active pooled effect, if any.
protected virtual void ResetToAmbient()Called when the point returns to ambient: removes effects and raises Changed.
protected virtual void ShowEffects()Empty hook that subclasses use to show glow or particles for the current temperature.
10 private and internal methods
MemberWhat it is
private void IBuildRendererBakeable.Bake(bool isSaving)Build step that disables the component, so heat points start off until something enables them.
private void CheckAmbientChange()Server: rechecks whether the temperature counts as ambient and, if that changed, reruns CheckEnable.
private void CheckEnable()Enables the component while it or any neighbour is away from ambient temperature, otherwise disables it to save work.
private void IBuildRendererBakeable.Clean()Explicit IBuildRendererBakeable build step. Does nothing.
private void EuipmentChanged(ArmorDefinition definition)Sets the armour conductivity factor from the armour put in the linked equipment slot (1 when it is emptied).
private void FixedUpdate()Server: each physics step, conducts heat to every neighbour and to the ambient temperature, then raises change handling if needed.
private void NeighbourChanged(HeatPoint neighbour)Server: wakes this point when a neighbour leaves ambient temperature, and sleeps it when both are ambient.
private void OnChanged()Marks the entity's data as changed on the server, then shows heat effects or resets to ambient and raises Changed.
private void OnDrawGizmosSelected()Editor: draws lines to each neighbour heat point.
private void ReleaseEffect(NetworkEntity entity, bool isUnload)Removes the active heat effect when the entity is destroyed by the scene.

Used in​

Members of other types that take, return or hold a HeatPoint:

MetalHeatPoint.ForwardChanged, Recycler.AddedHeatPoint, Recycler.RemovedHeatPoint, Recycler.MeltingModelReference.AffectingHeatPoints, Cookable.CheckEnable, CookingLiquid.HeatPoint, CookingLiquid.UpdateWaterBoilingEffects, LiquidChunkVisuals.heatPoint, LiquidChunkVisuals.UpdateTemperature, StewComponent.CookingPoint, CylinderHeatArea.GetTemperatureMultiplier, HeatArea.AddedHeatPoint, HeatArea.affectingPoints, HeatArea.BaseHeatPointUpdate, HeatArea.ConductToHeatPoint, HeatArea.DeregisterHeatPoint, HeatArea.DeregisterHeatPointExternal, HeatArea.externallyRegisteredHeatPoints, HeatArea.GetTemperatureMultiplier, HeatArea.RegisterHeatPoint, HeatArea.RegisterHeatPointExternal, HeatArea.RemovedHeatPoint, HeatArea.UpdateHeatPoint, HeatArea.UpdateHeatPointTemperature, HeatArea.PointFilterDelegate.BeginInvoke, HeatArea.PointFilterDelegate.Invoke, HeatAreaModifier.GetTemperatureMultiplier, HeatManager.HeatPointDamageLevel.HeatPointDamageLevel, HeatManager.HeatPointDamageLevel.UpdateTemperature, HeatPoint.Neighbour.point, HeatPoint.Neighbour.Point, HeatPointCollection.DeRegisterToChildrenUpdate, HeatPointCollection.RegisterToChildrenUpdate, HeatPointCollectionAreaFilter.avoiding, HeatPointCollectionAreaFilter.PointFilter, HeatPointToHeatAreaLink.pointToGetTemperatureFrom, HeatPointToHeatAreaLink.UpdateTargetTemperatureOfHeatArea, HeatSourceBase.attachedHeatPoint, HeatSourceBase.UpdateHeat, LinearHeatArea.GetTemperatureMultiplier, RadiusHeatArea.GetTemperatureMultiplier, TemperatureToMaterial.heatPoint, TemperatureToMaterial.UpdateValue, LiquidHeatAreaController.heatPointToSetVolumeOff, EmberComposer.HeatPointCollectionHandler.closestHeatPoint, EmberComposer.HeatPointCollectionHandler.HeatPoints, PlayerEffectManager.heatPointStatus, PlayerEffectManager.EffectPointStatus.UpdateTemperature, PlayerEffectManager.EffectPosition.targetPoint, PlayerEffectManager.EffectPosition.TargetPoint.