8 void PPEMatClassParameterBool(
int mat_idx,
int parameter_idx,
PPEClassBase parent)
15 Class.CastTo(m_Bool,m_Defaults);
26 return PPEConstants.VAR_TYPE_BOOL;
29 override void Update(
float timeslice, out
Param p_total, out
bool setting_defaults,
int order)
31 super.Update(timeslice,p_total,setting_defaults,order);
33 int active_request_count = 0;
37 bool setting_value_zero =
false;
39 bool bool_value_temp =
false;
44 p_total =
new Param1<bool>(
false);
47 if (m_RequestMap.Count() > 0)
55 m_Parent.ParamUpdateRemove(m_ParameterIndex);
59 for (
int i = 0; i < m_RequestMap.Count(); i++ )
65 Error(
"PPEMatClassParameterBool | req_data not found! | " +
this +
" | mat/par: " + m_MaterialIndex +
"/" + m_ParameterIndex);
69 setting_value_zero = req_data.IsSettingDefaultValues();
71 if (setting_value_zero && !req_data.GetUpdatingDataValues() && !req_data.IsDataActive())
77 if (setting_value_zero)
79 req_data.m_BoolTarget =
false;
84 active_request_count++;
89 req_data.m_BoolLast = req_data.m_BoolCurrent;
91 if (!req_data.GetUpdatingDataValues() && req_data.IsDataActive())
93 bool_value_temp = req_data.m_BoolCurrent;
94 PrepareLayerInfo(req_data.GetPriorityLayer(),bool_value_temp,req_data.GetInteractionMask());
99 bool_value_temp = req_data.m_BoolTarget;
102 req_data.SetUpdatingDataValues(
false);
103 if (setting_value_zero)
105 req_data.SetDataActive(
false);
110 bool_value_temp = req_data.m_BoolTarget;
111 PrepareLayerInfo(req_data.GetPriorityLayer(),bool_value_temp,req_data.GetInteractionMask());
114 req_data.m_BoolCurrent = bool_value_temp;
117 if (active_request_count == 0)
127 bool override_active =
false;
131 if ( override_active )
134 value =
m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_VALUE);
135 operator =
m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_OPERATOR);
140 bool_value_total =
Math.Min(bool_value_total,value);
144 bool_value_total =
Math.Max(bool_value_total,value);
148 bool_value_total = value;
152 bool_value_total = value;
156 Error(
"PPEMatClassParameterBool | Invalid operator " +
operator +
" in mat/par: " + m_MaterialIndex +
"/" + m_ParameterIndex);
163 override_active =
true;
167 m_CommandLayersArray.Clear();
169 Param1<bool>.Cast(p_total).param1 = bool_value_total;
173 m_Parent.ParamUpdateRemove(m_ParameterIndex);
175 m_CurrentValues = p_total;
181 AddPriorityInfo(layer);
188 m_CurrentValues = p_total;