Esempio n. 1
0
        public void Operate(EffectTarget target)
        {
            if (IsDesable() || 0f == target.RotationWeight)
            {
                return;
            }

            Quaternion targetRot = rotDiff_ * target.OrgRot;

            target.TR.rotation = Quaternion.SlerpUnclamped(target.TR.rotation, targetRot, target.RotationWeight);
        }
Esempio n. 2
0
        public void Operate(EffectTarget target)
        {
            if (IsDesable() || 0f == target.RotationWeight)
            {
                return;
            }

            Vector3 v = locPosDiff_ * target.PositionWeight;

            target.TR.localPosition = target.OrgLocPos +
                                      target.TR.InverseTransformDirection(TR.TransformDirection(v));
        }
Esempio n. 3
0
        public void InitTarget(EffectTarget target)
        {
            target.KeepScaleLength = target.TR.localScale.x + target.TR.localScale.y + target.TR.localScale.z;
            target.OrgLocScale     = target.TR.localScale;
            target.DiffHandleRot   = target.TR.rotation * Quaternion.Inverse(TR.rotation);

            Vector3 s = GetEffectedScale(target);

            s.x = target.OrgLocScale.x / s.x;
            s.y = target.OrgLocScale.y / s.y;
            s.z = target.OrgLocScale.z / s.z;
            target.CorrectScaleRatio = s;
        }
Esempio n. 4
0
        public void Operate(EffectTarget target)
        {
            if (IsDesable() || 0f == target.ScaleWeight)
            {
                return;
            }

            Vector3 s = GetEffectedScale(target);

            s = Vector3.Scale(s, target.CorrectScaleRatio);
            s = Vector3.Lerp(target.OrgLocScale, s, target.ScaleWeight);

            if (KeepLength)
            {
                s *= target.KeepScaleLength / (s.x + s.y + s.z);
            }
            target.TR.localScale = s;
        }
Esempio n. 5
0
        private Vector3 GetEffectedScale(EffectTarget target)
        {
            Vector3 s = Vector3.Scale(effectScaleRatio_, target.OrgLocScale);

            return(V3Abs(target.DiffHandleRot * s));
        }
Esempio n. 6
0
 public void InitTarget(EffectTarget target)
 {
     target.OrgRot = target.TR.rotation;
 }
Esempio n. 7
0
 public void InitTarget(EffectTarget target)
 {
     target.OrgLocPos = target.TR.localPosition;
 }