168 std::unique_lock<std::mutex> maybeLock;
170 maybeLock = std::unique_lock<std::mutex>(stateMutex);
172 thermalProps = newProps;
174 if (!std::isfinite(thermalProps.internalHeatPower)) thermalProps.internalHeatPower = 0.0;
175 if (!std::isfinite(thermalProps.externalHeatFlux)) thermalProps.externalHeatFlux = 0.0;
176 if (!std::isfinite(thermalProps.entropyJPerK)) thermalProps.entropyJPerK = 0.0;
178 thermalProps.specificHeat = std::max(thermalProps.specificHeat, 0.0f);
179 if (!std::isfinite(thermalProps.specificHeatTempCoeff)) thermalProps.specificHeatTempCoeff = 0.0f;
180 thermalProps.thermalMassFraction = std::clamp(thermalProps.thermalMassFraction, 0.0f, 1.0f);
181 thermalProps.emissivity = std::clamp(thermalProps.emissivity, 0.0f, 1.0f);
182 if (!std::isfinite(thermalProps.emissivityTempCoeff)) thermalProps.emissivityTempCoeff = 0.0f;
183 thermalProps.absorptivity = std::clamp(thermalProps.absorptivity, 0.0f, 1.0f);
184 if (!std::isfinite(thermalProps.absorptivityTempCoeff)) thermalProps.absorptivityTempCoeff = 0.0f;
185 thermalProps.heatTransferCoeff = std::max(thermalProps.heatTransferCoeff, 0.0f);
186 thermalProps.conductivity = std::max(thermalProps.conductivity, 0.0f);
187 if (!std::isfinite(thermalProps.conductivityTempCoeff)) thermalProps.conductivityTempCoeff = 0.0f;
188 thermalProps.density = std::max(thermalProps.density, 0.0f);
189 if (!std::isfinite(thermalProps.linearExpansionCoeff)) thermalProps.linearExpansionCoeff = 0.0f;
190 thermalProps.meltingPoint = std::max(thermalProps.meltingPoint, 0.0f);
191 thermalProps.latentHeatFusion = std::max(thermalProps.latentHeatFusion, 0.0f);
192 thermalProps.fusionProgress = std::clamp(thermalProps.fusionProgress, 0.0f, 1.0f);
193 thermalProps.boilingPoint = std::max(thermalProps.boilingPoint, 0.0f);
194 thermalProps.latentHeatVaporization = std::max(thermalProps.latentHeatVaporization, 0.0f);
195 thermalProps.vaporizationProgress = std::clamp(thermalProps.vaporizationProgress, 0.0f, 1.0f);
virtual double getMass(BodyLock lock) const
bool isUnknown(const std::string &key, BodyLock lock) const
glm::vec3 getForce(const std::string &name, BodyLock lock) const
void setPosition(const glm::vec3 &pos, BodyLock lock)
glm::mat4 getWorldTransform(BodyLock lock) const
void clearAllFrames(BodyLock lock)
glm::vec3 getVelocity(BodyLock lock) const
virtual ThermalProperties getThermalProperties(BodyLock lock) const
void setUnknown(const std::string &key, bool active, BodyLock lock)
std::map< std::string, glm::vec3 > getAllForces(BodyLock lock) const
glm::vec3 getNetForce(BodyLock lock) const
void setWorldTransform(const glm::mat4 &M, BodyLock lock)
bool getIsStatic(BodyLock lock) const
void setVelocity(const glm::vec3 &vel, BodyLock lock)
glm::vec3 getPosition(BodyLock lock) const
void setForce(const std::string &name, const glm::vec3 &force, BodyLock lock)
virtual void setMass(double newMass, BodyLock lock)
virtual void setThermalProperty(const ThermalProperties &newProps, BodyLock lock)
void setIsStatic(bool newStatic, BodyLock lock)