188 Game Development and Simulation with Unreal Technology
TABLE 4.16: Clamp
Properties
Clamp Mode: Selects th e type of clamp. CMODE_Clamp will clamp bo th
ends of the rang e . CMODE_Clamp Min and CMODE_ClampMax will only
clamp their respective ends of the range.
Min Default: Ta kes in the valu e to us e as the minimum when clam p ing.
Only used when the Min input is unused.
Max Default: Takes in the value to use as the maximum when clamping.
Only used when the Max input is unused.
Inputs
Min: Takes in the value to use as the m inimum when clamping.
Max: Takes in the value to use as the maximum when c lamping.
Example Usa ge: When you want to ensure that the result of a calculation never
falls o utside of a certain range, you can use the minimum and maximum
values of the range to ensure yo ur output will always be in ran ge.
Component Mask: This expression allows you to select a specific subset of chan-
nels (R, G, B, and/or A) from the expression ’s input to pass through to the expres-
sion’s outputs. The current channels selected to be passed through are displayed
in the title bar of the expression. In case of the expressions that are more than
one-dimensional, if the channel is not available an error will occur if you check
that channel to be passed through. A description of the properties of a Constant
expression are listed below:
TABLE 4.17: Component Mask
Properties
R: If checked, the Red (or first) component of the vector will be mas ked
and available to pass through from input to output.
G: If checked, the Green (or second) component of the vector will be
masked and available to pass th rough from in p u t to output.
B: If checked, the Blue (or third) com ponent of the vector will b e masked
and available to pass through from input to output.
A: If checked, the Alpha (or fourth) component of the vector will be
masked and available to pass th rough from in p u t to output.
Example:
If you have an RGB Constant3Vector o f (1.2, 3.2, 5.3, 1.0) as the input
to this expression and check the R, a nd A boxes, the output will be (1.2, 1.0).