|
|
@@ -465,6 +465,17 @@ class AimHandler
|
|
|
msOld = ms;
|
|
|
|
|
|
AMesh.transform.localRotation = newRotation = _9Axis.Update(Acc * 10, Gyr, Mag, TimeGap);
|
|
|
+ Quaternion nextRotation = controlObj.localRotation;
|
|
|
+ filter.Update(ref nextRotation, newRotation);
|
|
|
+ newRotation = nextRotation;
|
|
|
+ if (ArmBow.ins != null) {
|
|
|
+ for (int i = ArmBow.ins.recordRotations.Length - 1; i > 0 ; i--)
|
|
|
+ {
|
|
|
+ ArmBow.ins.recordRotations[i] = ArmBow.ins.recordRotations[i - 1];
|
|
|
+ }
|
|
|
+ ArmBow.ins.recordRotations[0] = newRotation;
|
|
|
+ ArmBow.ins.recordCount++;
|
|
|
+ }
|
|
|
|
|
|
receiveDataCount++;
|
|
|
if (!hasAutoIdentity && receiveDataCount == 5) {
|
|
|
@@ -485,9 +496,9 @@ class AimHandler
|
|
|
{
|
|
|
if (hasAutoIdentity && controlObj != null)
|
|
|
{
|
|
|
- Quaternion nowRotation = controlObj.localRotation;
|
|
|
- filter.Update(ref nowRotation, newRotation);
|
|
|
- controlObj.localRotation = Quaternion.Lerp(controlObj.localRotation, nowRotation, Time.deltaTime * 6);
|
|
|
+ // 最终结果进行lerp
|
|
|
+ // controlObj.localRotation = Quaternion.Lerp(controlObj.localRotation, newRotation, Time.deltaTime * 6);
|
|
|
+ controlObj.localRotation = newRotation;
|
|
|
// GameObject.Find("Canvas/RPY_LOG").GetComponent<Text>().text =
|
|
|
// "roll: " + controlObj.localEulerAngles.x +
|
|
|
// "\npitch: " + controlObj.localEulerAngles.y +
|