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); }
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)); }
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; }
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; }
private Vector3 GetEffectedScale(EffectTarget target) { Vector3 s = Vector3.Scale(effectScaleRatio_, target.OrgLocScale); return(V3Abs(target.DiffHandleRot * s)); }
public void InitTarget(EffectTarget target) { target.OrgRot = target.TR.rotation; }
public void InitTarget(EffectTarget target) { target.OrgLocPos = target.TR.localPosition; }