Linear Mapper 1D is a component that live maps one range to another, allowing for a reverse mapping of the target range value back to the source range when it is written to.
<!--T:2-->
<!--T:2-->
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|Source|IValue`1|TypeString0=IValue<float>|
|Source|{{RootFieldType|RelayRef`1|[[Type:IValue`1|IValue`1]]<[[Type:Float|Float]]>}}|TypeAdv0=true| The value to map from <code>SourceMin</code> to <code>SourceMax</code> using <code>Target</code>.
|Target|IField`1|TypeString1=IField<float>|
|Target|{{RootFieldType|FieldDrive`1|[[Type:Float|Float]]}}|TypeAdv1=true| The value to map from <code>TargetMin</code> to <code>TargetMax</code> using <code>Source</code>.
|SourceMin|Float|
|SourceMin|Float| The minimum of the range of the <code>Source</code> value.
|SourceMax|Float|
|SourceMax|Float| The maximum of the range of the <code>Source</code> value.
|TargetMin|Float|
|TargetMin|Float| The minimum of the range of the <code>Target</code> value.
|TargetMax|Float|
|TargetMax|Float| The maximum of the range of the <code>Target</code> value.
|AllowReverseMapping|Bool|
|AllowReverseMapping|Bool| Allow <code>Target</code> to map it's value to <code>Source</code>'s ranged value when written to. See [[Drives#Write Backs|write backs]].
|Clamp|Bool|
|Clamp|Bool| Whether to prevent <code>Source</code> and <code>Target</code> from going outside their defined ranges.
}}
}}
<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
Can be used to keep the fullness of two different containers the same percentage wise based on purely the stored units and maximum capacity.
Linear Mapper 1D is a component that live maps one range to another, allowing for a reverse mapping of the target range value back to the source range when it is written to.