mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-26 18:35:34 +00:00
cleanup
This commit is contained in:
parent
04268f71e3
commit
d736d0fdf7
@ -1,5 +1,8 @@
|
|||||||
public enum ConversationType
|
namespace QSB.ConversationSync
|
||||||
{
|
{
|
||||||
CHARACTER,
|
public enum ConversationType
|
||||||
PLAYER
|
{
|
||||||
|
CHARACTER,
|
||||||
|
PLAYER
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace QSB.TransformSync
|
|
||||||
{
|
|
||||||
public static class QuaternionHelper
|
|
||||||
{
|
|
||||||
// Stolen from here: https://gist.github.com/maxattack/4c7b4de00f5c1b95a33b
|
|
||||||
public static Quaternion SmoothDamp(Quaternion rot, Quaternion target, ref Quaternion deriv, float time)
|
|
||||||
{
|
|
||||||
// account for double-cover
|
|
||||||
var dot = Quaternion.Dot(rot, target);
|
|
||||||
var multi = dot > 0f ? 1f : -1f;
|
|
||||||
target.x *= multi;
|
|
||||||
target.y *= multi;
|
|
||||||
target.z *= multi;
|
|
||||||
target.w *= multi;
|
|
||||||
// smooth damp (nlerp approx)
|
|
||||||
var result = new Vector4(
|
|
||||||
Mathf.SmoothDamp(rot.x, target.x, ref deriv.x, time),
|
|
||||||
Mathf.SmoothDamp(rot.y, target.y, ref deriv.y, time),
|
|
||||||
Mathf.SmoothDamp(rot.z, target.z, ref deriv.z, time),
|
|
||||||
Mathf.SmoothDamp(rot.w, target.w, ref deriv.w, time)
|
|
||||||
).normalized;
|
|
||||||
// compute deriv
|
|
||||||
var dtInv = 1f / Time.deltaTime;
|
|
||||||
deriv.x = (result.x - rot.x) * dtInv;
|
|
||||||
deriv.y = (result.y - rot.y) * dtInv;
|
|
||||||
deriv.z = (result.z - rot.z) * dtInv;
|
|
||||||
deriv.w = (result.w - rot.w) * dtInv;
|
|
||||||
return new Quaternion(result.x, result.y, result.z, result.w);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user