jscott / vivegrip Goto Github PK
View Code? Open in Web Editor NEWPhysics-based grabbing for SteamVR development in Unity.
Home Page: https://vivegrip.com/
License: MIT License
Physics-based grabbing for SteamVR development in Unity.
Home Page: https://vivegrip.com/
License: MIT License
I've had people come to me with issue #11 more than once. The way SketchUp handles things makes it especially likely to happen. To make my life easier, I should probably include this somewhere. Unfortunately I can't rely on the wiki because Asset Store users will never see it. Maybe a FAQ.md?
Valve have updated their SteamVR plugin with their own InteractionSystem which enables controller hint text, UI menu interactions, teleportation locomotion and also grabbing and throwing. However, their grabbing and throwing does not respect Unity physics like this implementation does (all of Valve's throwable objects pass through world geometry when you hold them).
If you want to take advantage of what their InteractionSystem offers, you need to use their new camera rig, and this seems to break ViveGrip.
I watched your Youtube tutorial and added the Vive Grip_Controller Handler and Vive Grip_Grip Point to the Attach_ControllerTip of both Hand1 and Hand2 in the new rig. I also added the Steam VR_Tracked Object to the hands (something no longer required in the InteractionSystem) and assigned them to the Vive Grip_Controller Handler. I then tried to move a few objects in your example scene, but nothing happened (even if I added the new interactable script to them to get Valve's highlights, etc).
Perhaps I missed a step in the above procedure or perhaps there is another source of the incompatibility. Any assistance would be greatly appreciated!
When you press the button in the hand will become stuck in "primed" mode because the grip point never unhighlights the object.
This similarly happens when you pull the bubbler away from your hand when you're triggering it. The old grip never gets the chance to tell it to stop and you can drop it while it's still firing.
Right now I use "Grip Sphere" because it's easy and performant. However, some users might want the option of using a custom mesh because it's going to be a lot more accurate and intuitive for their custom Grip Point. This should be pretty easy, you just need to swap out the Collider, and could be another customization option on the Grip Point.
Highlighting is easy to enable or disable because it's on the object that will likely toggle it. Grabbing isn't so easy because it's on the Grip Point and the only access you have is through the method that triggers it. There's no reason that "grabbing" and object couldn't be the object attaching itself to the Grip Point. Needs more investigation whether this is sane or not.
On the flip side, it's difficult to disable a ViveGrip_Highlighter because it doesn't exist until the game runs. The highlight extender example gets around this by polling forever which isn't great. This might be another issue in itself but it seems related in consideration.
I can probably do something with the motor to make it feel better to pick things up. The archery demo in the Lab is a great example.
Sometimes you have multiple handles or need to flip things around depending on the hand. Anchors already pair with orientation configuration so why not have a proper ViveGrip_Anchor
script on your ViveGrip_Grabbable
object that gets detected automatically? It'd be a cleaner implementation than a drop down at the minor expense of being less immediately obvious.
I tried you example scene, but the controllers are invisible+non working using Unity 5.6 and the latest version of SteamVR (using a HTC Vive).
What happens if you disable a ViveGrip_Interactable
or ViveGrip_Grabbable
component? Do they stop sending messages? Or maybe merely stop doing the default behaviour? Or maybe we just leave it entirely up to the user's custom code? Probably that middle one. Either way it's far reaching enough that a little research and design needs to be done. I bet its not entirely consistent or predictable right now, whatever it currently does.
When using Controller grab object and using other Controller move player(myself avatar),The object fell off and did not move with the player. what should I do? thanks!
You can grab a single object with multiple grip points. This isn't necessarily bad but it might be really weird in some situations as well. You can end up with floating objects when two joints are attached.
Should new joints override the old ones? Perhaps vice versa? Maybe reduce the grip radius so it doesn't end up floating without fumbling? It definitely needs more research.
Anchors are a strange creature in real time scripts. I should be able to just move the anchor of the joint instead of making an intermediate joint object parent and moving that instead.
I have a suspicion that the anchor of the lever in the demo scene is actually a bit broken. I don't think it's large enough or rotates properly with the object or something. Needs looking into.
if (grabbable.applyGripRotation) {
ViveGrip_JointFactory.SetAngularDrive(joint, desiredObject.mass);
}
if (grabbable.snapToOrientation) {
ViveGrip_JointFactory.SetTargetRotation(joint, desiredObject, grabbable.localOrientation, controllerRotation);
}
The angular drive never gets set if we don't apply grip rotation. If this is intentional then I should probably present the option as an enum (No Rotation, Grip Rotation, Grip Rotation + Set Orientation) to avoid a confusing permutation. If this isn't intentional then it needs fixing.
Anchors should be able to handle rotations around an anchor with nice slerp animations. Similar to anchor #1, I just couldn't get the complexities of ConfigurableJoint
figured out at the time. This should be addressed again because the snapping is violent and is likely to toss stacked objects around.
I've tested this with Oculus Rift+Touch and it works. I should probably change the name to make that obvious. Marketing is important! Or so I hear.
Aren't handled terribly well. The close attachment means that rotating your controller is really the only way to strongly rotate an object. That's weird when it comes to levers and wheels.
There are so many weird problems cropping up around two hands grabbing a single object:
And many more if I actually looked for them, I bet. It's probably best to just disable grabbable while being held.
Sometimes the grip won't let go. This is particularly visible with the lever example for some reason.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.