No announcement yet.

VR Expansion Plugin

  • Filter
  • Time
  • Show
Clear All
new posts

    VR Expansion Plugin

    VR Expansion Plugin

    *Updated: 02/11/2019*

    10/10/2016 - No longer OpenVR specific, if platform does not support OpenVR the plugin no longer compiles out the OpenVR specific code.
    Also all OpenVR code is in a separate module that can be disabled.

    Playable Template Demo
    Template Packaged Download

    This plugin is intended to ease the creation of VR games/experiences in UE4. It is up to quite a few different additions now and has a fleshed out wiki to help ease into it (may be a version or two behind at times, I attempt to update it when I can, the template is generally the best informational tool). It is also intended to be compatible with multiplayer experiences without any direct changes from the end user, most of the relevant components / actors replicated themselves over the network with some customization included.

    *Note* I wouldn't always suggest using this plugin AS IS for a large project with experienced developers, in that situation you may be better off using code from it on a case by case example of how different systems could be achieved in engine. I can't support every possible interaction in VR and some things could be done cleaner in a less general way for projects that don't need to support uncommon interactions or want the features in already implemented systems, shoehorning the plugin into projects already in process might not be the best solution. That being said there are a decent amount of projects that switched over while already in development and are doing fine.

    For small projects as far as I am aware it should be a quick and easy way to get going with more advanced VR interactions.

    It is fully Blueprint implemented but can be manually linked to and used in c++ if needed.

    Consider Supporting Me On Patreon

    Latest informational video

    Some Games In progress or released that currently use the plugin (These are just ones I know about)
    Bartender VR Simulator
    Surv1v3 Early Access
    Dark Frontier Early Access
    Temple of Aluxes
    Run Of Mydan Early Access
    Gladius Early Access
    The_Nest - Ctrl Alt Del Multiplayer patch uses the plugin
    Island_359 Used at least some code from it, unsure as to how much integration.
    Virtual Escape: The Play Room - Used a very early version of the plugin - Recently updated to newest
    Until None Remain
    Unknightly - Early Access
    Hailstorm VR - Early Access
    Frol Blok
    Nightstar Alliance - Released
    Social Club VR: Casino Nights
    Contagion VR Outbreak - Early Access
    The Homestead Invasion - Early Access
    Zero Caliber - Early Access
    End Of Days - EarlyAccess
    Out Of Ammo - Switched over to the plugins gripping system in a large overhaul post release
    District Steel
    Honeypot Espionage
    Viar Warefare
    Timmy's Playhouse
    Pieces Of Eight
    In League
    Sleeping Dawn VR
    Rise Of The Bots VR (UE4 GameJam 5 Day, example of using the plugin without the template on a deadline)
    Plugin Pre-built Downloads
    Plugin Repository

    Plugin Example Template Repository

    Open Input Repository (Knuckles/ect until its a main part of the engine it will be a separate module)

    Plugin Migration Guides

    Migration Guides

    Repository Wiki Page

    Auto Generated Node References (KantanDocGen)

    Feature Request Submission:
    Feature Request Trello Board

    To submit a request, send an e-mail to
    Feature Request E-mail
    With the subject being the Card title and the body being the card body.

    Repository Installation articles By Community Member kusogaki77

    Basic Installation Step-By-Step

    Specific Commit Download Tutorial

    Pre-built binary useage

    Template Note:

    I would like to note by the way that everything currently in the template is an example of what I think is best practices (though maybe not implemented as well as I would for an actual game), not everyone is going to need the same set up and not everyone is going to need a full VRcharacter. Custom pawns that just use the motion controllers and camera / parent relative component would be useful to people that don't want gravity / collision. It also has to give examples of far more things than an average game is likely to use, so there WILL be refactoring involved if it is used as a base for one (input bindings for one).

    Template Change Log
    Changed the Gripping sphere trace to use HitLocation instead of ImpactLocation for the socket in range checks, while impact location is supposed to
    fall back to hit location if it wasn't able to be validated, there was an instance with a specific user where that behavior
    was not being shown (even though it works as intended for everyone else...). Since I don't know the engine level cause for this
    inconsistancy and since the actual difference is only up to the radius of the trace sphere (generally very small) I moved to the
    other variable.
    Re-wrote how the character / player controller is initialized to be far cleaner.
    Added Knuckles EV2 default controller profile and changed some of the character logic to check for it in OpenVR.
    Changed the FPS test pawn to load its profile in a different area
    Removed a corrupt BP and prepped everything so that packaging with PackageAllDirectorys works without issues on the template.
    Removed unused content that was just bloating the repository (left over EpicVR template content)
    Reference BP Grip script will be coming later.
    Changed Sedan actor to use a Boxmesh around it for the navigation modifier.
    Added a filter to "CanBeClimbed" to always ignore grip interfaced objects.
    Added a VRPlayerStart to the template level in place of the PlayerStart that
    was there before.
    Changed drawer actor to use sliders and the new momentum settings
    Changed the player controller to wait around for tracking before
    spawning. Checks for valid tracked position and if it isn't valid yet it
    waits before sending the players HMD info to the server (so server delays itself).
    Overhauled how the teleport controllers get the player state and set themselves up a bit.
    Added socketing capability to the sample gun for the body component on the example pawn.
    Added a socketing check to the VivePawnCharacter in the CallCorrectDropEvent area of the event graph (really simple).
    More complex implementations could skip querying the object and check themselves, or do other things.
    Remade the controller model loading and controller profile support to use the new bOffsetByControllerProfile option
    on the GripMotionControllers.
    Changed controller model loading to be per hand and safe for oculus platform in the template
    Corrected Epics roomscale rotation for teleport boundries (unsure if they fixed this in their base template ever).
    Added optional tracking sensors to the teleport outline
    Removed the Interactible.Door/Lever/Dial gameplay tags, they aren't needed for the template.
    Rather people define their own categories if they use them for that.
    Removed UseSeperateTouchSockets from the gameplay tags and from being used in the BP character.
    Now that BP controller profiles exist I would rather that they be used instead as they do this in a better
    manner anyway.
    Set the FPS test pawn to the Oculus_Touch controller profile so that objects align correctly.
    Updated VivePawnCharacter to use the new GripIDs for dropping notices, saves slightly on bandwidth and is
    safer overall.
    Updated the pixel density slider to show percentages and be 4 digit precision, helps people visualize
    how to properly use the command.
    Set the default example gun in the template to ignore gravity (in grip settings), hate the slight offset.
    Added thumbstick deadzone variable to the vive pawn for sliding movement, the deadzone ability was always there
    but I never made a variable for people to easily modify it (defaulted off 0.0f)
    Started some touch profile input overrides, Template should have profile examples, been really busy
    with backend work and didn't get around to it before.
    Added a pre-check for bDenyGripping on client side before trying to RPC a grip request to the server, saves some
    Now using newer openvrhmddevicetype node at init to more cleanly detect HMD type in the template.
    4.19 Changes
    Secondary grips moved to client side and pre-checked, also secondary checked before primary.
    Many other BP changes and cleanups for the characters.
    Fixed some bad logic in the Vive_PawnCharacter that kept secondary grips from behaving correctly sometimes.
    Added example content for the new VRGestureComponent and GestureDatabase DataAsset.
    Added a new gameplay tag "Interactible.UsePerBoneGripping" and new blueprint changes to support it.
    Has to be specifically defined as we have to pass in a different transform with per bone, as well as only tracing
    being able to do it (overlaps do not return hit bones....).
    Plugin Change Log
    Now caching the secondary attachment pointer, this lets me
    make sure that the server gets a valid pointer on release of secondary grips, also lets me throw drop events
    when the secondary attachment changed but its still a secondary.
    Changed to sending the full transform on drop with client auth grips instead of just position / rotation.
    Fixed a Z axis bug introduced with the lever angle re-write
    Moved EVRInteractibleAxis to the VRInteractibleFunctionLibrary header,
    it belongs there instead.
    Switched levers over to use the Interactible library functions
    Also made the dial use the same basic logic as the lever for rotation,
    with an option to revert back to direct hand sampling.
    Added new grip type "EventsOnly", will skip ALL extra logic of grips and only store the grip
    data and fire the events for it. Whether you do anything else with it or not is up to you.
    Like a CustomGrip except even more barebones as it does not fire TickGrip or obey any of the
    dropping simulation logic, it is also auto excluded from late updates.
    Stopped calling "StopSimulating" on Custom Gripped objects automatically.
    It is legal to start and keep a custom grip simulating, that call should have
    never been there. Anyone who needs their custom grips to auto stop simulating on grip
    will need to call it in the OnGrip event themselves.
    Fixed a net smoothing bug with linear smoothing that could cause crashes
    when rotating. Exponential smoothing is the engine default when using smoothing
    and smoothing is off by default in the plugin so this took awhile to run into.
    Now initializing some vars that Oculus may not be setting on mobile
    This would be a bug in the base engine source, engine source is still bugged but plugin motion controllers
    should function. Issues happen when tracking is lost on oculus platforms (IE: Oculus GO controller and app loses focus)
    Made GunTools virtual stock settings part of the global settings structure
    this makes it easier to store a copy in the character and replicate it to the server
    as well as from the server to the gripped object for setting.
    Also added the option to UseGlobalVirtualStockSettings in the gun tools grip script.
    When enabled it will load the current settings from the global settings (default true and only for locally controlled).
    When disabled it uses local settings of the script.
    Added custom movement events for climbing and low grav movement modes. (EventUpdateClimbingMovement/LowGrav)
    Is a better way of getting the hand offset than in the actors main tick, run the same logic but here so that it is taken in
    the same frame instead of the next.
    c++ projects can still override PhysCustom_Climbing to do the same or they can overide the EventUpdateClimbingMovement_Implementation
    Also am now properly setting / clearing the climbing variables, the time moments when it
    was being done wouldn't work with the new placement of the query.
    Many lever improvements on the back end
    mostly fixing Axis_Y issues since it is the last order of operations with Quats.
    Also added SetLeverAngle function
    Moved button overlap bindings later in init to avoid an editor copy error.
    Added a BP Accessible IsLocallyControlled to the motion controllers, it can be very useful, mostly
    with avoiding extra casts to check for local owner OnGrip ect.
    Changed LerpToHand to be a fixed time period of lerp, not speed based.
    Added a control distance variable to the LerpToHand gripscript
    If the distance to the hand is smaller than this value then the lerp
    script won't activate on grip.
    Default of 0.0f means that it will always activate.
    Also added a curve editor to it that is optional.
    Added some brief descs to the headers for the Grip scripts and removed the
    SHOULD NOT BE USED warning from gun tools.
    Fixed a scaling bug with the auto SnapToSocket setup when gripping.
    Many of these changes go for 4.20 and 4.19 versions as well (except for the new gun tools, it is 4.21 only)
    Finalized beta version of GunTools Grip Script, supports pivot offsets, recoil instances, virtual mount settings, extended smoothing.
    Moved smoothing settings out of default grips and into the gun tools grip script.
    This will lower default grip overhead and also let me specifically fine tune
    the smoothing for gunplay.
    Added "WantsDenyLateUpdates" to grip scripts allowing grip scripts to deny late updates when they don't want them.
    Opened up Grip Scripts to be editable per instance again instead of just in defaults.
    Added remote grip pivot setting to the motion controllers, allows easier remote gripping and custom operations / mobile VR ease of use.
    Fixed it so that attachment grips will now have full use of the late update settings
    and features. Also moved the interface late update deny checking to the end of the logic checks
    to save some perf on grips that will be denied anyway.
    Also fixed it to support Custom pivot component for attachment grips
    Move setting collision on to post moving capsule in seated mode
    Also use teleport for movement from seated position. Fixes some collision issues exiting a physics vehicle.
    Made bDenyGripping defaults visible for all interactibles.
    Also made BreakDistance be ignored if value is 0.0f on all interactibles (to match
    general grip settings).
    Added new DeltaTeleportation, a new teleport type added to help alieviate teleporting with physics simulating skeletal bodies in hand.
    Am now filling in the Component Velocity member of the GripMotionControllers.
    Added OnStartedTracking and OnEndedTracking events to the motion controllers.
    Added prelim OnBeginInteraction and OnEndInteraction events to the button component.
    Also added the Interacting Component to the button events as it is useful in itself.
    Removed IgnoreActorWhenMoving from grip inits, it was causing overlap spam as the primitive bodies
    were not correctly clearing overlap passes.
    Set multiple variables to initialize due to 4.21 warnings, regardless of if they really needed to be or not....
    Fixed multiple missing includes that UBT was hiding.
    Updated openVR tracked device properties to openvr .16
    Am now turning off physics simulation locally on all clients on Socketing operations to cover some edge cases / packet miss issues.
    The attachment grip type now calls attach on all clients to cover some edge cases / packet miss issues.
    Moved the NavMoveCompleted event into BaseMovementComponent so that SimpleCharacters can trigger it as well.
    Added teleporting flag to the "Exit Seated Mode" event so that the pawn teleports physics bodies (can't throw things in the way around)
    Seated mode now replicates and throws the OnSeatedModeChanged event to ALL players, not just the server and owning client.
    This allows you to react to it locally on simulated proxies as well.
    No longer using Epics TimeTick in phys_walking, this causes errors when the framerate gets really high (like when oculus rift is removed
    and the rendering is paused). This actually appears to be a potential bug in general with the root motion addition that I was basing my
    original implementation on.
    Changed the gesture components material that you can set for spline drawing to be a material interface instead of a UMaterial *.
    This way you can pass in material instances.
    Added in a bool to ignore gesture scaling for specific gestures, Also the ability to save gestures without autoscaling them to the database.
    Merged in a client authed movement mode fix that Epic added.
    Fixed multiple replication issues with grip scripts and net relevancy, they should be solid now.
    Removed dropping a grip if killing the motion controller and we are not the grip authority.
    Added a flag to grip scripts that allows the user to notify the gripping controller that it should drop the object as soon as possible.
    It is not safe to directly drop inside of a grip script due to some memory management that the engine is doing when passing back into
    Added bIsForTeleport to grip scripts GetWorldTransform variables, useful to know on the grip end.
    Added BlueprintType to the base grip script class so that they can be directly referenced in BP.
    Fixed multiple bugs in the new Interactible Settings grip script.
    Added UAISense_Sight_VR, a drop in replacement for UAISense_Sight that offsets to a VR characters HMD location.
    4.19 and 4.20 changes (got back ported to 4.19)
    Simplified and improved the HybridWithSweep grip type.
    It should now performs less operations while also being of a higher quality.
    Allow gripping static mobility objects if the grip type is custom..why not
    Corrected a bad commit on the dial component that was causing some incorrect rotations.
    Moved SetHeld being called when an object is dropped to before OnGripReleased
    is called.
    Also moved it before OnSecondaryRelease is called
    Also moved the call to the objects own OnRelease to before its parent
    OnChildGripReleased as it makes sense that the object performs actions on
    itself first.
    This brings the flow of execution for dropping to parity with how it is done on grip.
    4.20 only
    Added GripStruct input Add/Remove Secondary Attachment point functions
    Many many optimizations and clean ups regarding the gripping and dropping functions, lowering code bloat.
    Added GripID as an input to DropObject and DropObjectByInterface, if the passed in object is
    empty it will attempt to use the grip ID to drop instead.
    I also added INVALID_VRGRIP_ID = 0 define for code use and locked out index 0 from being
    used as a grip id, this lowers the total number of possible simultanious grips per hand from 127 to 126.
    Exposed the GripMotionControllers DefaultGripScript pointer to blueprints so
    that people can access it and set variables on it (if it is a blueprint base script that is).
    Also Changed the default and gun tools grip scripts so that the pivot point is attained
    from the ParentTransform instead of getting the controller location again. This is not
    only slightly faster, but it also allows people to override the parent transform with something
    else (say a remote component) so that the grip doesn't have to be based on the controller
    (force/remote grips for instance could provide a proxy components transform instead)
    Took a byte out of the positional replication for controllers and camera
    by making the logical assumption that 419.43 meters is a size big enough for any
    current roomscale technology.
    THEN Took back 1 of the 8 bits that I saved everyone in order to add a
    flag for quantization of the rotation on controllers / cameras.
    You can now set it from its default Short quantization to a 10 bit per axis
    quantization method, effectivly saving 2.5 bytes per rep and with 4x the granularity
    of the engine BYTE rotator quantization.
    This makes up for the lack of precision on the BYTE method but still allows for some
    decent savings.
    Also dropped a byte out of the CustomVRInputVector and RequestedVelocityVector.
    41,943.04 UU's should be MORE than enough leg room for these values.
    Also am now rounding MoveAction_Custom vector values to 2 digit precision. I was
    already doing this for all built in movement actions but the custom ones should
    also be restricted like this.
    Added GripScripts fully into the master branch with four reference c++ implementations
    GS_Default (default gripping logic)
    GS_LerpToHand (lerp initial grips to the hand)
    GS_InteractibleSettings (Functions like the removed InteractibleSettings options)
    GS_GunTools ( Currently unfinished set of tools for advanced gun interactions)
    Removed rollback on custom movement modes
    This is to remove "climbing mode" hanging in place and seated mode issues.
    Really only an issue in really high packet loss situations, but wanted to cover it.
    Also added a GetReplicatedMovementMode function that returns the current Conjoined movement
    Set OnClimbingSteppedUp to a BlueprintNativeEvent so that c++ users could use it.
    Set GetOpenVRModelAndTexture node to not fail out if a texture is missing and to just pass out a nullptr now.
    It was failing on Knuckles Left controllers as they are missing a texure in full model mode from the OpenVR
    RenderModels api.
    Corrected an oversight with the new OnDropped event on the motion controllers having a possibly stale variable (thanks SlimeQ)
    GripScripts mostly final form has been added to 4.20 GripScripts Dev branches in
    both repositories. They need some testing and to be put through their paces prior
    to merging into the master branches.
    Initial knuckles porting and profile setup - (not public for awhile)
    Skipping some calls to slightly speed up nav agent retrieval
    Adding OnFinishedLerping events to the slider and lever
    Also enabling throwing slider progress events during lerping by default
    Added dial lerping, lerping speed, Finished lerping event
    Also added SetDialAngle function
    Corrected the HMD offset for the dynamic navigation mesh generation with
    a VRRootComponent.
    Correcting an oversight where a grip could not simulate on client side
    if replicate movement was never on the object.
    Also if a child component is supposed to simulate on drop, we need to also set it clientside
    if the component is not the root component, non root components do not replicate simulation
    state by default so in that case the client also calls it now.
    Defaulting welding to true for plugin attachment operations, didn't realize that the
    default setting is inverse between c++ and BP.
    Fixing socketing by adding a one tick delay after the socket and re-applying
    the relative transform. This is only done if both the parent and the child are simulating
    and is only there to avoid a race condition with the physics thread where the
    original grip constraint can reset the transform out of order prior to destruction.
    switched sweep detection on grips to component multi instead of sweep single.
    That function automatically accounts for the pivot offset / collision local pose.
    Worked around a physics replication issue that
    Epic introduced in 4.20, physics replication period is acting kind of badly now. They moved to
    a different (more efficient) system of handling the simulating position replication that
    they ported from Fortnite, however it has some little issues like not ending a targeted
    physics frame position setting when replication is turned on/off / when simulated or
    Updated openVR property strings
    Full removal of the Interactible Settings from the plugin.
    BP grippables using them will need to be revised to use sliders or custom grips instead.
    Base framework for GripScripts created, not live yet though.
    Changed all Expansion classes to use Generated_Body and not Generated_UClass_Body
    This was past due.
    Added VRPlayerStart actor which retains the foot = floor level for spawning and doesn't require Z adjustments.
    Added OnGripOutOfRange delegate to the motion controllers.
    If this event is bound to then the motion controller will no longer auto
    drop the grip if it goes out of its drop range and will fire this event instead
    to let the user control it.
    If not bound to, then the normal auto drop logic runs.
    This event is called on all connections, so if you intend to drop it, you should
    filter behind a "HasGripAuthority()" check first.
    Fixed several things to allow nativization of the plugin now that an engine bug has been fixed.
    Fixed network character smoothing, no longer runs when rotation is happening, should be stable. Still defaulted to off for now.
    Ignore NoRep grips replicating down from the server.
    This is to avoid having to make another list and fixes a bug with them and the server.
    Cleaned up swimming movement mode for VR, it should be fully functional
    It likely "worked" before, but now it accounts for things it needs too.
     Adding a high precision replication option for Quantized Transforms  
     When enabled the FTransform_NetQuantize that the plugin uses no longer quantizes at all.  
     Don't use is for very special cases and will crash clients if the  
     value differs. I didn't want it to impact standard usage of the plugin.  
    Generally you should try and keep your precision to 2 decimal places as that is  
     the engines default for multiplayer.  However I have a specific user that requires full precision as he is working with 10,000th
    scaled objects in multiplayer.  
    I repeat, don't use this feature unless you have a specific need for it.    
    Corrected the network smoothing setup, no longer runs smoothing on ticks that include rotation, also delays the movement of the root
    comp during smoothing steps to avoid an extra positional update. Smoothing should be functional and usable again with the
    VRCharacter, however it is still defaulted to off.  
    Converted the GestureTrackingComponent to use a timer for updates, it made a lot of sense to move it over to that instead.
    It no longer ticks.  
    Added momentum retention to the slider component.  
    Added Restitution to the slider and lever components (when momentum retention is on they can bounceback from their endpoints).  
    Removed the max limits on the Lever and Slider components MaxMomentum property, there isn't really a reason for me to
    enforce a value here.  
    Added a check for in Editor drawing of the player capsule so that it correctly offsets upwards in preview, this is because
    I run the capsule location at bottom == actor zero compared to engine default of center == actor zero.
    Offsetting it upwards shows the  correct preview window for component layout.
    Added bSkipEncroachmentCheck to the PerformMoveAction_Teleport function
    Fixed some string property sizes in the OpenVRExpansionFunctionLibrary
    Added OnPlayerStateReplicated bindable event to the VRCharacters, will fire off when the
    player state has replicated over (every time it is changed, if you only want it once
    then unbind after it is done). Useful for initial player set up on clients.
    Corrected a fatal crash issue with how Epic is currently checking motion controllers
    for IsLocallyOwned.
    Fixed SecondaryGripTypes with the Retain option being broken in some situations when
    using client authoritive grips.
    Now only setting simulating server side on drop of a non client authority grip to avoid
    a replication race condition.
    Improved the network overhead of client authoritive grips by replacing some of the
    RPC properties with GripIDs now that GripIDs are standard. Also am now using a seperate
    drop function for client auth grips instead of re-using the modification one to save
    on replication cost.
    Moved the SetIsHeld call to before calling OnGrip so that there is a valid IsHeld during
    operations in that event.
    Added bSetOwnerOnGrip to AdvancedGripSettings, when true (default) gripping an actor
    will automatically set its owner to the motion controllers owner (if it is a pawn).
    (does not apply to component grips)
    On grip release it DOES NOT RESET OWNER, keep this in mind
    Added bAllowIgnoringAttachOnOwner to all Grippable *actor* types, when true (default)
    the actor will ignore replicated attachment sends when the grippables GripMovementType
    is set to Client_Authority or Client_Authority_NoRep, this is to prevent the replication
    from interfering with client side control of attachment in these modes.
    Overrode OnRep_ReplicateMovement to bypass them not setting the simulated state
    if the movement replication had been off for awhile and the state had toggled in the meantime.
    Added DropAndSocketGrip/Object functions to the grip controllers. This dedicated function
    will drop a grip and attach it to the passed in scene component with the transform / socket
    that was given.
    Added bool bWasSocketed to the OnGripRelease and OnChildGripRelease events in the GripInterface.
    When true the grip was dropped with a socketing function.
    Added RequestsSocketing function to the interface, allows querying if the object wants to be socketed.
    (On release / general queries), by default has no functionality, override it to return a value.
    Adding in bOffsetByControllerProfile to the motion controller.
    If true, it will offset the controllers by the currently loaded profiles
    Throws the event OnControllerProfileTransformChanged to the controllers
    so that things like procedural meshes can be offset to account for it (proc
    meshes load already aligned to the controller type, so they need to be adjusted).
    This makes it far easier to add and use controller profiles, besides  the procedural
    mesh re-alignment (which most don't use anyway) it will be fairly seamless.
    The example template has example profiles now and implementations of all of this.
    (also thanks to SlimeQ for the idea, I had doubts due to having to think about what special cases would need to be handled, but it was fairly straight forward.)
    Added a GetControllerDeviceID node to the grip controller
    Lets you get the XRsystem device id for the calling controller which is far easier than trying to match up ID lists to the specific controller.
    Added a master check for windowsMR to the SteamHMDType node.
    At some point need to branch it out to return each seperate HMD in MR
    Added grip re-creation case for if the advanced physics settings were turned off
    Added a config variable  / console variable for the rotation correction threshold with the new rotation rollback pathway.
    vre.RotationCorrectionThreshold (default 0.02f)
    SetGripConstraintStiffNessAndDamping was setting the handle via the passed in grip struct  
    and not the modified original, corrected this.  
    Also changed order of operations so that IsHeld is set prior to EventOnGrip and  
    NotifyGrip is called with the added grip information passed in so that OnGrips  
    that modify the grip information work correctly.
    Changed up how bIscolliding is handled for grips, doing a full single sweep now from
    start to finish of the planned movement.
    Think I used to do this and switched to overlaps, but overlaps are suffering from precision
    issues and causing late update stutters.
    This fixes some visual glitches with the late update settings of NotWhenColliding and NotWhenDoubleGrippingOrColliding
     Removing bNetLoadOnClient = false from defaults of grippable actor classes.  
     Leaving it as engine default instead.  
     My bad, this shouldn't have been reset, people may want to check their settings after this.
     Changed SecondaryRelativeLocation into SecondaryRelativeTransform, this is to allow for more complex secondary grips
    in the future and things like forehand tracking during a grip.  
    Converted physics grips to use the same pathway regardless of type (no longer a seperate logic branch for manipulation grips,
    now they just use different defualts).  
    Removed the bDoNotSetCOM option from the advanced physics settings.  
    Replaced it with an enum with a bunch of seperate options that also now apply to the manipulation grip.
    These extra options are in the AdvancedPhysics section of the grip settings.  
    /* Use the default setting for the specified grip type */
    COM_Default = 0,
    /* Don't grip at center of mass (generally unstable as it grips at actor zero)*/
    COM_AtPivot = 1,
    /* Set center of mass to grip location and grip there (default for interactible with physics) */
    COM_SetAndGripAt = 2,
    /* Grip at center of mass but do not set it */
    COM_GripAt = 3,
    /* Just grip at the controller location, but don't set COM (default for manipulation grips)*/
    COM_GripAtControllerLoc = 4  
    These allow for more complete physics control of held objects, as well as makes it easier to have multiple physics grips
    on a single object (future patch is going to give IsHeld an array of controllers instead of returning a single one).  
    This has the side effect of slightly lowering memory (1 transform) and slightly lowering CPU costs of physics grips
    (less transform logic and checks) as well as greatly improving the flexibility of the physics grips.  
    Added grippable actors to the grippables prefabs. Lets you change out the root component at will to use skeletal or
    static mesh components. This is useful for making a base class and changing out the type of root component further down.
    It was always possible to do in BP, but this makes it easier by pre-defining it.  
    I suggest using the plugins OptionalRep(Static/Skeletal)MeshComponents as the roots as they implement the optional
    movement replication and you will be missing the StaticMeshComponentReplicatesMovement option that StaticMeshActor adds in.  
    Adding log message warning of interactible setting deprecation when trying to grip an object using it
    Think 4.20 is the patch that I finally remove this capability and force interactibles
    and custom grips instead.
    Added events that are thrown on the motion controllers for when an object is
    gripped and dropped. This is useful for feedback like hand attachment and
    hiding or specific operations based on what was gripped. (ported back to 4.18 as well)
    Renamed DenyGripping interface event to "IsDenyingGrips" for blueprints.
    Having the node show up as a callable node was not considered when it was originally added.
    The function name remains the same so C++ should require no changes.
     Fixing Center of mass with scaled root bones and scaled meshes  
     Also now using the full root bone transform instead of just rotation for correction.  
    (This fixes cases where weirdly scaled / transformed root bones were screwing up physics grips).    
     Using the actual body instances rotation for the center of mass calc now instead of the
     calculated world transform one (in case they differ).  
     Added cvar to turn on COM visualization for grips  
     Split grip IDs between local and remote for clients    
    Client local grips run 128 - 255   Client remote grips run 0-127    
    This lets me use the same variable but not overlap IDs across client controlled local grips
    and server controlled remote grips.    
    Server doesn't care and uses full scale between them as it is authority for both local and
    remote grips for its own pawn.    
    Grip IDs are local to the motion controller they are being used for, there can be ID overlap
    across motion controllers (to keep replication costs down).      
    Made the button components IsValidOverlap function blueprint overridable so people can allow
    set objects to toggle buttons instead of just things attached to / held by the motion controllers.  
    Fixed a bug with button overlap filtering that wasn't allowing some held grippables through for overlapping.    
    Added a bSkipOverlapFiltering option to the button component that skips all
    filtering and just lets collision channels handle what can toggle the button.
     Adding Ids to the grip structure, need to expand on their use it *was* possible to drop the wrong grip
    if it is replacing one that had the same object.
    Should also start limiting how fast someone can grip/drop something      
    Hashing the ID was overkill, incrementing a uint8 now, which should be fine as I can't see anyone going
    over 256 concurrent grips per hand (if they do...well they will have to make it a uint16).    
    Also set the drop to pause a grip instead of removing it from the array, which rarely caused some corruption.
    This lets normal replication remove it from the array instead.    
    Also now searching for other grips with the same object in both arrays, if one is found then it skips some
    of the init dropping functions that would screw with the other grip (this shouldn't happen but who knows...)      
    Adds new GetGripByID node, this is safer than GetGripByObject if you are referencing a grip already.
    Merged with LeverRepTest beta branch, should enable proper replication of initial lever RelativeTransform to clients.
    Needs some more testing but will be ported to other interactibles once proven solid.
    Post teleport move now uses the new setting for motion controllers that delays the teleport until the next grip tick.
    This ensures that the teleport uses the correct final transform and is post all character movements.
    Per bone gripping constraint distance for auto dropping made to be off of the bones specific location,
    not the root bones location. This was missed when adding per bone gripping, could cause grips very far from the root
    bone to auto drop if per bone gripping was enabled.
    Exposed the physics constraint creation / movement / destruction to BP for custom
    grips to make use of.
    Took a pass over the capsule height replication, had to fix it for simulated clients Also wanted to clean it up and its use.
    Moved the VRReplicateCapsuleHeight boolean to the character instead of the movement component as it makes more sense there.
    Use SetCharacterHalfHeightVR() node to properly set capsule height for replication.
    If you only need two states, crouch and standing, its better to still use the Crouch commands as they are more efficient
     Fixing another bug introduced with the new rotation correction system  
     (this was kind of unrelated, forgot to replicate a value with teleport).
    Whoops, was using wrong logic for the new snap turn introduced in the last patch.
    Fixed and added a new option to SetActorRotationVR while I was at it.
    Also removing a capsule offset override that was preventing clean projects from
    getting the 2.15 UU offset for the capsule to correct for the movement components
    Overrode default engine rollback / client correction code to now pass and verify a rotation
    instead of directly accepting the clients rotation every movement.
    This allows me to rollback rotations and correct for packet loss with rotation based movements.
    Something that is not very important in FPS games because rotation is at the zero point but
    which is fairly important in offset HMD VR games as any minor rotation offset can cause pretty hefty
    locational offsets.
    Added bUseClientControlRotation to VRCharacterMovementComponent, this allows the movement
    component to use the legacy behavior of not rolling back rotations (FPS test pawns).
    These changes are for the VRCharacter only, the SimpleVRcharacter does not need these
    modifications to function. They also need some testing, vehicles specifically could use some testing.
    Added MoveAction_SetRotation (For just changing the rotation) and changed the snap turn and teleport
    move actions to pass in the end yaw and simulate the movement instead of taking just a location offset.
    Added make and conversion nodes for FVector_Netquantize and its variants...since the engine is missing this.
    Fixing some values not setting (replicating) after converting the movement action
    system to an array of actions.
     Finished Lever momentum system    Now essentially works like a door if you want it to. (Set lerp mode to RetainMomentum)    Also fixed a bug with ticking, and changed it so that lerping works off of the   full precision of the rotation and not off of the public and (rounded to closest   int) CurrentLeverAngle.    Includes "LeverMomentumFriction" to set the ramp down on the velocity, and   "LeverMaxMomentum" to limit max speed. Also has "FramesToAverage" which sets   a frame duration that it will RollingLowPassAverage the momentum across, this   lets you avoid the "waggle" effect of quickly gripping and flinging it to maximum   velocity.
     Fixed up inlines in the Motion Controller (PS4 support fixes). May  
     slightly decrease speed of the grip updates, but it is literally only two  
     non virtual function calls worth of difference so it is negligible.  
     Added bIsPaused to the grip structure and a SetGripPaused node to the motion controller.  
     Is not replicated by default (on purpose) as I felt that it is generally more useful  
     when additional data is passed through with it (snap location, ect.).    
     Added SetPausedTransform node to set the location of a paused grip (including a physics constraint if it is left on).  
     Expanded on SetGripPaused with additional options.
    Fixed a crash Epic introduced with their new OnControllerUpdated event, they were calling it in the
    render thread as well causing a crash. This will effect all default motion controllers, need to report it.
    Also converted the motion controller tracking source to use the setter so that the Mixed Reality
    plugin is initialized correctly.
    Adding bSupports depth back to stereo layer widgets
    Added override for the grippable static mesh actor to allow turning off relative location
    repping on its root component.
    This lets you set the root component to replicates (fixes some issues with how they replicate
    attachment and the like) while avoiding the extra overhead of also replicating its relative locations.
    Also left the new component in so people can use it for their own uses (non grippable static mesh
    component overrides with movement rep off optional, ect).
    Setting sub component replicate movement to true by default for grippable actors.
    Added movement replication controllable component to the skeletal mesh actor as well.
    Fixing a problem with my floor offset for PhysFalling where it could slow down
    the ending floor detection when transitioning to walking.
    Now I am checking for a valid landing spot when the floor find is within that
    offset as well.
    Fixed movement base being set for climbing movement mode (grabbing on to something while on a moving platform could
    have you still follow the thing you are standing on, no longer happens).
    Updated stereo widget component a bit, problems in UE4 with orientation with stereo layers for steam
    are prevelent, unsure how to fix, pretty sure Epic is incorrectly converting the rotation from
    ue4 FTransform to OpenVR Matrix. May find the fault and submit a bug report some time.
    Set stereo widget to tick during physics (post movements) so that the player movement doesn't apply a
    visual stutter to it. Will transition entirely over to Epics world locked when it eventually works correctly...
    Added prelim slider snapping implementation
    Slider now auto sets parent if the parent attachment is a spline
    Slider also now has a "SetSliderProgress" node that will set the progress to whatever
    you pass in to it 0.0 - 1.0
    Simplified the spline following and made it follow scale "more" correctly than before.
    Added GetIKMesh function to VRBaseCharacter, lets us use epics new optimization during
    move combining with skeletal meshes.
    Entirely optional, but if there is an IK mesh, it would be best to override the function and
    pass in your IK mesh.
    Cleaned up teleport, moved the teleport grips to the TickGrip instead so we use the final transform.
    This also prevents multiple calls from breaking it and forces it to come in after all move actions and movement
    is performed.
    Added support for movement actions to be queued up with multiple in a frame instead of limited
    to 1. There is no longer a limitation on them.
    Changed it so that ClientSide_Authoritive grips pass up the objects velocities on release.
    They were not doing so before so throwing behavior could feel off.
    Added bRunControlRotationInMovementComponent If true will run the control rotation in the CMC instead of in the player controller
    This puts the player rotation into the scoped movement (perf savings) and also ensures it is properly rotated prior to movement.
    This is the prefeered setting currently, someday I may remove control rotation entirely from the movement system to fix a bunch
    of issues, but for now this helps.
    Added scoped movement to many more sections of the character, significantly saving perf (over and above default engine characters even).
    General 4.18-4.19 Changes  
     Corrected imprecision issue with inverse transforming of the interactibles I use the inverse of the grip transform to get the hands original location relative to the object on grip for the interactible calculations. I was getting precision errors when getting FTransform::Inverse if the interactible was unevenly scaled on any axis. Converting to a FMatrix, then inversing, then back to FTransform removed this precision issue. I am still uncertain why FTransform::Inverse was misbehaving in this situation.  Added some events to the SliderInteractible (OnHitEnd)  Started working on bEnforceSplineLinearity to keep a slider in line on a spline (Unfinished needs work).  Added bLerpAlongSpline to slider to smooth out the movement.  Added grip prio to all interactibles  Fixed teleport move grip node (one of the variables was output instead of input)  Added Re-calculate lever angle function to lever  Also made the ResetLever function re-calculate the angle as well.  Set character default rotation replication values to shorts  Changed how controllers copy a replicated relative grip from a deep copy to a shallow one. This is to avoid overriding important local only variables.
    4.19 Only Changes  
     Blueprint cleanup with pure/callable node choices, some nodes were returning multiple variables making it more likely that people would abuse them and multiple call them as pure, converted these to callable.  OpenVRExpansionLibrary added "GetOpenVRHmdType" node that breaks down to the specific headset connected in OpenVR. This is due to the module reporting as SteamVR type always. I will need to manually added headsets in here as new ones come out, its a shortcut service for my users.  Greatly reduced the characters CPU load when updating to the physics thread, removed one ticked update that I had caused and three that Epic had caused that were extra.  Moved the application of the Input data to the control rotation to the character movement component. This is so that I can have correct rotations prior to moving the character. Typical engine behavior is to have the rotation done in the player controller AFTER all movement is applied, this can cause issues due to our offset movements.  Converted the OpenVRExpansionLibrary device oriented nodes entirely over to index's and added some Getter nodes for type / specific devices. This brings my node library directly in line to being compatible with epics one as well as clears room for vive pro and devices where trackers and the like are activated out of normal order.  Changed bIgnoreSimulatingComponents to just ignore PhysicsBody channel objects for the floor check so I could avoid the multi sweep I was doing (slower) before. If you intend to use this functionality instead of just removing collision then be aware that the objects need to be on the PhysicsBody channel now.
    Added Controller profiles to the plugin.
    See Post: Controller Profiles
    Accepted Space Harry's VRMountComponent pull request (A turret like interactible component)
    Fixed VR Lever not responding when max of an axis is 0.0f
    Corrected a replication issue with client authoritive grips where
    since I don't replicate some variables when the secondary grip is being sent as removed
    the server would lerp incorrectly back to base position.
    Improved the Parent Relative attachments behavior when lerping with yaw tolerance
    Changed the additive transform for grips so that it applies seperately from the secondary grip rotation.
    This stops the addition rotation from being overidden by a secondary grip.
    Added new VRGestureComponent - allows you to record and detect gestures, also has some utility functions for  drawing and managing them.  Added GestureDatabase DataAsset to store gestures.
    Merged in the upcoming 4.19 movement replication changes.
    It simplifies and speeds up the movement system as well as moves the RPCS into the character itself to save on some bandwidth.
    Changed charactermovements default for MaxAcel and BrakingDeaccel to very high values.
    This effectively makes characters use no acceleration and de-acceleration when moving.
    I had this in BP before but it really should be defaulted like this in code so that people making new characters don't leave
    acceleration on with the characters.
    Re-setting these values back to 2048.f engine defaults will restore normal engine operation for them.
    Added per bone gripping to the physics grip styles.
    Using these correctly requires passing in the bone name and USING THE BONES WORLD TRANSFORM NOT THE ACTOR/COMPONENTS.
    If you do not pass in a bone name to the gripping function then it won't know what bone to grip at and will just grip it like a
    normal component.
    Also if you don't use the bones world transform then it will not be correctly positioned during gripping.
    Per bone gripping is only enabled for physics grips for obvious reasons.
    I left in the old hacked method of applying the root bone rotation when a bone name isn't given to keep backwards compatibility.
    Incomplete List Of Example Template Features
    Interactive examples of doors, drawers, levers, buttons, dials.
    Climbing system implemented for preview using custom climbing / movement mode.
    Multiple locomotion examples including: Sliding with head/controller orientation, Running In place, Armswing, Teleport, Navigation, OutOfBody Navigation, Climbing. All multiplayer compatible.
    Example of setting up the grip system in a generic way using the VRGrip Interface and Gameplay Tags so that adding new VR Interactibles is as easy as drag/drop and editing settings.
    Basic server browser example using 3d Widgets.
    Incomplete List Of Plugin Features
    Built-In Multiplayer support with custom replicating controllers / cameras / grips and the full replication capabilities of the engines base character
    Physics based grips that interact with the environment and do not clip through objects, as well as manipulation grips to interact with physics levers, doors, ect
    Climbing/Custom movement mode fully replicated with normal movement in engine, could be used for more than climbing (zip lines, directed movement, anything you can think of).
    2 Different base Character classes, VRCharacter for full bore total VR re-write of a character, and SimpleVRCharacter for a stable simple overhaul.
    Full world collision by default, follows collision channels in engine like normal, in the VRCharacter there is also the bWalkingCollisionOverride that is
    settable in order to allow free walking through objects but collision during artificial locomotion.
    AI Controller that can be applied to AI to correctly target VR characters.
    4 different network grip replication types from fully client side, to client side server authoritative to server sided only.
    Waist / Body approximation component so you can easily create inventories and bodies.
    Vive tracker support for waist / objects with late updates.
    9 Different grip types each with its own uses.
    Secondary grip support (two handed interactions) with optional lerp in / out and scaling.
    Full late update control with 5 different settings for when late updates are applied.
    VRGrip Interface - Interface with many callbacks to provide grip information, nativley supported in the plugin.
    VRGrippableObjects - Most relevant actors and components, pre-overriden in c++ with the grip interface, gameplay tags interface, and
    a structure to hold VRGripInterface options in them. Drop into the scene, set some booleans and enums, and play in VR.
    VRExpansionFunctionLibrary - Many many useful functions for VR, too many to list here
    Stereo widget support for UMG menus in stereo layers
    VR Log component for rendering Outputlog and console to textures for use in VR
    Gesture system for recording, saving, detecting and drawing / rendering gestures.
    Open VR Features (seperate module that can be turned off)
    SteamVRKeyboard support
    HMD Camera access and render to texture support.
    OpenVR Render models / custom skins support.
    OpenVR device property support
    OpenVR function library - Too many functions to list here
    Last edited by mordentral; 03-21-2019, 03:30 PM.

    Consider supporting me on patreon

    My Open source tools and plugins
    Advanced Sessions Plugin
    VR Expansion Plugin

    Fantastic! That replication is going to make life so much easier for me.
    Gonna have to download it and give it a try!


      Awesome work, this looks great!

      [MENTION=4285]mordentral[/MENTION] - If I wanted to use Mitch's template for the pickup system, do you think I'd be able to just replace the Attach calls with your Grip function (e.g., would replication still work there?)? I found the system in the SteamVR template that uses the GripMC to be a little cryptic in terms of being able to easily extend it and implement different sorts of items.


      As an aside, I still think it would be beneficial to change how the Lock to HMD functionality works so that it would move the *actor* itself, rather than just components attached to the camera. I looked into it and it seems like that could be done by just recalculating the camera's matrix relative to the new actor matrix and then setting it on the actor where it currently does the component-move.

      I still think only moving the components could eventually cause gameplay problems (especially in cases of larger levels, multiplayer etc.), and have seen a few posts to that effect.
      Last edited by n00854180t; 07-12-2016, 06:56 PM.
      Storyteller - An immersive VR audiobook player

      Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes


        Originally posted by n00854180t View Post
        Awesome work, this looks great!

        [MENTION=4285]mordentral[/MENTION] - If I wanted to use Mitch's template for the pickup system, do you think I'd be able to just replace the Attach calls with your Grip function (e.g., would replication still work there?)? I found the system in the SteamVR template that uses the GripMC to be a little cryptic in terms of being able to easily extend it and implement different sorts of items.
        Yeah it shouldn't be a problem, you'd have to keep in mind that Mitch's examples use attached simulating components with max Damping to keep them relative to the controller (if interactive), this plugin uses the sweeping functions to move items manually relative to the controller instead (and sends their components to the late update function). So there would have to be "some" changes, the plugin forces simulation off when gripping an actor so a bunch of nodes could / should be skipped from his example if using the grip function. I was considering implementing AttachTo as well as an option but after playing with it I didn't like how it worked so I scrapped my plans to support it.

        In my demo project I run all of the "Character has this in his left/right hand, drop this if he picks up that, ect ect" logic in BP and just call Grip/Drop in the plugin on what I decided to do from the server. It is game logic agnostic and just handles holding and dropping and triggering OnHit events.

        The steamVR template is very WIP and I get the idea that proteus is lacking in free time at the moment. The basics of gripping an object with my plugin is fairly simple, there is a write up on the motion controller wiki page with the basics and some best practices. I would have used Epics "World/Relative/Snap" enum like in attachment but passing in actual transforms has more total flexibility.


        *Note* Attachment is already replicated by default in the engine, when you attach a component it turns off replicating movement from the server and the clients handle it from then on out (until detached). That is one of the reasons why it doesn't sweep hit events on attached actors. You don't actually have to use the grip functions at all if you don't want to, they are just my preferred way of doing it.

        I may add back in having the server manually sweep actors attached to the controllers so that OnHit events still trigger, it was originally something I had it doing but removed it when I went over to only using the grip functions.

        Originally posted by n00854180t View Post
        As an aside, I still think it would be beneficial to change how the Lock to HMD functionality works so that it would move the *actor* itself, rather than just components attached to the camera. I looked into it and it seems like that could be done by just recalculating the camera's matrix relative to the new actor matrix and then setting it on the actor where it currently does the component-move.

        I still think only moving the components could eventually cause gameplay problems (especially in cases of larger levels, multiplayer etc.), and have seen a few posts to that effect.
        It wouldn't be that difficult to create a custom pawn that samples the HMD position instead of the camera and offsets its location by the difference from the last sample point.

        The thing is that OpenVR returns the HMD location in relative space to the tracking volume you have set up so using the camera in relative space to the chaperone in the engine is a very clean solution to it as the pawn can act as the tracking space (that you move with teleport / other movement inputs) and the components as the relative location within that tracking space, you are essentially moving around the tracking volume with you.

        Do you have any quotes/links about the concerns? As I said it wouldn't be hard to implement I just don't see the point in doing so, but I would like to read about any issues that the current method presents as if they are significant enough I would have to reconsider LockToHMD. I haven't been able to think of anything that would be a problem for me so far and also haven't run into any issues with the default setup. You aren't moving component farther from the pawn itself than the size of the tracking volume in the default setup.
        Last edited by mordentral; 07-12-2016, 09:45 PM.

        Consider supporting me on patreon

        My Open source tools and plugins
        Advanced Sessions Plugin
        VR Expansion Plugin


          Originally posted by lambomang View Post
          Fantastic! That replication is going to make life so much easier for me.
          Gonna have to download it and give it a try!
          I'm looking into smoothing replication at lower update rates by the way. I'll need to test of bunch of different rates and try some lerp/prediction tests to see what feels best and where it actually becomes a problem first. The default 100htz (matching pawn default) rate didn't need any smoothing that I could see so I left it out to get it out the door but I could see needing to add it in for 30htz or so (though it is only a per client network load and isn't that heavy).

          Consider supporting me on patreon

          My Open source tools and plugins
          Advanced Sessions Plugin
          VR Expansion Plugin


            Hey Mordentral. Thanks for putting in the effort to make this awesome plugin! It really helps with jumping straight into VR and building stuff. I've been using your VRGrip plugin for about a month now. It helped a lot, but I have run into some issues.

            Migrating to VR Expansion Plugin
            I'm interested in migrating from your old plugin to this one, but I'm seeing some issues trying to rip out the old one and replace it with this one. I wonder if there's something simple I'm missing. Depending on how many people used your other plugin, it might be helpful to add a How-To to the readme.

            Collision Event Bug.
            I have a SphereCollision component parented under the grip controller. I'm using the begin/end overlap events on this collision to determine which object I can pick up. I'm noticing that when the grip controller is holding an object then BOTH overlap begin and end events are triggered on every tick. The events are only triggered on the colliders close to the object, but they are triggered on every tick regardless of which controller is holding the object. That is to say, if I hold an object in my right hand, then my right collider is triggered on every tick. Then if I bring my left hand close enough to my right hand, that collider is also being triggered on ever tick - even though the right hand is holding the object.

            This rapid-fire of begin/end overlap events is causing incorrect results when I poll which objects I can pickup. If I had to guess, I'd say something about the way the plugin is updating the gripped object position is causing collision events to freak out. I noticed the wiki suggests that I use a sphere trace instead of overlap events - probably for this reason. I'll use the sphere trace for now, but performing a sphere trace every tick is probably more expensive than using overlap events.

            Better Physics Behavior
            Have you read Nick Abel's article and TomorrowTodayLabs' followup on how they solved physics-based object movement in unity? It's a really interesting read, and they put their work up as a plugin for Unity called NewtonVR. Here's a sweet video from the article of the final interaction they achieved:

            Obviously their solution won't be ideal for everyone, but I do think they address a number of areas that the sweep-to method falls short in. Namely...

            Objects get caught on floor easily.

            You can't pick up objects with another object on top.

            You can't push/pull objects, and objects have no mass.

            What do you think about trying to port some of their ideas to UE4?


              Originally posted by AssumptionSoup View Post
              Hey Mordentral.

              Being a new plugin the classes technically are considered separate from their old versions, you actually have to place them back into the pawn and re-place their functions. I decided to rename it as the old name no longer suited the project but this is a sad consequence being a one time hit of placing the nodes again.

              Overlap Triggering
              I set move ignore to the controller when gripping an object, it is possible that overlap is triggering anyway as the current movement is swept location. You can either not use overlaps or set it to ignore the channel you place the overlap on after gripping (I have a special collision channel for traces / overlaps). I also don't call traces every frame, I call it on button press, but if you are looking to highlight objects to pick up I see your point. But you can always run traces on a timer set to 30-60 htz for highlighting and call the trace on button press for the actual pick up (my voxel project does this for block highlights).

              Push / Pull
              Yes you actually can, the object has to be simulating though for it to move it, i'll agree that the interaction is less than steller currently and I am going to provide a better option for real physics. The current grip is intended just for when you don't need full physics solving on the gripped object itself as it will be cheaper. It was also the fastest one out of the gate to implement so I could look at other things.

              New Grip Styles
              I fully intend to make a better grip option using physics, I originally had AttachTo set up and ran into it not being up to what I wanted from it and removed it from the grip function. Unity's solution is effectually what I am currently doing with location but done through the physics system instead so it actually slots right in. It is next on my Trello list actually to look into it now that I have decided to throw away AttachTo (spent my free time in the last day mulling over if AttachTo was worth it and trying it out).

              I don't like the visual drag latency in how they are doing it in Unity though and am pretty sure that there is a way around it by extending my current solution and using constraints (ripping from grab handles but forcing late updates and removing the lerp). I really like the interaction in say Hand Guns, Horseshoes, and Hand Grenades but don't like that the guns themselves lag behind hand movements visually (for actual shooting location they are correct so there is something to be said for that).

              TL;DR yes all of those things bug me as well and as a user of my own plugin I am fixing them. I'll move experiments to the side for now (was playing with movement options) and just implement the new grip option instead.

              The cool thing about the plugin is when the new grip is in you'll just have to select it from the grip style drop down and it should work.

              *Edit* Oh and I was looking into both hands on the same object interactions. Eventually both options should support that as well; but I will wayside it until the new grip is in too.
              Last edited by mordentral; 07-14-2016, 08:59 AM.

              Consider supporting me on patreon

              My Open source tools and plugins
              Advanced Sessions Plugin
              VR Expansion Plugin


                Originally posted by AssumptionSoup View Post
                Hey Mordentral.
                I actually had this done yesterday but got side tracked trying to make a hybrid system (not sure how stable I can get that one yet). It needs some going over to make sure that multiplayer works fine with the new grip style before I merge it in but I think the video is pretty much what you wanted.

                Its up to 5 grip methods now I think (6 with hybrid if it makes it), you pick what one you want per item you are picking up and how you want it to behave. When it comes out this method will have several configurable options (you probably don't notice in the video but I have the grip strength 1000x higher on my right hand than my left so it doesn't free float as much in the video).

                I'll get it pushed out to the main branch of the plugin by the end of the weekend, I was off on a tangent for awhile there experimenting with a bunch of random things (VR gets me excited) or this would have already been in.


                Consider supporting me on patreon

                My Open source tools and plugins
                Advanced Sessions Plugin
                VR Expansion Plugin


                  Being a new plugin the classes technically are considered separate from their old versions, you actually have to place them back into the pawn and re-place their functions. I decided to rename it as the old name no longer suited the project but this is a sad consequence being a one time hit of placing the nodes again.
                  Thanks for the help. As it turns out, I had to delete the original VRGrip components before deleting the plugin, or my game would crash on load. After deleting the components, it was okay if I still had any variables with the VRGrip type (they got reset to Object). Then I just had to put the new plugin in place and run around reconnecting everything (that was less fun). Next time around, I think I'll integrate the plugin with my game via C++ so it's easier to refactor things. Blueprints makes refactors surprisingly hard with it's propensity to disconnect nodes! And speaking of C++, I don't know if you intended the plugin to be using in C++ or not. I'm definitely a noob at both C++ and Unreal, but it looks like the plugin classes are missing the VREXPANSIONPLUGIN_API (macro? keyword?) in order to be exposed to game logic. I can send a pull request that adds this if you're interested.

                  Overlap Triggering
                  I set move ignore to the controller when gripping an object, it is possible that overlap is triggering anyway as the current movement is swept location. You can either not use overlaps or set it to ignore the channel you place the overlap on after gripping (I have a special collision channel for traces / overlaps). I also don't call traces every frame, I call it on button press, but if you are looking to highlight objects to pick up I see your point. But you can always run traces on a timer set to 30-60 htz for highlighting and call the trace on button press for the actual pick up (my voxel project does this for block highlights).
                  You're correct, I'm using it for highlighting. I forgot to mention that in my original post. I'll have to play around with running my traces on a slower frequency, that's a good idea! I'm a little worried that there will be a disconnect between the feedback the user sees and the action that occurs - but I won't know how bad it is without testing.

                  I don't like the visual drag latency in how they are doing it in Unity though and am pretty sure that there is a way around it by extending my current solution and using constraints (ripping from grab handles but forcing late updates and removing the lerp). I really like the interaction in say Hand Guns, Horseshoes, and Hand Grenades but don't like that the guns themselves lag behind hand movements visually (for actual shooting location they are correct so there is something to be said for that).
                  I totally agree. I think having really good physics interaction is worth the trade off of having some latency on gripped objects, but it's definitely not a compromise I'd like to make if I don't have to.

                  I actually had this done yesterday but got side tracked trying to make a hybrid system ...
                  Oh man, this looks super awesome!! Yeah, it looks like most of the things I was interested in. I can't wait!


                    Yeah I forgot the macro on the classes, I'll add it in to them today.

                    Consider supporting me on patreon

                    My Open source tools and plugins
                    Advanced Sessions Plugin
                    VR Expansion Plugin


                      Merged the physics grip branch into main, it needs more play time to lock down bugs but was working for me during initial multiplayer testing (don't forget to replicate movement on physics objects so they stay sync'd). The hybrid setup "works" but needs to be finished still.

                      InteractivePhysicsGrip is the style you were looking for, it also adds two properties to the motion controllers for Stiffness and Damping when holding physics simulating objects, I may break that out into a object by object basis later.

                      There are also a few new functions and features, i'll document them tomorrow.
                      Last edited by mordentral; 07-17-2016, 10:38 PM.

                      Consider supporting me on patreon

                      My Open source tools and plugins
                      Advanced Sessions Plugin
                      VR Expansion Plugin


                        Would any of the exposed OpenVR functions be able to return what kind of HMD is in use? Rift/Vive/OSVR. I need to change player class since the haptic events are very different on Vive vs Rift.


                          Originally posted by Fantasifall View Post
                          Would any of the exposed OpenVR functions be able to return what kind of HMD is in use? Rift/Vive/OSVR. I need to change player class since the haptic events are very different on Vive vs Rift.
                          I think someone requested of Rama to have his library include that function. It is already in GEngine so I will throw it in anyway since it makes sense and is easy, but if you don't intend to use the rest of my plugin and already use Rama's library then you should be able to find it there.

                          Regardless I'll have it in this by the end of the day (have to push out some cleanup for things anyway later).

                          *Edit* Pushed the new function early as the rest of my work today will be on a new branch

                          GetHMDType - static
                          Last edited by mordentral; 07-18-2016, 11:49 AM.

                          Consider supporting me on patreon

                          My Open source tools and plugins
                          Advanced Sessions Plugin
                          VR Expansion Plugin


                            Oh my, this Plugin couldn't have come at a better time. Literally just spent this last weekend testing my Vive game with some friends, and one of the biggest issues was the grabbing system I had made. My solution, using merely the built in blueprint functions was to turn off gravity on grabbed components. This wasn't the ideal solution but it worked for the most part. That said it seems this plugin gives far better control and I hope to implement it.

                            Could you by chance give some insight into the setup of the "New grip style" video? I've got a line trace on the controller trigger, then checking my grabbed object and then calling grip actor from your plugin, but it seems to go a bit crazy once attached. Will have a further tinker, but this does look promising. Great work!

                            Default Interactive

                            A Skip And A Hop Too Far Into Light Speed


                              Thank you so much for the HMD type! This makes my life so much easier. However, ParentRelativeAttachmentComponent does not seem to work at all. I looked at the code and it seems like it should but all that's happening is occasionally, there will be an offset of the child component of the ParentRelativeAttachmentComponent. It just sticks at an odd rotation, and keeps following the HMD rot at that offset rotation 1 to 1. I tried with both Static and Skeletal meshes, and tried yaw values between 1-3 as well as much higher, locked on pitch and roll.