1using Microsoft.MixedReality.Toolkit.Utilities;
2using System.Collections;
3using System.Collections.Generic;
33 public float Speed {
get;
private set; }
104 return Mathf.Abs( Quaternion.Angle(
m_LastSampleRotation, CameraCache.Main.transform.rotation ) );
A singleton Instance to track Camera Movements This will also calculate distance, rotation and speed ...
float CalculateDistanceCovered()
Calculate Distance
static CamMovementTracker m_CamTrackerInstance
Singleton Instance We have 1 Camera instance and 1 User at all time. Therefore, I believe Singleton i...
Quaternion m_LastSampleRotation
Holds last rotation value.
float Distance
Property to get and set Distance.
bool IsCameraMoving(float speed)
Calculate whether the player is moving or not.
Vector3 m_LastSampleLocation
Holds last location value
float RotationDelta
Property to get and set RotationDelta.
float CalculateSpeed()
Calculate Speed in killo meters per hour.
float CalculateRotation()
Calculate the rotations.
float m_LastSampleTime
Holds last timestamp value.
bool IsMoving
Property to get and set IsMoving flag.
void Awake()
If there is an instance, and it is not me, delete myself.
void Start()
Start is called before the first frame update.
float Speed
Property to get and set Speed.
void Update()
Update is called once per frame.
readonly float m_SampleTime
Just a default value to compare against.