CameraTracker.cs 541 B

1234567891011121314151617181920
  1. using System;
  2. using UnityEngine;
  3. namespace Tracking
  4. {
  5. public class CameraTracker: CalibratableTracker
  6. {
  7. public float LeanRotation { get; private set; }
  8. protected override string KeyPrefix => "cam";
  9. public KineticLegTracker legTracker;
  10. private void Update()
  11. {
  12. var adjustedRotation = RelativeRotation - legTracker.RelativeRotation;
  13. //calculate how much it rotates around z of bicycleTransform
  14. LeanRotation = adjustedRotation.y;
  15. }
  16. }
  17. }