当前位置:网站首页>Steamvr--- grab objects

Steamvr--- grab objects

2022-06-12 03:08:00 Nangongming

hot tip : This series is based on Unity 2020.3.26,SteamVR Unity Plugin - v2.7.3 (sdk 1.14.15)

Blog address of this series : Portal

Create one randomly in the scene cube, Hang them separately :Collider( Hang it on a sub object )、Rigidbody、Interactable、Throwable、VelocityEstimator、SteamVR_Skeleton_Poser

Interactable

hideHandOnAttach: Hide the hand model when grasping , Release display
hideSkeletonOnAttach: Hide the skeletal part of the hand when grasping
hideControllerOnAttach: Hide controller while grabbing
useHandObjectAttachmentPoint: Whether to use hand The object connection point specified by the script
handFollowTransform: Whether the hand model is locked to follow the object
highlightOnHover: When the hand covers / Whether the object is highlighted when touching
 Insert picture description here

Throwable

attachmentFlags: The way objects are grasped , You can choose more , Use the default settings when normal
SnapOnAttach: The object will match hand The script specifies the connection point objectAttachmentPoint The location of
DetachOthers: When you have objects on your hands , Then grab the object, and the object in your hand will be separated
DetachFromOtherHand: If you are currently held by your left hand , When the right hand goes to grasp, it will be caught by the right hand
ParentToHand: Set the parent object of the object to hand
VelocityMovement: The object will try to move to match the position and rotation of the hand . Automatic matching ? I don't know how to use
TurnOnKinematic: Will open Rigidbody Of isKinematic, Change the mode of collision detection
TurnOffGravity: Will turn off Rigidbody Of useGravity
AllowSidegrade: Unknown
 Insert picture description here

VelocityEstimator

Used for setting up Rigidbody Of velocity Follow angularVelocity, It is not necessary to hang up the script

SteamVR_Skeleton_Poser

You can set objects 、 The position and rotation of the hand , It is not necessary to hang up the script
CurrentPose: The configuration file
 Insert picture description here

SteamVR_Skeleton_Pose

position: The position of the object after grasping , Relative to hand
rotation: Rotation of the object after grasping , Relative to hand
bonePositions: Hand bone position
boneRotations: Hand bone rotation
 Insert picture description here

explain

1. Default GrabPinch(Trigger Trigger key ) And GrabGrip Can grasp objects , No script can be set on the panel , It is written in the underlying code that these two keys can be used , There are many places to call , It is not recommended to change the script directly
resolvent : stay SteamVR–>> equipment –>> Controller settings , Set the trigger key in the key setting GrabPinch Delete ( I am using Oculus The display of the device handle is different )
 Insert picture description here
2. To grab an object, you need to press the button all the time , But there will be the need to click to grab the object and then click to let go , I don't know how to solve it yet , Friends who know me are welcome to comment or send me a private letter

原网站

版权声明
本文为[Nangongming]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203011110406454.html