We enabled ourselves to use a late rendering update, even if we’re manually setting the rotation and location of the camera. SetRelativeTransform(FTransform(Orientation, FVector::ZeroVector)) Ĭompile the engine and go get some coffee. SetRelativeTransform(FTransform(Orientation, Position)) If (GEngine->HMDDevice->UpdatePlayerCamera(Orientation, Position)) If ((bLockToHmd || bLockRotToHmd) & GEngine->HMDDevice.IsValid() & GEngine->HMDDevice->IsHeadTrackingAllowed()) GEngine->HMDDevice->SetupLateUpdate(ParentWorld, this) If (bUseLateUpdate & GEngine->HMDDevice.IsValid() & GEngine->HMDDevice->IsHeadTrackingAllowed())Ĭonst FTransform ParentWorld = GetComponentToWorld() Change the top portion of the method code to look like this: We’re going to add support for locking the HMD rotation and support for a late render update. We’re going to be making some small modifications to this. Look for the “GetCameraView(float DeltaTime, FMinimalViewInfo& DesiredView)” method (Line 216). Next, open up “CameraComponent.cpp” in \Engine\Source\Runtime\Engine\Private\Camera\CameraComponent.cpp Use this for VR if you aren't locking the HMD.*/ *This will use a late update to on the render thread. ** True if ONLY the camera's orientation should be locked to the HMD. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = CameraSettings)Īnd then add the following two code blocks: ** True if the camera's orientation and position should be locked to the HMD */ Open up “CameraComponent.h” in \Engine\Source\Runtime\Engine\Classes\Camera\CameraComponent.h It will always be centered on the players head, and if you call “Get Actor Location” on this head, you’ll get the players head in world space coordinates! This is super simplified, because now you don’t have to derive this location from the actor location + camera relative offset. We don’t want to sweep along the camera component location delta, we want to sweep along the actor location delta.Ĭonceptually, I have a disembodied head which contains all of the VR specific implementation code. In order to prevent people from putting their head through a wall, we’d have to do a sweep test between the cameras current location and its previous location to figure out if there’s anything colliding. Okay? So this means people can put their head through a wall. The important thing to note is that in the standard documentation, this will cause the Camera Component Relative Location to change by the HMD location, but the scene component your camera is attached to is NOT CHANGED. This would make sure that any HMD **translations **and **rotations **are applied to the camera, and it also applies a rendering late update. Normally, you would go into your Camera Component and find a checkbox which says “Lock to HMD” and you’d make sure that is checked. Before we get into that, let me explain what’s going on. You MUST download the latest source and compile the engine for this to work because we’re going to be making a couple small modifications to the engine source in order for this to work. I am using the 4.13 Source build of the engine.I’m going to walk you guys through how to replicate my success. I came up with a two part solution and it goes against the Epic VR documentation, but I feel my setup is far superior. Have some friends ruining their USB ports due to ripping the connector off the PCB, thinking it’s a clip connector.Hey guys, there is a really tricky problem to deal with in VR: How do you prevent the player from putting their head through a colliding object? This isn’t much of an issue, but in sub-par lit environments, it looks like a clip connector. 3) The USB connector isn’t labeled as a pull-out connector. I also avoided this thanks to a comment on the step, but I’ve heard many has broken their sensors doing this. Some remaining dirt is better than a broken stick. DO NOT USE FORCE ON THESE! If you’re in doubt, just try and blow some air into them. 2) The sensor housing have very fragile clips which easily break after a repair or two. These easily break, although I avoided that. Only remark I have are three things: 1) There are four clips that are hard to see on the images, and aren’t detailed they are on the top right and left, under the “SHARE” and “OPTIONS” buttons, as well as the two clips on either side of the docking port. Great walkthrough and high-res images makes the job a lot smoother.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |