No active requests for the mat. parameter value change, sets the value to DEFAULT (zero?)
477{
479
484
486 {
488 }
489
491 {
493
497 }
498
500 {
502 }
503
505 {
506 return PPEConstants.VAR_TYPE_FLOAT;
507 }
508
509 override void Update(
float timeslice, out
Param p_total, out
bool setting_defaults,
int order)
510 {
511 super.Update(timeslice,p_total,setting_defaults,order);
512
513 int active_request_count = 0;
514
516
517 bool setting_value_zero = false;
518
519 float float_value_temp = 0.0;
520 float float_value_default = 0.0;
521 float float_value_total = 0.0;
522
523 if (p_total == null)
524 {
525 p_total = new Param1<float>(0.0);
526 }
527
528 if (m_RequestMap.Count() > 0)
529 {
531 }
532 else
533 {
534
536 m_Parent.ParamUpdateRemove(m_ParameterIndex);
537 return;
538 }
539
540 for ( int i = 0; i < m_RequestMap.Count(); i++ )
541 {
543
544 if (req_data == null)
545 {
546 Error(
"Debug | PPEMatClassParameterFloat | req_data not found! | " +
this +
" | mat/par: " + m_MaterialIndex +
"/" + m_ParameterIndex);
547 continue;
548 }
549
550 setting_value_zero = req_data.IsSettingDefaultValues();
551
552 if (setting_value_zero && !req_data.GetUpdatingDataValues() && !req_data.IsDataActive())
553 {
554
555 continue;
556 }
557
558 if (setting_value_zero)
559 {
560 req_data.m_FloatTarget = 0;
561
562 }
563 else
564 {
565 active_request_count++;
566 }
567
568
569
570 req_data.m_FloatLast = req_data.m_FloatCurrent;
571
572 if (!req_data.GetUpdatingDataValues() && req_data.IsDataActive())
573 {
574 float_value_temp = req_data.m_FloatCurrent;
575 PrepareLayerInfo(req_data.GetPriorityLayer(),float_value_temp,req_data.GetInteractionMask());
576
577 continue;
578 }
579
580 float_value_temp = req_data.m_FloatTarget;
581
582
583 req_data.SetUpdatingDataValues(false);
584 if (setting_value_zero)
585 {
586 req_data.SetDataActive(false);
587
588 }
589 else
590 {
591 float_value_temp = req_data.m_FloatTarget;
592 PrepareLayerInfo(req_data.GetPriorityLayer(),float_value_temp,req_data.GetInteractionMask());
593 }
594
595 req_data.m_FloatCurrent = float_value_temp;
596 }
597
598
599
600 float value;
601 int operator;
602 bool override_active = false;
603
606 else
608
609
610 float_value_default = float_value_total;
611
613 {
614 if ( override_active )
615 break;
616
617 value =
m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_VALUE);
618 operator =
m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_OPERATOR);
619
620 switch (operator)
621 {
623 float_value_total =
Math.
Min(float_value_total,value);
624 break;
625
627 float_value_total =
Math.
Max(float_value_total,value);
628 break;
629
631
632 float_value_total = float_value_total + value;
633 break;
634
636 float_value_total = (1 - float_value_total) * value + float_value_total;
637 break;
638
640
641 float_value_total = float_value_total - value;
642 break;
643
645 float_value_total = float_value_total - value * float_value_total;
646 break;
647
649
650 float_value_total = value - float_value_total;
651 break;
652
654 float_value_total = value * float_value_total - float_value_total;
655 break;
656
658
659 float_value_total = float_value_total * value;
660 break;
661
663 float_value_total = value;
664 break;
665
667 float_value_total = value;
668 break;
669 }
670
671
672 float_value_total =
Math.
Clamp(float_value_total,0,1);
673
675 {
676
677 override_active = true;
678 }
679
680
681 }
682
683 m_CommandLayersArray.Clear();
684
685
686 if (active_request_count == 0)
687 {
689 }
690 else
691 {
693 Param1<float>.Cast(p_total).param1 = res;
694 }
695
696
697 m_Parent.ParamUpdateRemove(m_ParameterIndex);
698
699 m_CurrentValues = p_total;
700 }
701
703 {
705 AddPriorityInfo(layer);
706 }
707
710 {
712 m_CurrentValues = p_total;
713
714 }
715}
716
718{
720 {
722 m_Dependencies.Set(
PostProcessEffectType.Glow,{PPEGlow.PARAM_COLORIZATIONCOLOR, PPEGlow.PARAM_OVERLAYCOLOR});
723 }
724}
PPOperators
PP operators, specify operation between subsequent layers.
Param4< string, float, float, float > PPETemplateDefFloat
ref map< int, ref ColorValuesData > m_LayerInfo
override void SetParameterValueDefault(inout Param p_total)
No active requests for the mat. parameter value change, sets the value to DEFAULT (zero?...
class PPEMatClassParameterFloat extends PPEMatClassParameterCommandData PPEMatClassParameterFloatSaturation(int mat_idx, int parameter_idx, PPEClassBase parent)
override void InitCuttent()
override int GetParameterVarType()
void PPEMatClassParameterFloat(int mat_idx, int parameter_idx, PPEClassBase parent)
void PrepareLayerInfo(int layer, float value, int operator)
PPETemplateDefFloat m_Float
override void InitDefaults()
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)
Super root of all classes in Enforce script.
Created once, on manager init. Script-side representation of C++ material class, separate handling.
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
PostProcessEffectType
Post-process effect type.
void Error(string err)
Messagebox with error message.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float Min(float x, float y)
Returns smaller of two given values.
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'.