VR Expansion Plugin Documentation

4.1.VR Base Character

VR Base Character Actor is a new character class that is heavily modified to work in VR. It automatically populates with two GripControllers, a ParentRelativeAttachment, a ReplicatedVRCamera and a VRBaseCharacterMovementComponent.

The Base Character exists so that the VRCharacter and SimpleVRCharacter classes can share implementations of features without copying code. It also allows generally for casting to BaseCharacter and/or re-parenting between VRCharacter and SimpleVRCharacter.

How do I use it?

  • Create a VRCharacter or SimpleVRCharacter, they will have all of the properties and abilities of the VRBaseCharacter.

Variables

FVRSeatedCharacterInfo SeatInformation

Contains the calibration settings and current state of the seated mode.

Events

Event OnSeatedModeChanged
Triggered when seating mode has activated or de-activated

Event OnSeatThreshholdChanged
Triggered when the seated mode is active and the player either moves into / out of the threshold or the threshold scaler changes.

FVRSeatThresholdChangedSignature OnSeatThreshholdChanged_Bind
Same as above but bindable to so that other actors can act on it.

Event OnCustomMoveActionPerformed
Called just prior to ticking the movement when a moveaction is performed. Here to handle custom move actions.

Event OnBeginWallPushback
Called when pushback against a wall starts.

Event OnEndWallPushback
Called when pushback against a wall ends.

Event ReceiveNavigationMoveCompleted
Called when a navigation process ends.

Event OnClimbingStepup
Called when a climbing step up has been performed (if bUseClimbingStepUp is true)

Functions

SetSeatedMode
Sets the seated mode to on/off. When sitting TargetLoc/Rot is the camera relative location/rotation, when standing TargetLoc/Rot is the location to teleport to / rotation to face.

bZeroToHead means the head should be the focal point, if false the seated mode runs from the feet instead and vertical movement is not taken into account.

ReZeroSeating
Zeros the seated mode to the passed in new relative loc/rot.

AddActorWorldRotationVR
Adds delta rotation to the VRCharacter using the camera as the pivot point.

SetActorRotationVR
Sets the actor rotation from the cameras location

SetActorLocationAndRotationVR
Sets the actor rotation and location from the cameras location.

SetCharacterSizeVR
Same as setting capsule height but regenerates the world position.

SetCharacterHalfHeightVR
Same as setting the capsule half height but regenerates the world position

GetTeleportLocation
Gets the position to teleport to when given a target location (will offset by HMD if VRCharacter, won’t if SimpleVRCharacter). This is off of 0 on the actor when normally teleport locations in engine are off of HalfHeight of the characters capsule. However all of my VR characters work off of the actors 0,0,0 location being the floor / foot location.

GetVRLocation
Gets the location of the “VR” character, since it is offset from the actors root location. This value includes the half capsule height offset that characters normally have.

GetVRForwardVector
Gets the forward vector for the VR characters facing

Suggest Edit