1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-20 01:06:02 +08:00

DOBlendableRotateBy optimizations

This commit is contained in:
Daniele Giardini 2019-10-22 15:29:46 +02:00
parent 082a66ceef
commit 7ffbeda1e3
14 changed files with 7 additions and 4 deletions

View File

@ -34,7 +34,7 @@ namespace DG.Tweening
public class DOTween public class DOTween
{ {
/// <summary>DOTween's version</summary> /// <summary>DOTween's version</summary>
public static readonly string Version = "1.2.290"; // Last version before modules: 1.1.755 public static readonly string Version = "1.2.295"; // Last version before modules: 1.1.755
/////////////////////////////////////////////// ///////////////////////////////////////////////
// Options //////////////////////////////////// // Options ////////////////////////////////////

View File

@ -1191,7 +1191,8 @@ namespace DG.Tweening
Quaternion diff = x * Quaternion.Inverse(to); Quaternion diff = x * Quaternion.Inverse(to);
#endif #endif
to = x; to = x;
target.rotation = target.rotation * Quaternion.Inverse(target.rotation) * diff * target.rotation; Quaternion currRot = target.rotation;
target.rotation = currRot * Quaternion.Inverse(currRot) * diff * currRot;
}, byValue, duration) }, byValue, duration)
.Blendable().SetTarget(target); .Blendable().SetTarget(target);
t.plugOptions.rotateMode = mode; t.plugOptions.rotateMode = mode;
@ -1215,7 +1216,8 @@ namespace DG.Tweening
Quaternion diff = x * Quaternion.Inverse(to); Quaternion diff = x * Quaternion.Inverse(to);
#endif #endif
to = x; to = x;
target.localRotation = target.localRotation * Quaternion.Inverse(target.localRotation) * diff * target.localRotation; Quaternion currRot = target.localRotation;
target.localRotation = currRot * Quaternion.Inverse(currRot) * diff * currRot;
}, byValue, duration) }, byValue, duration)
.Blendable().SetTarget(target); .Blendable().SetTarget(target);
t.plugOptions.rotateMode = mode; t.plugOptions.rotateMode = mode;
@ -1249,7 +1251,8 @@ namespace DG.Tweening
Quaternion diff = qnew * Quaternion.Inverse(qto); Quaternion diff = qnew * Quaternion.Inverse(qto);
#endif #endif
to = v; to = v;
target.rotation = target.rotation * Quaternion.Inverse(target.rotation) * diff * target.rotation; Quaternion currRot = target.rotation;
target.rotation = currRot * Quaternion.Inverse(currRot) * diff * currRot;
}, punch, duration, vibrato, elasticity) }, punch, duration, vibrato, elasticity)
.Blendable().SetTarget(target); .Blendable().SetTarget(target);
return t; return t;

Binary file not shown.