mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 11:38:16 +00:00
Backed out 2 changesets (bug 1355648) for failures in test_gamepad_extensions.html
CLOSED TREE Backed out changeset 1a675abcc1f0 (bug 1355648) Backed out changeset f07c7d6ddb8d (bug 1355648) MozReview-Commit-ID: 86HfzOsNVjZ
This commit is contained in:
parent
be9487beea
commit
7e834ae6b6
@ -55,9 +55,8 @@ GamepadPose::GetPosition(JSContext* aJSContext,
|
||||
JS::MutableHandle<JSObject*> aRetval,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
SetFloat32Array(aJSContext, aRetval, mPosition,
|
||||
mPoseState.isPositionValid ? mPoseState.position : nullptr, 3,
|
||||
bool(mPoseState.flags & GamepadCapabilityFlags::Cap_Position), aRv);
|
||||
SetFloat32Array(aJSContext, aRetval, mPosition, mPoseState.position, 3,
|
||||
bool(mPoseState.flags & GamepadCapabilityFlags::Cap_Position), aRv);
|
||||
}
|
||||
|
||||
void
|
||||
@ -65,9 +64,8 @@ GamepadPose::GetLinearVelocity(JSContext* aJSContext,
|
||||
JS::MutableHandle<JSObject*> aRetval,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
SetFloat32Array(aJSContext, aRetval, mLinearVelocity,
|
||||
mPoseState.isPositionValid ? mPoseState.linearVelocity : nullptr, 3,
|
||||
bool(mPoseState.flags & GamepadCapabilityFlags::Cap_Position), aRv);
|
||||
SetFloat32Array(aJSContext, aRetval, mLinearVelocity, mPoseState.linearVelocity, 3,
|
||||
bool(mPoseState.flags & GamepadCapabilityFlags::Cap_Position), aRv);
|
||||
}
|
||||
|
||||
void
|
||||
@ -75,9 +73,8 @@ GamepadPose::GetLinearAcceleration(JSContext* aJSContext,
|
||||
JS::MutableHandle<JSObject*> aRetval,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
SetFloat32Array(aJSContext, aRetval, mLinearAcceleration,
|
||||
mPoseState.isPositionValid ? mPoseState.linearAcceleration : nullptr, 3,
|
||||
bool(mPoseState.flags & GamepadCapabilityFlags::Cap_LinearAcceleration), aRv);
|
||||
SetFloat32Array(aJSContext, aRetval, mLinearAcceleration, mPoseState.linearAcceleration, 3,
|
||||
bool(mPoseState.flags & GamepadCapabilityFlags::Cap_LinearAcceleration), aRv);
|
||||
}
|
||||
|
||||
void
|
||||
@ -85,9 +82,8 @@ GamepadPose::GetOrientation(JSContext* aJSContext,
|
||||
JS::MutableHandle<JSObject*> aRetval,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
SetFloat32Array(aJSContext, aRetval, mOrientation,
|
||||
mPoseState.isOrientationValid ? mPoseState.orientation : nullptr, 4,
|
||||
bool(mPoseState.flags & GamepadCapabilityFlags::Cap_Orientation), aRv);
|
||||
SetFloat32Array(aJSContext, aRetval, mOrientation, mPoseState.orientation, 4,
|
||||
bool(mPoseState.flags & GamepadCapabilityFlags::Cap_Orientation), aRv);
|
||||
}
|
||||
|
||||
void
|
||||
@ -95,9 +91,8 @@ GamepadPose::GetAngularVelocity(JSContext* aJSContext,
|
||||
JS::MutableHandle<JSObject*> aRetval,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
SetFloat32Array(aJSContext, aRetval, mAngularVelocity,
|
||||
mPoseState.isOrientationValid ? mPoseState.angularVelocity : nullptr, 3,
|
||||
bool(mPoseState.flags & GamepadCapabilityFlags::Cap_Orientation), aRv);
|
||||
SetFloat32Array(aJSContext, aRetval, mAngularVelocity, mPoseState.angularVelocity, 3,
|
||||
bool(mPoseState.flags & GamepadCapabilityFlags::Cap_Orientation), aRv);
|
||||
}
|
||||
|
||||
void
|
||||
@ -105,9 +100,8 @@ GamepadPose::GetAngularAcceleration(JSContext* aJSContext,
|
||||
JS::MutableHandle<JSObject*> aRetval,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
SetFloat32Array(aJSContext, aRetval, mAngularAcceleration,
|
||||
mPoseState.isOrientationValid ? mPoseState.angularAcceleration : nullptr, 3,
|
||||
bool(mPoseState.flags & GamepadCapabilityFlags::Cap_AngularAcceleration), aRv);
|
||||
SetFloat32Array(aJSContext, aRetval, mAngularAcceleration, mPoseState.angularAcceleration, 3,
|
||||
bool(mPoseState.flags & GamepadCapabilityFlags::Cap_AngularAcceleration), aRv);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -42,8 +42,6 @@ struct GamepadPoseState
|
||||
float angularAcceleration[3];
|
||||
float linearVelocity[3];
|
||||
float linearAcceleration[3];
|
||||
bool isPositionValid;
|
||||
bool isOrientationValid;
|
||||
|
||||
GamepadPoseState()
|
||||
{
|
||||
@ -71,9 +69,7 @@ struct GamepadPoseState
|
||||
&& linearVelocity[2] == aPose.linearVelocity[2]
|
||||
&& linearAcceleration[0] == aPose.linearAcceleration[0]
|
||||
&& linearAcceleration[1] == aPose.linearAcceleration[1]
|
||||
&& linearAcceleration[2] == aPose.linearAcceleration[2]
|
||||
&& isPositionValid == aPose.isPositionValid
|
||||
&& isOrientationValid == aPose.isOrientationValid;
|
||||
&& linearAcceleration[2] == aPose.linearAcceleration[2];
|
||||
}
|
||||
|
||||
bool operator!=(const GamepadPoseState& aPose) const
|
||||
|
@ -62,8 +62,6 @@ struct ParamTraits<mozilla::dom::GamepadPoseState>
|
||||
WriteParam(aMsg, aParam.linearAcceleration[0]);
|
||||
WriteParam(aMsg, aParam.linearAcceleration[1]);
|
||||
WriteParam(aMsg, aParam.linearAcceleration[2]);
|
||||
WriteParam(aMsg, aParam.isPositionValid);
|
||||
WriteParam(aMsg, aParam.isOrientationValid);
|
||||
}
|
||||
|
||||
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
|
||||
@ -87,9 +85,7 @@ struct ParamTraits<mozilla::dom::GamepadPoseState>
|
||||
!ReadParam(aMsg, aIter, &(aResult->linearVelocity[2])) ||
|
||||
!ReadParam(aMsg, aIter, &(aResult->linearAcceleration[0])) ||
|
||||
!ReadParam(aMsg, aIter, &(aResult->linearAcceleration[1])) ||
|
||||
!ReadParam(aMsg, aIter, &(aResult->linearAcceleration[2])) ||
|
||||
!ReadParam(aMsg, aIter, &(aResult->isPositionValid)) ||
|
||||
!ReadParam(aMsg, aIter, &(aResult->isOrientationValid))) {
|
||||
!ReadParam(aMsg, aIter, &(aResult->linearAcceleration[2]))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -1264,7 +1264,6 @@ VRSystemManagerOculus::HandleInput()
|
||||
poseState.angularAcceleration[0] = pose.AngularAcceleration.x;
|
||||
poseState.angularAcceleration[1] = pose.AngularAcceleration.y;
|
||||
poseState.angularAcceleration[2] = pose.AngularAcceleration.z;
|
||||
poseState.isOrientationValid = true;
|
||||
}
|
||||
if (state.HandStatusFlags[handIdx] & ovrStatus_PositionTracked) {
|
||||
poseState.flags |= GamepadCapabilityFlags::Cap_Position;
|
||||
@ -1282,7 +1281,6 @@ VRSystemManagerOculus::HandleInput()
|
||||
|
||||
float eyeHeight = ovr_GetFloat(mSession, OVR_KEY_EYE_HEIGHT, OVR_DEFAULT_EYE_HEIGHT);
|
||||
poseState.position[1] -= eyeHeight;
|
||||
poseState.isPositionValid = true;
|
||||
}
|
||||
HandlePoseTracking(i, poseState, controller);
|
||||
}
|
||||
|
@ -728,15 +728,9 @@ VRSystemManagerOpenVR::HandleInput()
|
||||
|
||||
// Start to process pose
|
||||
const ::vr::TrackedDevicePose_t& pose = poses[trackedIndex];
|
||||
GamepadPoseState poseState;
|
||||
|
||||
if (pose.bDeviceIsConnected) {
|
||||
poseState.flags |= (GamepadCapabilityFlags::Cap_Orientation |
|
||||
GamepadCapabilityFlags::Cap_Position);
|
||||
}
|
||||
|
||||
if (pose.bPoseIsValid &&
|
||||
pose.eTrackingResult == ::vr::TrackingResult_Running_OK) {
|
||||
if (pose.bDeviceIsConnected && pose.bPoseIsValid &&
|
||||
pose.eTrackingResult == ::vr::TrackingResult_Running_OK) {
|
||||
gfx::Matrix4x4 m;
|
||||
|
||||
// NOTE! mDeviceToAbsoluteTracking is a 3x4 matrix, not 4x4. But
|
||||
@ -750,6 +744,8 @@ VRSystemManagerOpenVR::HandleInput()
|
||||
rot.SetFromRotationMatrix(m);
|
||||
rot.Invert();
|
||||
|
||||
GamepadPoseState poseState;
|
||||
poseState.flags |= GamepadCapabilityFlags::Cap_Orientation;
|
||||
poseState.orientation[0] = rot.x;
|
||||
poseState.orientation[1] = rot.y;
|
||||
poseState.orientation[2] = rot.z;
|
||||
@ -757,17 +753,16 @@ VRSystemManagerOpenVR::HandleInput()
|
||||
poseState.angularVelocity[0] = pose.vAngularVelocity.v[0];
|
||||
poseState.angularVelocity[1] = pose.vAngularVelocity.v[1];
|
||||
poseState.angularVelocity[2] = pose.vAngularVelocity.v[2];
|
||||
poseState.isOrientationValid = true;
|
||||
|
||||
poseState.flags |= GamepadCapabilityFlags::Cap_Position;
|
||||
poseState.position[0] = m._41;
|
||||
poseState.position[1] = m._42;
|
||||
poseState.position[2] = m._43;
|
||||
poseState.linearVelocity[0] = pose.vVelocity.v[0];
|
||||
poseState.linearVelocity[1] = pose.vVelocity.v[1];
|
||||
poseState.linearVelocity[2] = pose.vVelocity.v[2];
|
||||
poseState.isPositionValid = true;
|
||||
HandlePoseTracking(i, poseState, controller);
|
||||
}
|
||||
HandlePoseTracking(i, poseState, controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user