Preface
At this point, the translation of LeapMotion's unity body is all over, and this is the tenth blog of the partner.
To commemorate this milestone, the two-dimensional pier is now converted into a group photo * ^-^ *
Link to original translation: http://blog.csdn.net/qq_18408937/article/details/47452343
Magnetic pinch classes are an effective way to respond to somatosensory input, and in order to enhance the user experience, it is often more important to make the operation easier than to make the operation more realistic.
MagneticpinchMagnetic Pinch
Attach this script to a Rigidhand object to enable grabbing moveable Unity objects by pinching. The script uses a simple distance check and pulls the object to the hand (rather than simulating the physics of picking up An object by contact). You can specify the range and the strength of the "force" that moves the object to the hand.
Add this script to the bone-bound hand object so that it can grab the Unity object and move it. The script uses a simple distance detection and drags the object with a hand (rather than physically simulating the pick up of an object through contact). You can specify the range and the force to move the object to the hand.
class Magneticpinch Magnetic Pinch-Pick class
Detects pinches and grabs the closest rigidbody if it ' s within a given range.
Attach This script to the physics hand object assinged to the Handcontroller in a scene.
Detects the nearest rigid body in a given range to pinch and crawl it.
Add this script to the physical hand object of the hand controller in the scene.
Public Variables
float forcespringconstant Float Elastic Force constant
The stiffness of the spring force used to move the object toward the hand.
The strength of the elastic force used to move the hand of the object.
float magnetdistance float suction distance
The maximum range at which a object can be picked up.
The maximum range of objects that can be picked up.
————————————————————————————————————————————
For more information:
"VR" Leap Motion Official Document Script reference (directory)
(Copyright notice: This is a translation of the Leap Motion website document, all rights reserved by the Leap Motion website, and the text content is for learning only.) )
"VR" Leap Motion Official document Magneticpinch (magnetic pinch)