Warner_V
(Warner)
November 20, 2017, 7:02pm
1850
For the grip type you likely want a manip if you are using constraints, the default interactive grip is a full physics grip and will try to pull it away from the door too much, that or you are using a PhysicsOnly grip where there are no constraints involved.
Now…that being said…the handle could be done a lot cleaner if you use a VRDial or VRLever (depending on lever or knob style) and when it gets past a set point either adding another grip to the door so the hand is holding both, or ungripping the knob and gripping the door instead (or I guess simulating the door and changing grip type to a manipulation one).
Both the Dial and Lever would play the rotation for you without any extra work, and both have events and rotation feedback that would make it simple.
Edit I’ll note that I recently went in to the template and changed the door grip into an AdvancedPhysicsSettings Force grip instead of the default acceleration grip. It promotes better behavior with the constraint and doesn’t try to fight the limits. Acceleration directly sets the acceleration of the held object, a force based grip applies force in the desired direction instead.
I’ve had it on my TODO list for awhile to show knobs, but since the Dial and Lever make them far simpler I was waiting to finish the c++ versions of those, and then other more important things came up.
Re-edit
If you literally just want it to make the handle turn on grip…make it a custom grip, it will trigger the events but won’t move anything unless you manually move it.
There are a lot of ways to go about honestly, it depends on what you are trying to do really.
If the “handle box” is moving away from the door when constrained and it is using one of the constraint type grips then you have the constraint set up wrong (too weak or just not actually constraining it).
I was trying the Dial/Level… but I don’t manage to make them move together with the door (besides, since I use the movement mostly for visual feedback it seems to me to be a bit overkill). Anyhow, if you say it’s better to use that I can give it another try.
With the custom grip setting, the handle stays attached properly, and it turns when you grip it, but the door doesn’t move when the grip is with the handle (it moves only when the grip is with the door).
Great tip with the AdvancedPhysics Force grip: it makes the movement much smoother.