[changed] Lamp light is based on input power #2016
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Status
Description
This PR changes Lamp to make it emit light based on its input power.
Less power means it emits less light.
Lamp isn't a "load component" anymore, but it doesn't make sense for it to be in the "passive components" directory so I kept it in the "load components" directory.
A power factor
(float(power_new + 1) / power_source)
is calculated which is set to not exceed1
.Light radius will be directly affected by this power factor whereas SColor luminance, Red, Blue and Green are affected by it as well but with the factor having at least a minimum of
0.3f
to make light not drop too low.