x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Make physics handle more rigid?

We are currently working on some physics simulations in VR, using the HTC Vive headset and motion controllers. We've had limited success using physics handles to simulate motion and throw objects, but they don't behave ideally. We've managed to allow free rotation and inspection of the objects, but objects tend to be really springy and not realistic. Playing with the damping, stiffness, and interpolation values has helped, but quick motions of your hand still cause the objects in question to fly off into the distance and slowly return.

Is there a way to make a physics handle perform more like a proper grab, or will we have to disable physics on the object and make the calculations ourselves while holding them? It would be preferable to find a way to let unreal handle the physics calculations, since it will be more accurate, but we need it to feel much more real than it does now. It would also be nice to keep the handle or something similar so that collision is still calculated.

Here is the relevant code we're using so far:

 Constructor:
     PhysicsHandle = CreateDefaultSubobject<UPhysicsHandleComponent>(TEXT("Physics Handle"));
     PhysicsHandle->SetLinearDamping(100000);
     PhysicsHandle->SetLinearStiffness(150000);
     PhysicsHandle->SetAngularDamping(100000);
     PhysicsHandle->SetAngularStiffness(150000);
     PhysicsHandle->SetInterpolationSpeed(100000);
     bPhysicsHandleActive = false;
 
 Tick:
     if (bPhysicsHandleActive)
     {
         PhysicsHandle->SetTargetLocationAndRotation(GetComponentLocation(), GetComponentRotation());
     }
 
 Grabbing an item:
             SetWorldRotation(HeldItem->GetTransform().GetRotation());
             PhysicsHandle->GrabComponent(Cast<UPrimitiveComponent>(HeldItem->GetRootComponent()), NAME_None, GetComponentLocation(), true);
             bPhysicsHandleActive = true;
             bHoldingItem = true;
 
 Dropping an item:
         if (bPhysicsHandleActive)
         {
             bPhysicsHandleActive = false;
             PhysicsHandle->ReleaseComponent();
             SetRelativeRotation(FQuat::Identity);
         }
Product Version: UE 4.11
Tags:
more ▼

asked May 13 '16 at 09:58 PM in C++ Programming

avatar image

Konda
10 2 4 6

avatar image bigbadbogie Jan 27 '17 at 11:47 AM

I believe that you need to set the physics handle's settings (such as 'SetLinearDamping') under PostInitProperties or BeginPlay for them to have any effect. At least that was my experience.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Not sure it's still relevant, but i found that leaving LinearDamping and Angular Damping low (under 100) seemed to work better, so object didn't drift off during rapid movements. Actually i think i put both mine at 0.

more ▼

answered Dec 25 '16 at 08:46 PM

avatar image

Jonas_Molgaard
491 29 25 47

avatar image GSamurai Nov 13 '17 at 01:16 AM

might be for me, im trying to create a cursor hand that can pick up skeletal mesh characters, by specific bones, but he just flies around when I do it is frustrating. I'm going to try damp 0

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question