DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс PPEMatClassParameterCommandData

Защищенные члены

void PPEMatClassParameterBool (int mat_idx, int parameter_idx, PPEClassBase parent)
 
override void InitDefaults ()
 
override void InitCuttent ()
 
override int GetParameterVarType ()
 
override void Update (float timeslice, out Param p_total, out bool setting_defaults, int order)
 
void PrepareLayerInfo (int layer, bool value, int operator)
 
override void SetParameterValueDefault (inout Param p_total)
 No active requests for the mat. parameter value change, sets the value to DEFAULT.
 
void PPEMatClassParameterCommandData (int mat_idx, int parameter_idx, PPEClassBase parent)
 
int GetParameterVarType ()
 
void SetMaterialIndex (int value)
 
void SetParameterIndex (int value)
 
void SetParent (PPEClassBase parent)
 
void InsertRequestData (PPERequestParamDataBase request_data)
 
void Update (float timeslice, out Param p_total, out bool setting_defaults, int order)
 
void ModifyResultValues (inout Param result_values)
 Modifies values to be used for setter methods later in the manager update. Currently used only on PPEMatClassParameterColor, TODO!!
 
void AddPriorityInfo (int priority)
 Adds 'layers' to be iterated throug.
 
void RemovePriorityInfo (int priority)
 Currently unused; layer info gets cleared every update.
 
void RegisterDefaults (Param p)
 Adds name and default values from material registration, override on children to properly add for each type.
 
void InitDefaults ()
 
void InitCuttent ()
 
void SetParameterValueDefault (inout Param p_total)
 
Param GetDefaultValues ()
 Careful, formating is such, that param1 is ALWAYS string, containing parameter name, should it be needed. Actual values follow.
 
Param GetCurrentValues ()
 Careful, only actual values, WITHOUT string.
 
void DbgPrnt (string text)
 
void PPEMatClassParameterFloat (int mat_idx, int parameter_idx, PPEClassBase parent)
 
override void InitDefaults ()
 
override void InitCuttent ()
 
override int GetParameterVarType ()
 
override void Update (float timeslice, out Param p_total, out bool setting_defaults, int order)
 
void PrepareLayerInfo (int layer, float value, int operator)
 
override void SetParameterValueDefault (inout Param p_total)
 No active requests for the mat. parameter value change, sets the value to DEFAULT (zero?)
 
void PPEMatClassParameterInt (int mat_idx, int parameter_idx, PPEClassBase parent)
 
override void InitDefaults ()
 
override void InitCuttent ()
 
override int GetParameterVarType ()
 
override void Update (float timeslice, out Param p_total, out bool setting_defaults, int order)
 
void PrepareLayerInfo (int layer, int value, int operator)
 
override void SetParameterValueDefault (inout Param p_total)
 No active requests for the mat. parameter value change, sets the value to DEFAULT.
 

Защищенные данные

ref map< int, ref array< bool, int > > m_LayerInfo
 
PPETemplateDefBool m_Bool
 
bool m_ValueDefault
 
int m_UpdatedCount
 
int m_MaterialIndex
 
int m_ParameterIndex
 
ref ActiveParameterRequestsMap m_RequestMap
 
PPEClassBase m_Parent
 
ref Param m_Defaults
 
ref Param m_CurrentValues
 
ref map< int, ref array< int > > m_Dependencies
 
ref map< int, ref array< float, int > > m_LayerInfo
 
PPETemplateDefFloat m_Float
 
float m_ValueDefault
 
float m_ValueMin
 
float m_ValueMax
 
ref map< int, ref array< int, int > > m_LayerInfo
 
PPETemplateDefInt m_Int
 
int m_ValueDefault
 

Закрытые члены

override int GetParameterVarType ()
 
override int GetParameterVarType ()
 
override int GetParameterVarType ()
 

Закрытые данные

const int LAYER_INFO_VALUE = 0
 
const int LAYER_INFO_OPERATOR = 1
 
ref array< intm_CommandLayersArray
 

Подробное описание

Конструктор(ы)

◆ PPEMatClassParameterCommandData()

void PPEMatClassParameterCommandData ( int mat_idx,
int parameter_idx,
PPEClassBase parent )
inlineprotected
21 {
24 m_Parent = parent;
25
29 }
map< int, ref PPERequestParamDataBase > ActiveParameterRequestsMap
Definition PPEMatClassParameterCommandData.c:1
ref ActiveParameterRequestsMap m_RequestMap
Definition PPEMatClassParameterCommandData.c:13
PPEClassBase m_Parent
Definition PPEMatClassParameterCommandData.c:14
int m_MaterialIndex
Definition PPEMatClassParameterCommandData.c:11
ref array< int > m_CommandLayersArray
Definition PPEMatClassParameterCommandData.c:9
int m_ParameterIndex
Definition PPEMatClassParameterCommandData.c:12
int m_UpdatedCount
Definition PPEMatClassParameterCommandData.c:10
Definition EntityAI.c:95

Перекрестные ссылки m_CommandLayersArray, m_MaterialIndex, m_ParameterIndex, m_Parent, m_RequestMap и m_UpdatedCount.

Методы

◆ AddPriorityInfo()

void AddPriorityInfo ( int priority)
inlineprotected

Adds 'layers' to be iterated throug.

82 {
83 if ( m_CommandLayersArray.Find(priority) == -1 )
84 {
87 }
88 else
89 {
90 //DbgPrnt("PPEDebug | PPEMatClassParameterCommandData - AddPriorityInfo | Already exists, values have been overwritten!");
91 }
92 }

Перекрестные ссылки m_CommandLayersArray.

Используется в PrepareLayerInfo(), PrepareLayerInfo() и PrepareLayerInfo().

◆ DbgPrnt()

void DbgPrnt ( string text)
inlineprotected
128 {
129 //Debug.Log(""+text);
130 }

◆ GetCurrentValues()

Param GetCurrentValues ( )
inlineprotected

Careful, only actual values, WITHOUT string.

123 {
124 return m_CurrentValues;
125 }
ref Param m_CurrentValues
Definition PPEMatClassParameterCommandData.c:16

Перекрестные ссылки m_CurrentValues.

Используется в PPEDOF::SetFinalParameterValue(), PPEExposureNative::SetFinalParameterValue(), PPEEyeAccomodationNative::SetFinalParameterValue(), PPELightIntensityParamsNative::SetFinalParameterValue() и PPEClassBase::SetFinalParameterValue().

◆ GetDefaultValues()

Param GetDefaultValues ( )
inlineprotected

Careful, formating is such, that param1 is ALWAYS string, containing parameter name, should it be needed. Actual values follow.

117 {
118 return m_Defaults;
119 }
ref Param m_Defaults
Definition PPEMatClassParameterCommandData.c:15

Перекрестные ссылки m_Defaults.

◆ GetParameterVarType() [1/7]

override int GetParameterVarType ( )
inlineprotected
25 {
26 return PPEConstants.VAR_TYPE_BOOL;
27 }

Используется в PPEClassBase::SetFinalParameterValue().

◆ GetParameterVarType() [2/7]

int GetParameterVarType ( )
inlineprotected
32 {
33 return -1;
34 }

◆ GetParameterVarType() [3/7]

override int GetParameterVarType ( )
inlineprotected
30 {
31 return PPEConstants.VAR_TYPE_FLOAT;
32 }

◆ GetParameterVarType() [4/7]

override int GetParameterVarType ( )
inlineprotected
25 {
26 return PPEConstants.VAR_TYPE_INT;
27 }

◆ GetParameterVarType() [5/7]

override int GetParameterVarType ( )
inlineprivate
4 {
5 return PPEConstants.VAR_TYPE_RESOURCE;
6 }

◆ GetParameterVarType() [6/7]

override int GetParameterVarType ( )
inlineprivate
4 {
5 return PPEConstants.VAR_TYPE_TEXTURE;
6 }

◆ GetParameterVarType() [7/7]

override int GetParameterVarType ( )
inlineprivate
4 {
5 return PPEConstants.VAR_TYPE_VECTOR;
6 }

◆ InitCuttent() [1/4]

override void InitCuttent ( )
inlineprotected
20 {
22 }
bool m_ValueDefault
Definition PPEMatClassParameterBool.c:6

Перекрестные ссылки m_ValueDefault.

Используется в RegisterDefaults().

◆ InitCuttent() [2/4]

void InitCuttent ( )
inlineprotected
109{};

◆ InitCuttent() [3/4]

override void InitCuttent ( )
inlineprotected

Перекрестные ссылки m_ValueDefault.

◆ InitCuttent() [4/4]

override void InitCuttent ( )
inlineprotected

Перекрестные ссылки m_ValueDefault.

◆ InitDefaults() [1/4]

override void InitDefaults ( )
inlineprotected
14 {
16 m_ValueDefault = m_Bool.param2;
17 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
PPETemplateDefBool m_Bool
Definition PPEMatClassParameterBool.c:5
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo() и m_ValueDefault.

Используется в RegisterDefaults().

◆ InitDefaults() [2/4]

void InitDefaults ( )
inlineprotected
107{};

◆ InitDefaults() [3/4]

override void InitDefaults ( )
inlineprotected
16 {
18 //m_Float = PPETemplateDefFloat.Cast(m_Defaults);
19 m_ValueDefault = m_Float.param2;
20 m_ValueMin = m_Float.param3;
21 m_ValueMax = m_Float.param4;
22 }
float m_ValueMax
Definition PPEMatClassParameterFloat.c:8
float m_ValueMin
Definition PPEMatClassParameterFloat.c:7
PPETemplateDefFloat m_Float
Definition PPEMatClassParameterFloat.c:5

Перекрестные ссылки Class::CastTo(), m_Float, m_ValueDefault, m_ValueMax и m_ValueMin.

◆ InitDefaults() [4/4]

override void InitDefaults ( )
inlineprotected
14 {
16 m_ValueDefault = m_Int.param2;
17 }
PPETemplateDefInt m_Int
Definition PPEMatClassParameterInt.c:5

Перекрестные ссылки Class::CastTo() и m_ValueDefault.

◆ InsertRequestData()

void InsertRequestData ( PPERequestParamDataBase request_data)
inlineprotected
52 {
53 m_RequestMap.Set(request_data.GetRequesterIDX(),request_data);//<request_ID, data>
54 }

Перекрестные ссылки m_RequestMap.

◆ ModifyResultValues()

void ModifyResultValues ( inout Param result_values)
inlineprotected

Modifies values to be used for setter methods later in the manager update. Currently used only on PPEMatClassParameterColor, TODO!!

77 {
78 }

◆ PPEMatClassParameterBool()

void PPEMatClassParameterBool ( int mat_idx,
int parameter_idx,
PPEClassBase parent )
inlineprotected
9 {
11 }
ref map< int, ref array< bool, int > > m_LayerInfo
Definition PPEMatClassParameterBool.c:3

Перекрестные ссылки m_LayerInfo.

◆ PPEMatClassParameterFloat()

void PPEMatClassParameterFloat ( int mat_idx,
int parameter_idx,
PPEClassBase parent )
inlineprotected

Перекрестные ссылки m_LayerInfo.

◆ PPEMatClassParameterInt()

void PPEMatClassParameterInt ( int mat_idx,
int parameter_idx,
PPEClassBase parent )
inlineprotected

Перекрестные ссылки m_LayerInfo.

◆ PrepareLayerInfo() [1/3]

void PrepareLayerInfo ( int layer,
bool value,
int operator )
inlineprotected
179 {
180 m_LayerInfo.Set(layer,{value,operator});
182 }
void AddPriorityInfo(int priority)
Adds 'layers' to be iterated throug.
Definition PPEMatClassParameterCommandData.c:81

Перекрестные ссылки AddPriorityInfo() и m_LayerInfo.

Используется в Update().

◆ PrepareLayerInfo() [2/3]

void PrepareLayerInfo ( int layer,
float value,
int operator )
inlineprotected
228 {
229 m_LayerInfo.Set(layer,{value,operator});
231 }

Перекрестные ссылки AddPriorityInfo() и m_LayerInfo.

◆ PrepareLayerInfo() [3/3]

void PrepareLayerInfo ( int layer,
int value,
int operator )
inlineprotected
179 {
180 m_LayerInfo.Set(layer,{value,operator});
182 }

Перекрестные ссылки AddPriorityInfo() и m_LayerInfo.

◆ RegisterDefaults()

void RegisterDefaults ( Param p)
inlineprotected

Adds name and default values from material registration, override on children to properly add for each type.

101 {
102 m_Defaults = p;
103 InitDefaults();
104 InitCuttent();
105 }
override void InitDefaults()
Definition PPEMatClassParameterBool.c:13
override void InitCuttent()
Definition PPEMatClassParameterBool.c:19

Перекрестные ссылки InitCuttent(), InitDefaults() и m_Defaults.

◆ RemovePriorityInfo()

void RemovePriorityInfo ( int priority)
inlineprotected

Currently unused; layer info gets cleared every update.

96 {
97 }

◆ SetMaterialIndex()

void SetMaterialIndex ( int value)
inlineprotected
37 {
39 }

Перекрестные ссылки m_MaterialIndex.

◆ SetParameterIndex()

void SetParameterIndex ( int value)
inlineprotected
42 {
44 }

Перекрестные ссылки m_ParameterIndex.

◆ SetParameterValueDefault() [1/4]

override void SetParameterValueDefault ( inout Param p_total)
inlineprotected

No active requests for the mat. parameter value change, sets the value to DEFAULT.

186 {
189 //DbgPrnt("PPEDebug | PPEMatClassParameterBool - UpdateParameterValues | exit 3 - zero value");
190 }
Definition PPEConstants.c:68

Используется в Update().

◆ SetParameterValueDefault() [2/4]

void SetParameterValueDefault ( inout Param p_total)
inlineprotected
112 {
113 }

◆ SetParameterValueDefault() [3/4]

override void SetParameterValueDefault ( inout Param p_total)
inlineprotected

No active requests for the mat. parameter value change, sets the value to DEFAULT (zero?)

235 {
238 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | exit 3 - zero value");
239 }

◆ SetParameterValueDefault() [4/4]

override void SetParameterValueDefault ( inout Param p_total)
inlineprotected

No active requests for the mat. parameter value change, sets the value to DEFAULT.

186 {
189 //DbgPrnt("PPEDebug | PPEMatClassParameterInt - UpdateParameterValues | exit 3 - zero value");
190 }

◆ SetParent()

void SetParent ( PPEClassBase parent)
inlineprotected
47 {
48 m_Parent = parent;
49 }

Перекрестные ссылки m_Parent.

◆ Update() [1/4]

override void Update ( float timeslice,
out Param p_total,
out bool setting_defaults,
int order )
inlineprotected
30 {
32
34
36
37 bool setting_value_zero = false;
38
39 bool bool_value_temp = false;
41
42 if (p_total == null)
43 {
44 p_total = new Param1<bool>(false);
45 }
46
47 if (m_RequestMap.Count() > 0)
48 {
49 m_LayerInfo.Clear();
50 }
51 else
52 {
53 //DbgPrnt("m_RequestMap.Count() is zero! Using default values. | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
56 return;
57 }
58
59 for ( int i = 0; i < m_RequestMap.Count(); i++ )
60 {
62
63 if (req_data == null)
64 {
65 Error("PPEMatClassParameterBool | req_data not found! | " + this + " | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
66 continue;
67 }
68
69 setting_value_zero = req_data.IsSettingDefaultValues();
70
71 if (setting_value_zero && !req_data.GetUpdatingDataValues() && !req_data.IsDataActive())
72 {
73 //DbgPrnt("Is Default, not updating | idx: " + i + " | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
74 continue;
75 }
76
78 {
79 req_data.m_BoolTarget = false;
80 //DbgPrnt("PPEDebug | PPEMatClassParameterBool - UpdateParameterValues | !data.m_DefaultTargetSet | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | req_data.m_BoolTarget: " + req_data.m_BoolTarget);
81 }
82 else
83 {
85 }
86
87 //evaluation
88 //--------------------------------
89 req_data.m_BoolLast = req_data.m_BoolCurrent;
90
91 if (!req_data.GetUpdatingDataValues() && req_data.IsDataActive()) //set to exact value, not updating anymore
92 {
93 bool_value_temp = req_data.m_BoolCurrent;
94 PrepareLayerInfo(req_data.GetPriorityLayer(),bool_value_temp,req_data.GetInteractionMask());
95 //DbgPrnt("PPEDebug | PPEMatClassParameterBool - UpdateParameterValues | !req_data.m_UpdatingData | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | not updating, addaing current value into mix: " + bool_value_temp);
96 continue;
97 }
98
99 bool_value_temp = req_data.m_BoolTarget;
100
101 //DbgPrnt("PPEDebug | PPEMatClassParameterBool - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
102 req_data.SetUpdatingDataValues(false);
104 {
105 req_data.SetDataActive(false);
106 //RemovePriorityInfo(req_data.GetPriorityLayer()); //redundant?
107 }
108 else
109 {
110 bool_value_temp = req_data.m_BoolTarget;
111 PrepareLayerInfo(req_data.GetPriorityLayer(),bool_value_temp,req_data.GetInteractionMask());
112 }
113
114 req_data.m_BoolCurrent = bool_value_temp;
115 }
116
117 if (active_request_count == 0)
118 {
120 }
121 else
122 {
123 //---------------------------
124 //MASK handling and calculation
125 bool value;
126 int operator;
127 bool override_active = false;
128
129 for ( i = 0; i < m_LayerInfo.Count(); i++ )
130 {
131 if ( override_active )
132 break;
133
135 operator = m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_OPERATOR);
136
137 switch (operator)
138 {
139 case PPOperators.LOWEST:
141 break;
142
143 case PPOperators.HIGHEST:
145 break;
146
147 case PPOperators.OVERRIDE:
149 break;
150
151 case PPOperators.SET:
153 break;
154
155 default:
156 Error("PPEMatClassParameterBool | Invalid operator " + operator + " in mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
157 break;
158 }
159
160 if ( operator == PPOperators.OVERRIDE )
161 {
162 //DbgPrnt("m_LayerInfo | PPOperators.OVERRIDE at: " + i);
163 override_active = true;
164 }
165 }
166
167 m_CommandLayersArray.Clear();
168
170 }
171
172 //DbgPrnt("PPEDebug | PPEMatClassParameterBool - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | parameter update end, removing from queue");
174
176 }
PPOperators
PP operators, specify operation between subsequent layers.
Definition PPEConstants.c:53
void PPERequestParamDataBool(int requester_idx, int mat_id, int param_id, int data_type=0, int priority=0, int mask=PPOperators.SET, bool relative=false)
Definition PPERequestData.c:111
Definition EnMath.c:7
void ParamUpdateRemove(int parameter_idx)
Queue selected parameter for removal from the update queue.
Definition PPEMatClassesBase.c:288
const int LAYER_INFO_OPERATOR
Definition PPEMatClassParameterCommandData.c:7
override void SetParameterValueDefault(inout Param p_total)
No active requests for the mat. parameter value change, sets the value to DEFAULT.
Definition PPEMatClassParameterBool.c:185
void PrepareLayerInfo(int layer, bool value, int operator)
Definition PPEMatClassParameterBool.c:178
const int LAYER_INFO_VALUE
Definition PPEMatClassParameterCommandData.c:6
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Min(float x, float y)
Returns smaller of two given values.

Перекрестные ссылки Error(), m_LayerInfo, m_Parent, m_ValueDefault, Math::Max(), Math::Min(), PPERequestParamDataBool(), PrepareLayerInfo() и SetParameterValueDefault().

◆ Update() [2/4]

void Update ( float timeslice,
out Param p_total,
out bool setting_defaults,
int order )
inlineprotected
57 {
58 //insert dependencies to another update round
59 if ( m_Dependencies && m_Dependencies.Count() > 0 && order < PPEConstants.DEPENDENCY_ORDER_HIGHEST )
60 {
61 int key_mat = -1;
62 int element_par = -1;
63 for (int i = 0; i < m_Dependencies.Count(); i++)
64 {
65 key_mat = m_Dependencies.GetKey(i);
66 for (int j = 0; j < m_Dependencies.GetElement(i).Count(); j++)
67 {
68 element_par = m_Dependencies.GetElement(i).Get(j);
69 PPEManagerStatic.GetPPEManager().SetMaterialParamUpdating(key_mat,element_par,order + 1); // TODO - revise, currently only does one more update
70 }
71 }
72 }
73 }
@ Count
Definition RandomGeneratorSyncManager.c:8
Static component of PPE manager, used to hold the instance.
Definition PPEManager.c:3
static PPEManager GetPPEManager()
Returns the manager instance singleton.
Definition PPEManager.c:27
ref map< int, ref array< int > > m_Dependencies
Definition PPEMatClassParameterCommandData.c:18

Перекрестные ссылки Count, PPEManagerStatic::GetPPEManager() и m_Dependencies.

◆ Update() [3/4]

override void Update ( float timeslice,
out Param p_total,
out bool setting_defaults,
int order )
inlineprotected
35 {
37
39
41
42 bool setting_value_zero = false;
43
44 float float_value_temp = 0.0;
45 float float_value_default = 0.0;
46 float float_value_total = 0.0;
47
48 if (p_total == null)
49 {
50 p_total = new Param1<float>(0.0);
51 }
52
53 if (m_RequestMap.Count() > 0)
54 {
55 m_LayerInfo.Clear();
56 }
57 else
58 {
59 //DbgPrnt("m_RequestMap.Count() is zero! Using default values. | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
62 return;
63 }
64
65 for ( int i = 0; i < m_RequestMap.Count(); i++ )
66 {
68
69 if (req_data == null)
70 {
71 Error("Debug | PPEMatClassParameterFloat | req_data not found! | " + this + " | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
72 continue;
73 }
74
75 setting_value_zero = req_data.IsSettingDefaultValues();
76
77 if (setting_value_zero && !req_data.GetUpdatingDataValues() && !req_data.IsDataActive())
78 {
79 //DbgPrnt("Is Default, not updating | idx: " + i + " | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
80 continue;
81 }
82
84 {
85 req_data.m_FloatTarget = 0;//min;
86 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | !data.m_DefaultTargetSet | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | req_data.m_FloatTarget: " + req_data.m_FloatTarget);
87 }
88 else
89 {
91 }
92
93 //evaluation
94 //--------------------------------
95 req_data.m_FloatLast = req_data.m_FloatCurrent;
96
97 if (!req_data.GetUpdatingDataValues() && req_data.IsDataActive()) //set to exact value, not updating anymore
98 {
99 float_value_temp = req_data.m_FloatCurrent;
100 PrepareLayerInfo(req_data.GetPriorityLayer(),float_value_temp,req_data.GetInteractionMask());
101 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | !req_data.m_UpdatingData | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | not updating, addaing current value into mix: " + float_value_temp);
102 continue;
103 }
104
105 float_value_temp = req_data.m_FloatTarget;
106
107 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
108 req_data.SetUpdatingDataValues(false);
110 {
111 req_data.SetDataActive(false);
112 //RemovePriorityInfo(req_data.GetPriorityLayer()); //redundant?
113 }
114 else
115 {
116 float_value_temp = req_data.m_FloatTarget;
117 PrepareLayerInfo(req_data.GetPriorityLayer(),float_value_temp,req_data.GetInteractionMask());
118 }
119
120 req_data.m_FloatCurrent = float_value_temp;
121 }
122
123 //---------------------------
124 //MASK handling and calculation
125 float value;
126 int operator;
127 bool override_active = false;
128
129 if ( m_ValueMax == 0.0 )
131 else
133
134 //float_value_total = Math.InverseLerp(m_ValueMin,m_ValueMax,m_ValueDefault);
136
137 for ( i = 0; i < m_LayerInfo.Count(); i++ )
138 {
139 if ( override_active )
140 break;
141
143 operator = m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_OPERATOR);
144
145 switch (operator)
146 {
147 case PPOperators.LOWEST:
149 break;
150
151 case PPOperators.HIGHEST:
153 break;
154
155 case PPOperators.ADD:
156 //float_value_total = float_value_total + value - float_value_default;
158 break;
159
160 case PPOperators.ADD_RELATIVE:
162 break;
163
164 case PPOperators.SUBSTRACT:
165 //float_value_total = float_value_total - value + float_value_default;
167 break;
168
169 case PPOperators.SUBSTRACT_RELATIVE:
171 break;
172
173 case PPOperators.SUBSTRACT_REVERSE:
174 //float_value_total = value - float_value_default - float_value_total;
176 break;
177
178 case PPOperators.SUBSTRACT_REVERSE_RELATIVE:
180 break;
181
182 case PPOperators.MULTIPLICATIVE:
183 //float_value_total = Math.Lerp(float_value_default, float_value_total, value);
185 break;
186
187 case PPOperators.OVERRIDE:
189 break;
190
191 case PPOperators.SET:
193 break;
194 }
195
196 //DbgPrnt("m_LayerInfo | float_value_total pre-clamp: " + float_value_total + " | i: " + i);
198
199 if ( operator == PPOperators.OVERRIDE )
200 {
201 //DbgPrnt("m_LayerInfo | PPOperators.OVERRIDE at: " + i);
202 override_active = true;
203 }
204
205 //RemovePriorityInfo(m_CommandLayersArray.Get(i));
206 }
207
208 m_CommandLayersArray.Clear();
209
210 //TODO - consider moving this up, if possible
211 if (active_request_count == 0)
212 {
214 }
215 else
216 {
218 Param1<float>.Cast(p_total).param1 = res; //converts back to absolute values
219 }
220
221 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | parameter update end, removing from queue");
223
225 }
void PPERequestParamDataFloat(int requester_idx, int mat_id, int param_id, int data_type=0, int priority=0, int mask=PPOperators.SET, bool relative=false)
Definition PPERequestData.c:142
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.

Перекрестные ссылки Math::Clamp(), Error(), Math::Lerp(), m_LayerInfo, m_Parent, m_ValueDefault, m_ValueDefault, m_ValueMax, m_ValueMax, m_ValueMin, Math::Max(), Math::Min(), PPERequestParamDataFloat(), PrepareLayerInfo() и SetParameterValueDefault().

◆ Update() [4/4]

override void Update ( float timeslice,
out Param p_total,
out bool setting_defaults,
int order )
inlineprotected
30 {
32
34
35 PPERequestParamDataInt req_data;
36
37 bool setting_value_zero = false;
38
39 bool int_value_temp = false;
41
42 if (p_total == null)
43 {
44 p_total = new Param1<int>(0);
45 }
46
47 if (m_RequestMap.Count() > 0)
48 {
49 m_LayerInfo.Clear();
50 }
51 else
52 {
53 //DbgPrnt("m_RequestMap.Count() is zero! Using default values. | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
56 return;
57 }
58
59 for ( int i = 0; i < m_RequestMap.Count(); i++ )
60 {
61 req_data = PPERequestParamDataInt.Cast(m_RequestMap.GetElement(i));
62
63 if (req_data == null)
64 {
65 Error("Debug | PPEMatClassParameterInt | req_data not found! | " + this + " | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
66 continue;
67 }
68
69 setting_value_zero = req_data.IsSettingDefaultValues();
70
71 if (setting_value_zero && !req_data.GetUpdatingDataValues() && !req_data.IsDataActive())
72 {
73 //DbgPrnt("Is Default, not updating | idx: " + i + " | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
74 continue;
75 }
76
78 {
79 req_data.m_IntTarget = false;
80 //DbgPrnt("PPEDebug | PPEMatClassParameterInt - UpdateParameterValues | !data.m_DefaultTargetSet | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | req_data.m_IntTarget: " + req_data.m_IntTarget);
81 }
82 else
83 {
85 }
86
87 //evaluation
88 //--------------------------------
89 req_data.m_IntLast = req_data.m_IntCurrent;
90
91 if (!req_data.GetUpdatingDataValues() && req_data.IsDataActive()) //set to exact value, not updating anymore
92 {
93 int_value_temp = req_data.m_IntCurrent;
94 PrepareLayerInfo(req_data.GetPriorityLayer(),int_value_temp,req_data.GetInteractionMask());
95 //DbgPrnt("PPEDebug | PPEMatClassParameterInt - UpdateParameterValues | !req_data.m_UpdatingData | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | not updating, addaing current value into mix: " + int_value_temp);
96 continue;
97 }
98
99 int_value_temp = req_data.m_IntTarget;
100
101 //DbgPrnt("PPEDebug | PPEMatClassParameterInt - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
102 req_data.SetUpdatingDataValues(false);
104 {
105 req_data.SetDataActive(false);
106 //RemovePriorityInfo(req_data.GetPriorityLayer()); //redundant?
107 }
108 else
109 {
110 int_value_temp = req_data.m_IntTarget;
111 PrepareLayerInfo(req_data.GetPriorityLayer(),int_value_temp,req_data.GetInteractionMask());
112 }
113
114 req_data.m_IntCurrent = int_value_temp;
115 }
116
117 if (active_request_count == 0)
118 {
120 }
121 else
122 {
123 //---------------------------
124 //MASK handling and calculation
125 int value;
126 int operator;
127 bool override_active = false;
128
129 for ( i = 0; i < m_LayerInfo.Count(); i++ )
130 {
131 if ( override_active )
132 break;
133
135 operator = m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_OPERATOR);
136
137 switch (operator)
138 {
139 case PPOperators.LOWEST:
141 break;
142
143 case PPOperators.HIGHEST:
145 break;
146
147 case PPOperators.OVERRIDE:
149 break;
150
151 case PPOperators.SET:
153 break;
154
155 default:
156 Error("PPEMatClassParameterInt | Invalid operator " + operator + " in mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
157 break;
158 }
159
160 if ( operator == PPOperators.OVERRIDE )
161 {
162 //DbgPrnt("m_LayerInfo | PPOperators.OVERRIDE at: " + i);
163 override_active = true;
164 }
165 }
166
167 m_CommandLayersArray.Clear();
168
169 Param1<int>.Cast(p_total).param1 = int_value_total;
170 }
171
172 //DbgPrnt("PPEDebug | PPEMatClassParameterInt - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | parameter update end, removing from queue");
174
176 }

Перекрестные ссылки Error(), m_LayerInfo, m_Parent, m_ValueDefault, Math::Max(), Math::Min(), PrepareLayerInfo() и SetParameterValueDefault().

Поля

◆ LAYER_INFO_OPERATOR

const int LAYER_INFO_OPERATOR = 1
private

◆ LAYER_INFO_VALUE

const int LAYER_INFO_VALUE = 0
private

◆ m_Bool

PPETemplateDefBool m_Bool
protected

◆ m_CommandLayersArray

ref array<int> m_CommandLayersArray
private

Используется в AddPriorityInfo() и PPEMatClassParameterCommandData().

◆ m_CurrentValues

ref Param m_CurrentValues
protected

Используется в GetCurrentValues().

◆ m_Defaults

ref Param m_Defaults
protected

Используется в GetDefaultValues() и RegisterDefaults().

◆ m_Dependencies

ref map<int,ref array<int> > m_Dependencies
protected

Используется в Update().

◆ m_Float

PPETemplateDefFloat m_Float
protected

◆ m_Int

PPETemplateDefInt m_Int
protected

◆ m_LayerInfo [1/3]

ref map<int,ref array<bool,int> > m_LayerInfo
protected

◆ m_LayerInfo [2/3]

ref map<int,ref array<float,int> > m_LayerInfo
protected

◆ m_LayerInfo [3/3]

ref map<int,ref array<int,int> > m_LayerInfo
protected

◆ m_MaterialIndex

int m_MaterialIndex
protected

Используется в PPEMatClassParameterCommandData() и SetMaterialIndex().

◆ m_ParameterIndex

int m_ParameterIndex
protected

Используется в PPEMatClassParameterCommandData() и SetParameterIndex().

◆ m_Parent

PPEClassBase m_Parent
protected

Используется в PPEMatClassParameterCommandData() и SetParent().

◆ m_RequestMap

ref ActiveParameterRequestsMap m_RequestMap
protected

Используется в InsertRequestData() и PPEMatClassParameterCommandData().

◆ m_UpdatedCount

int m_UpdatedCount
protected

Используется в PPEMatClassParameterCommandData().

◆ m_ValueDefault [1/3]

bool m_ValueDefault
protected

Используется в Update().

◆ m_ValueDefault [2/3]

float m_ValueDefault
protected

◆ m_ValueDefault [3/3]

int m_ValueDefault
protected

◆ m_ValueMax

float m_ValueMax
protected

Используется в Update().

◆ m_ValueMin

float m_ValueMin
protected

Объявления и описания членов классов находятся в файлах: