VR Expansion Plugin

Pushed a new commit to the plugin


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  and switched to overlaps, but overlaps are suffering from precision
issues and causing late update stutters.

 fixes some visual glitches with the late update settings of NotWhenColliding and NotWhenDoubleGrippingOrColliding

I get one error after update your plugin. Copied from VRExpPuginExample (master branch, 05.18.2018):
\Plugins\VRExpansionPlugin\Source\VRExpansionPlugin\Private\VRCharacterMovementComponent.cpp(4409): error C3861: ‘DrawDebugCapsule’: identifier not found
VRExpPuginExample works good.
Maybe, VRExpPuginExample don’t use IWYU. (PCHUsage in Build.cs)

UE4.19, vs2017;
My fixes:

  1. #include “Kismet/KismetSystemLibrary.h”
  2. change VRCharacterMovementComponent.cpp(4409): DrawDebugCapsule to UKismetSystemLibrary :: DrawDebugCapsule
  3. change 5th parameter: FRotator::ZeroRotator, and change last parameters.

Yeah that is compiled out in shipping, and not hit during debug I missed it.

However the correct change is just “include “DrawDebugHelpers.h”” at the top of the cpp. It’s uploaded with the correction.

The rollback code change is where that debug logic is.

I’m having the same issue when trying to build the latest (f6e2876) commit of the VR Expansion Template. Does anyone have any ideas? On a clean install of Windows 7 with Visual Stuido 2017 and UE 4.19.2

Yes. Thanks for support and plugin!

Hi guys!

I have one question. How we can change on the fly the settings in AdvancedGripSettings. I trying to deactivate AdvancedGripPhysicSettings when griping the second grip, without sucess.

Only view Set BPAdvGripSettings Structure and set members in structure but don’t change anything. I’m a bit lost with doing .

SetGripAdvancedPhysicsSettings is I think the only modifer that I don’t have a function for.

What about it are you trying to change? It is checked on replication but only changes the grip stiffness, however there isn’t much to AdvancedPhysicsSettings that should ever need to be changed during a grip, aside from the stiffness and damping and there is already a function for that.

Outside of the stiffness/damping the values are stored in the GripStructure itself once a grip takes place, you have to get the Grip of the object and set them there.

I used to simulate the weight. If is double griped, weight should be balanced (two hands is stronger that one) With method i could simulate a LAG on the movement. In real world, grip a rifle or large weapon with one Hand and have got aim is a bit complicated. With physic enable, Aceleration Constant, and angular damping and stiffness i got a better feel with one hand, and a penalization. I don’t want a RAMBO in my game with 2 AR, but if you like that, you can do, although a bit useless… but is the user and not me that decide that.

In a previous version, i applied a recoil, but in VR is strange the weapon move like a snake in all directions with one hands, isn’t intuitive.

Acceleration constraint is the default type, you are just changing the angular.

You should try using the SetGripStiffessAndDamping node instead it has an Option to set the angular values as well. Optionally, since you are altering a grip when you add the secondary attachment, you can also literally just edit the Grip structure itself for whatever values you want (if you are not client authority, client auth has to send a change up so you need to use the node).

For reference, when not using advanced settings I multiply the stiffness/damping by these values for the angular


// Constraint multipliers for angular, to avoid having to have two sets of stiffness/damping variables
const float ANGULAR_STIFFNESS_MULTIPLIER = 1.5f;
const float ANGULAR_DAMPING_MULTIPLIER = 1.4f;

Can use that for setting angular with the setter node for the same effect as turning off advanced settings.

I’m did a mistake or something. Okay, i did that you tell me. I set the GrippableSkeletalMesh as Angluar and Stiffnes in 20 for example. In the OnSecondaryGrip, i pick de GripInformation and HeldHand pass to SetGripStiffnessAndDamping and set custom value to 0 (is the default values, no?) But nothing happens. I don’t sure what i’m doing.

GripInformation store all the information on Predominant Hand, no?

I did , but it not change anything, i know i doing something wrong, for i don’t sure what i doing.

For Clientside_Movement grips you need to call that function on the server.

Regardless, you should be increasing the stiffness not setting it to zero? 0 stiffness/damping is an invalid number for constraints.

I ran a quick test and it worked fine.

Pushed a new commit to both repositories (actually is a list of recent changes)

Template



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  in their base template ever).

Added optional tracking sensors to the teleport outline


Plugin



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 .  

 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. 

Added a new entry under use cases ( time for a game jam game that I thought was pretty impressive for a 5 day deadline), not to mention not
working off of the example map but implementing from the ground up using the plugin.

Rise Of The Bots VR
https://slapunas./riseofthebotsvr

I’m going to cry. I don’t know nothing (hello, i’m John Snow). Okay i did your system. I pass it to the Server (but i’m the server in test) and aparently works. The Angular Stiffness and Damping change, i see it in log. But i don’t feel it, i feel the lag without change.

I set the variables in 10/10 to test with one Grip, and set to 100/100 with two grips. The stiffness change, but i don’t feel any change. The Weapon still moves with LAG.

If i set the GrippableActor in BP Settings to 100/100 at start, the weapon moves greatly well, how at default settings. Also, when i change the Stiffnes, on release secondary grip, the weapon drops. I don’t understand for what if i didn’t change anything more than the stiffness and damping.

But anyway, what is the default Stiffness and Damping when not set it in AdvancedGrip?

Default stiffness is 1500, you can see it in the grip settings struct, values of 100 are very low and 10-100 is barely a stiffness change.

The example gun uses 5000 stiffness.

In my case, it do nothing. I don’t want change the Constraint. But is the only that GripStiffnessAndDamping do in my tests. One pic to be clear.

I want to change these variables, is it that produces the effect that i want. is i set the Blueprint, but the Gun don’t affect and i don’t know what.

Custom Event is set to Server, but in Blueprintue don’t show.

Yes…like I said, the difference between 10/15 and 100/100 is nearly none, you are setting them to nearly the same values. Also you do not want damping to be nearly as much as the stiffness, it just gets rid of the stiffness then. That is why default is 1500/300.

I am looking into something though, there might also be a bug here

Yes, is there bug or something. But now know what happens.

The system, works as you said. But my mistake is the next:

When i saw your Q&A Video on YouTube where you explain the Angular Stiffnes and Damping. I started to try functionality tweaking the values. When i set it to high values as you, i got the oposite effect what i want. But i now know what is the problem. If you set the Angular Stiffness and Damping in the BP settings it work as i said. But if you change during play, low values don’t apply a physical delay in movement, and high values do the delay.

My mistake is that when i tested , the value as 100 or more not change anything. And values below that 20 apply a physical delay.

Nah, it was just using the passed in grip struct instead of the found one for that node.

I fixed it, and will upload today.

I modified the change log post above to include them

Edit Patch released with fix

Thanks , I love you so much! Downloading!

Tested and works as intended. Thanks again!


Recycling

I’m trying to rework one of my systems, I’m don’t satisfied with it.

I Know that in Secondary Grip we can Smooth it with SecondaryGripScaler. But i want much more that it. I want to Smooth the rotation about 2 or 3 times. By example, if i rotate 10 degree the the gripped object only move 5 degrees (multiplier 2) or 2.5 degrees (multiplier 4) .

But i don’t know how you calculate the rotation between two Grips. Obviusly, the rotation with one Grip is the Controller Hand Rotation. But with second Grip, i don’t know how your plugin do it. I supose that calculates the LookingRotation between Grip1 Location and Grip2 location. But i don’t sure that.

How i can achieve that?

Thank you in advance.

You’ll have to override the default logic for that, a functionality that is coming around the 4.20 update when I make some gripping changes. Until then it would have to be a custom grip that you run the logic for yourself. Originally the smoothing worked kind of like that, but it felt really bad for most uses.

You can edit the 1 Euro Low Pass Filter that the secondary smoothing uses though and add a really large smooth to it, which will significantly delay it, the ProjectSettings -> VRExpansionPluginSettings has the relevant settings for that.

Also no, I don’t use LookAt, I don’t like how it handles the rotation, I map hand location differences around the held object and use the Quaternion rotation from vector.