Example #1
0
            public Params(BoingEffector effector)
            {
                Bits = new Bits32();
                Bits.SetBit(BoingWork.EffectorFlags.ContinuousMotion, effector.ContinuousMotion);

                float speedEffectRatio =
                    effector.MaxImpulseSpeed > MathUtil.Epsilon
          ? Mathf.Min(1.0f, effector.LinearSpeed / effector.MaxImpulseSpeed)
          : 1.0f;

                PrevPosition      = effector.m_prevPosition;
                CurrPosition      = effector.m_currPosition;
                LinearVelocityDir = VectorUtil.NormalizeSafe(effector.LinearVelocity, Vector3.zero);
                Radius            = effector.Radius;
                FullEffectRadius  = Radius * effector.FullEffectRadiusRatio;
                MoveDistance      = effector.MoveDistance;
                LinearImpulse     = speedEffectRatio * effector.LinearImpulse;
                RotateAngle       = effector.RotationAngle * MathUtil.Deg2Rad;
                AngularImpulse    = speedEffectRatio * effector.AngularImpulse * MathUtil.Deg2Rad;

                m_padding0 = 0.0f;
                m_padding1 = 0.0f;
                m_padding2 = 0.0f;
                m_padding3 = 0;
            }
Example #2
0
        internal static void Unregister(BoingEffector effector)
        {
            if (OnEffectorUnregister != null)
            {
                OnEffectorUnregister(effector);
            }

            s_effectorMap.Remove(effector.GetInstanceID());
            PostUnregisterEffectorReactor();
        }
Example #3
0
        internal static void Register(BoingEffector effector)
        {
            PreRegisterEffectorReactor();
            s_effectorMap.Add(effector.GetInstanceID(), effector);

            if (OnEffectorRegister != null)
            {
                OnEffectorRegister(effector);
            }
        }
Example #4
0
 public void Fill(BoingEffector effector)
 {
     this = new Params(effector);
 }