Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
peterept's avatar
peterept
Protege
11 years ago

ForwardDirection broken in 0.4.4beta?

ForwardDirection is not rotating.

Oculus 0.4.4beta with Unity 4.6.2p2 (windows).

Repro:
Open a new project and import Tuscany Integration.
Run the Tuscany demo.
Watch the ForwardDirection in the inspector and rotate the DK2 around Y.

Expected:
ForwardDirection game object rotates on the Y

Actual:
ForwardDirection is not rotating.

Anyone else seen this?

1 Reply

Replies have been turned off for this discussion
  • I've been looking into the scripts and here's what I can see changed in 0.4.4:

    - The previous OVRPlayerController prefab was setup for look-move movement, where ever you looked that is the direction Forward takes you. (And consequently ForwardDirection rotated with both the camera (Rift) and the joystick/keyboard.

    - The new OVRPlayerController supports both tank-mode (decoupled head/body rotation) and look-move. This is controlled by the "Hmd Rotates Y" flag: ON means look-move and OFF means tank-mode. BUT, the ForwardDirection game object's rotation (or position) is never updated.

    A quick fix I did is add the following code to OVRPlayerController:

    Bottom of Start:

    		// Find the ForwardDirection game object (code from older OVRPlayerController SDK)
    DirXform = null;
    Transform[] Xforms = gameObject.GetComponentsInChildren<Transform>();

    for(int i = 0; i < Xforms.Length; i++)
    {
    if(Xforms[i].name == "ForwardDirection")
    {
    DirXform = Xforms[i];
    break;
    }
    }


    And in UpdateMovement:

    		// Add support for rotating (and positioning) the ForwardDirection 
    if (HmdRotatesY && DirXform != null)
    {
    DirXform.rotation = Quaternion.identity * ort;
    DirXform.position = CameraController.centerEyeAnchor.position;
    }


    This gets me unstuck for tonight.

    I guess the re-architecture with the OVRCameraRig is mostly around position tracking. ForwardDirection made sense with simple orientation. But now we have the camera rig that does positional as well. So now a decoupled head is attached to the CameraRig, and a body should be stretched between the head and the ground.

    Peter