Announcement

Collapse
No announcement yet.

Static mesh parented under camera for Rift?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Static mesh parented under camera for Rift?

    There are times when I would like to display a static mesh billboarded in front of the camera. In my pawn where the camera component is defined, I have a static mesh parented underneath the camera.

    This displays just fine in normal play, but when the Rift is enabled, the mesh is no where to be seen.

    So my question: does that camera component actually get replaced with another when the oculus is enabled? Is there any way to preserve the hierarchy under the camera?

    Thanks!

    #2
    try to activate the "follow hmd orientation" checkmark in the properties of your camera manager (or player controller... forgot which one it was). does that help?

    Comment


      #3
      Originally posted by Mowfax View Post
      try to activate the "follow hmd orientation" checkmark in the properties of your camera manager (or player controller... forgot which one it was). does that help?
      Thanks for the reply! Hmm - I'm not sure I fully understand what "follow hmd orientation" really does. Here's why:

      First, I enabled it as you suggest, and magically a different issue I was seeing that the view would be facing the wrong direction when using the rift was solved. (Found another thread talking about it here.)

      But no luck with my mesh. Then I realized that I'd forgotten to take into account the head offset in rift mode. I pushed the static mesh out a bit, and suddenly I could see it in rift as I wanted.

      Here's the part I'm confused about: with "follow hmd orientation" checked, the mesh would not move around with the camera movement. With it off, it would follow as I wanted, but then I get the other bug of starting out facing the wrong direction in rift.

      Does any of that make sense to anyone?

      Thanks!

      Comment


        #4
        By enabling follow HMD orientation, the HMD orientation is added to the player camera manager instead of the player controller. It will do nothing to help you show/hide a static mesh for one particular eye.

        To ensure it always follows the camera, attach to your character camera component, then offset it.
        Alternatively, update the static mesh transform every tick from your camera.
        I've do this with a static mesh plane for rendering the output of a Coherent UI based menu.

        Originally posted by Stephen Hess View Post
        Is there any way to set a static mesh to render only in 1 eye for the Rift?
        To do this properly, you would really need to edit the source.
        Otherwise, offsetting it based on the head offset and IPD is the best you can do.
        Rule#21: Be polite, be professional, but have a plan to kill everyone you meet.

        Comment


          #5
          Great, thanks for the response, that makes sense.

          Comment


            #6
            Originally posted by Kris View Post
            By enabling follow HMD orientation, the HMD orientation is added to the player camera manager instead of the player controller. It will do nothing to help you show/hide a static mesh for one particular eye.

            To ensure it always follows the camera, attach to your character camera component, then offset it.
            Alternatively, update the static mesh transform every tick from your camera.
            I've do this with a static mesh plane for rendering the output of a Coherent UI based menu.


            To do this properly, you would really need to edit the source.
            Otherwise, offsetting it based on the head offset and IPD is the best you can do.
            Hi!
            Is there any way to interpolate the movement, so it has a delay until it reaches the center instead of being fixed?
            Thanks!
            Last edited by Alvaro Vazquez; 06-25-2014, 05:15 PM.

            Comment


              #7
              Originally posted by Alvaro Vazquez View Post
              Hi!
              Is there any way to interpolate the movement, so it has a delay until it reaches the center instead of being fixed?
              Thanks!
              This is what you are looking for. The vector being rotated is the offset of the static mesh to the Player Pawn in this instance. I then add the z value (height) after rotating the vector. I also add a little yaw offset to skew the mesh towards the camera view. You are going to need to use the offset values that work best for your project. Changing the Interp speed of the VInterp and RInterp will speed up or slow down the delay.

              What I can't figure out is how do you get the world or relative location of the HMD view camera? Getting the transform for the camera manager works normally but not while in HMD mode... Currently I have everything rotating around the root of the player pawn which causes the vector rotation to be off a little when pitching. To fix it, I need to the world or relative location of the HMD view camera...

              Click image for larger version

Name:	Rotate HUD.jpg
Views:	1
Size:	175.3 KB
ID:	1052307

              Comment


                #8
                Originally posted by sluisi View Post
                This is what you are looking for. The vector being rotated is the offset of the static mesh to the Player Pawn in this instance. I then add the z value (height) after rotating the vector. I also add a little yaw offset to skew the mesh towards the camera view. You are going to need to use the offset values that work best for your project. Changing the Interp speed of the VInterp and RInterp will speed up or slow down the delay.

                What I can't figure out is how do you get the world or relative location of the HMD view camera? Getting the transform for the camera manager works normally but not while in HMD mode... Currently I have everything rotating around the root of the player pawn which causes the vector rotation to be off a little when pitching. To fix it, I need to the world or relative location of the HMD view camera...

                [ATTACH=CONFIG]6142[/ATTACH]
                I should note that I am not using a camera component... The project I am working on already had the camera specified in C++ and not setup as a component in the editor... I'll probably just have to change that...

                Comment

                Working...
                X