05-22-2018 03:41 PM
06-01-2018 11:15 AM
06-01-2018 01:12 PM
sara.hanson.12382 said:
@stregillus I can get readings for acceleration in that same way as well. I just changed angularAcceleration to acceleration and it worked.
OVRDisplay _ovrDisplay;
Start(){
_ovrDisplay = new OVRDisplay();
}
Update(){
Debug.Log(_ovrDisplay.acceleration);
}
Instantiated every frameUpdate(){
OVRDisplay ovrDisplay = new OVRDisplay();
Debug.Log(ovrDisplay.acceleration);
}
Retrieved using OVRManager.displayAll of these return vectors that are all 0s.Update(){
Debug.Log(OVRManager.display.acceleration);
}
06-01-2018 01:57 PM
public Vector3 acceleration
{
get {
if (!OVRManager.isHmdPresent) {
return Vector3.zero;
}
return OVRPlugin.GetNodeAcceleration(OVRPlugin.Node.None, OVRPlugin.Step.Render).FromFlippedZVector3f();
}
}
Note the "Node.None" there! I changed it to Node.Head, so now it looks like this:public Vector3 acceleration
{
get {
if (!OVRManager.isHmdPresent) {
return Vector3.zero;
}
return OVRPlugin.GetNodeAcceleration(OVRPlugin.Node.Head, OVRPlugin.Step.Render).FromFlippedZVector3f();
}
}
Now I'm getting the values I want! It looks like these units are in Meters/Second squared. In my case, my code was originally programmed to assume Gs, so I just divided that number by 9.8, and I'm getting the values that I seem to want.06-01-2018 07:36 PM
06-01-2018 08:57 PM
06-02-2018 03:05 PM
06-02-2018 05:03 PM
06-06-2018 10:24 PM
06-11-2018 12:11 PM
06-12-2018 12:47 PM