《SteamVR/Input》 |
版本 |
作者 |
参与者 |
完成日期 |
备注 |
SteamVR_Input_V01_1.0 |
严立钻 |
|
2019.01.22 |
|
|
|
|
|
|
##《SteamVR/Extras》发布说明:
++++“SteamVR/Input”:是“从SteamVR目录结构出发”系列的“SteamVR/Input”;(2019年度的重点技术突破点确立为:“SteamVR”,所以对SteamVR脚本功能的熟悉是非常关键的!)
++++“SteamVR/Input”:定位在一个代码剖析,以期能熟悉SteamVR框架;
++++OpenVR的Github:https://github.com/ValveSoftware/openvr
++++OpenXR官网:https://www.khronos.org/openxr
++++SteamVR的Github:https://github.com/ValveSoftware/steamvr_unity_plugin
##《SteamVR/Input》目录
#《SteamVR/Input》 |
#《SteamVR/Extras》
++++立钻哥哥:“SteamVR/Input”是对SteamVR框架代码的剖析;
++++A.0、SteamVR/Input/
++++A.1、/Input/SteamVR_Action.cs
++++A.2、/Input/SteamVR_Action_Boolean.cs
++++A.3、/Input/SteamVR_Action_In.cs
++++A.4、/Input/SteamVR_Action_List.cs
++++A.5、/Input/SteamVR_Action_Out.cs
++++A.6、/Input/SteamVR_Action_Pose.cs
++++A.7、/Input/SteamVR_Action_Single.cs
++++A.8、/Input/SteamVR_Action_Skeleton.cs
++++A.9、/Input/SteamVR_Action_Vector2.cs
++++A.10、/Input/SteamVR_Action_Vector3.cs
++++A.11、/Input/SteamVR_Action_Vibration.cs
++++A.12、/Input/SteamVR_ActionDirections.cs
++++A.13、/Input/SteamVR_ActionSet.cs
++++A.14、/Input/SteamVR_ActivateActionSetOnLoad.cs
++++A.15、/Input/SteamVR_Behaviour_Boolean.cs
++++A.16、/Input/SteamVR_Behaviour_Pose.cs
++++A.17、/Input/SteamVR_Behaviour_Single.cs
++++A.18、/Input/SteamVR_Behaviour_Skeleton.cs
++++A.19、/Input/SteamVR_Behaviour_SkeletonCustom.cs
++++A.20、/Input/SteamVR_Behaviour_Vector2.cs
++++A.21、/Input/SteamVR_Behaviour_Vector3.cs
++++A.22、/Input/SteamVR_DefaultAction.cs
++++A.23、/Input/SteamVR_DefaultActionSet.cs
++++A.24、/Input/SteamVR_Input.cs
++++A.25、/Input/SteamVR_Input_ActionFile.cs
++++A.26、/Input/SteamVR_Input_ActionScopes.cs
++++A.27、/Input/SteamVR_Input_ActionSetUsages.cs
++++A.28、/Input/SteamVR_Input_Generator_Names.cs
++++A.29、/Input/SteamVR_Input_References.cs
++++A.30、/Input/SteamVR_Input_Source.cs
++++A.31、/Input/SteamVR_Input_Sources.cs
++++A.32、/Input/SteamVR_UpdateModes.cs
##A.0、SteamVR/Input/ |
++A.0、SteamVR/Input/
++++立钻哥哥:好吧,先通过Xmind来看一下这个目录下基本结构吧:
++SteamVR/Input/SteamVR_Action.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Action.cs
using UnityEngine; using System.Collections; using System; using Valve.VR; using System.Runtime.InteropServices; using System.Collections.Generic;
namespace Valve.VR{ //This is the base level action for SteamVR Input. All SteamVR_Action_In and SteamVR_Action_Out inherit from this. Initializes the ulong handle for the action and has helper references.(立钻哥哥:这是SteamVR输入的基本操作。所有SteamVR_Action_In和SteamVR_Action_Out都继承自这个函数。初始化操作的ulong句柄并具有助手引用。) public abstract class SteamVR_Action : ScriptableObject{ public float changeTolerance = 0.000001f; public string fullPath;
[NonSerialized] protected ulong handle;
public SteamVR_ActionSet actionSet; public SteamVR_ActionDirections direction;
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, float> lastChanged = new Dictionary<SteamVR_Input_Sources, float>(new SteamVR_Input_Sources_Comparer());
public float GetTimeLastChanged(SteamVR_Input_Sources inputSource){}
//Initializes the dictionaries used by this action public virtual void PreInitialize(){}
//Initializes the handle for the action public virtual void Initialize(){}
protected virtual void InitializeDirectionaries(SteamVR_Input_Sources source){}
[NonSerialized] private string cachedShortName;
//Gets the last part of the path for this action. Remove action set. public string GetShortName(){}
} //立钻哥哥:public abstract class SteamVR_Action:ScriptableObject{} } //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_Action_Boolean.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Action_Boolean.cs
using UnityEngine; using System.Collections; using System; using Valve.VR; using System.Runtime.InteropServices; using System.Collecitons.Generic;
namespace Valve.VR{ //Boolean actions are either true or false. There is an onStateUp and OnStateDown event for the rising and falling edge.(布尔操作要么为真,要么为假。对于上升和下降边缘,有一个onStateUp和OnStateDown事件。) public class SteamVR_Action_Boolean : SteamVR_Action_In{ [NonSerialized] protected Dictionary<SteamVR_Input_Sources, Action<SteamVR_Action_Boolean>> onStateDown = new Dictionary<SteamVR_Input_Sources, Action<SteamVR_Action_Boolean>>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, Action<SteamVR_Action_Boolean>> onStateUp = new Dictionary<SteamVR_Input_Sources, Action<SteamVR_Action_Boolean>>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, InputDigitalActionData_t> actionData = new Dictionary<SteamVR_Input_Sources, InputDigitalActionData_t>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, InputDigitalActionData_t> lastActionData = new Dictionary<SteamVR_Input_Sources, InputDigitalActionData_t>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected uint actionData_size = 0;
public override void Initialize(){}
//The device you would like to get data from. Any if the action is not device specific. protected override void InitializeDictionaries(SteamVR_Input_Sources source){}
//The device you would like to get data from. Any if the action is not device specific. public override void UpdateValue(SteamVR_Input_Sources inputSource){}
public bool GetStateDown(SteamVR_Input_Sources inputSource){} public bool GetStateUp(SteamVR_Input_Sources inputSource){} public bool GetState(SteamVR_Input_Sources inputSource){} public bool GetLastStateDown(SteamVR_Input_Sources inputSource){} public bool GetLastStateUp(SteamVR_Input_Sources inputSource){} public bool GetLastState(SteamVR_Input_Sources inputSource){}
} //立钻哥哥:public calss SteamVR_Action_Boolean:SteamVR_Action_In{} } //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_Action_In.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Action_In.cs
using UnityEngine; using System.Collections; using System; using Valve.VR; using System.Runtime.InteropServices; using System.Collections.Generic;
namespace Valve.VR{ //In actions are all input type actions. Boolean, Single, Vector2, Vector3, Skeleton, and Pose. This class fires onChange and onUpdate events.(立钻哥哥:在操作中都是输入类型操作。Boolean, Single, Vector2, Vector3, Skeleton, and Pose。该类触发onChange和onUpdate事件。) public abstract class SteamVR_Action_In : SteamVR_Action{ [NonSerialized] protected Dictionary<SteamVR_Input_Sources, float> updateTime = new Dictionary<SteamVR_Input_Sources, float>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, ulong> activeOrigin = new Dictionary<SteamVR_Input_Sources, ulong>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, bool> active = new Dictionary<SteamVR_Input_Sources, bool>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, bool> changed = new Dictionary<SteamVR_Input_Sources, bool>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, Action<SteamVR_Action_In, bool>> onActiveChange = new Dictionary<SteamVR_Input_Sources, Action<SteamVR_Action_In, bool>>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, Action<SteamVR_Action_In>> onChange = new Dictionary<SteamVR_Input_Sources, Action<SteamVR_Action_In>>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, Action<SteamVR_Action_In>> onUpdate = new Dictionary<SteamVR_Input_Sources, Action<SteamVR_Action_In>>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, InputOriginInfo_t> lastInputOriginInfo = new Dictionary<SteamVR_Input_Sources, InputOriginInfo_t>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, float> lastOriginGetFrame = new Dictionary<SteamVR_Input_Sources, float>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Source, bool> lastActive = new Dictionary<SteamVR_Input_Sources, bool>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected static uint inputOriginInfo_size = 0;
public abstract void UpdateValue(SteamVR_Input_Sources inputSource);
public override void Initialize(){} protected override void InitializeDictionaries(SteamVR_Input_Sources source){}
//Returns the component name for the part of the controller that is bound to this action.(立钻哥哥:返回绑定到此操作的控制器部分的组件名称。) public virtual string GetDeviceComponentName(SteamVR_Input_Sources inputSource){}
//Gets the full device path for the controller this device is bound to. public virtual ulong GetDevicePath(SteamVR_Input_Sources inputSource){}
//Gets the device index for the controller this action is bound to. This can be used for render models or the pose tracking system.(立钻哥哥:获取此操作绑定到的控制器的设备索引。这可以用于渲染模型或姿态跟踪系统。) public virtual uint GetDeviceIndex(SteamVR_Input_Sources inputSource){}
public virtual bool GetChanged(SteamVR_Input_Sources inputSource){} public virtual bool GetActive(SteamVR_Input_Sources inputSource){} protected void UpdateOriginTrackedDeviceInfo(SteamVR_Input_Sources inputSource){}
public void AddOnActiveChangeListener(Action<SteamVR_Action_In, bool> action, SteamVR_Input_Sources inputSource){} public void RemoveOnActiveChangeListener(Action<SteamVR_Action_In, bool> action, SteamVR_Input_Sources inputSource){}
public void AddOnChangeListener(Action<SteamVR_Action_In> action, SteamVR_Input_Sources inputSource){} public void RemoveOnChangeListener(Action<SteamVR_Action_In> action, SteamVR_Input_Sources inputSource){}
public void AddOnUpdateListener(Action<SteamVR_Action_In> action, SteamVR_Input_Sources inputSource){} public void RemoveOnUpdateListener(Action<SteamVR_Action_In> action, SteamVR_Input_Sources inputSource){}
} //立钻哥哥:public abstract class SteamVR_Action_In:StateVR_Action{} } //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_Action_List.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Action_List.cs
using UnityEngine; using System.Collections; using System; using System.Runtime.InteropServices;
namespace Valve.VR{ //A list of the actions in an action set. Restricted per Action Direction.(立钻哥哥:操作集中的操作列表。每个操作方向受限制。) public abstract class SteamVR_Action_List : ScriptableObject{ public SteamVR_ActionSet actionSet; public SteamVR_ActionDirections listDirection; public SteamVR_Action[] actions; } //立钻哥哥:public abstract class SteamVR_Action_List:ScriptableObject{} } //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_Action_Out.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Action_Out.cs
using UnityEngine; using System.Collections; using System; using Valve.VR; using System.Runtime.InteropServices;
namespace Valve.VR{ //There is currently only one output type action - vibration. But there may be more in the future.(立钻哥哥:目前只有一种输出类型的动作-振动。但未来可能会有更多。) public abstract class SteamVR_Action_Out : SteamVR_Action{ } //立钻哥哥:public abstract class SteamVR_Action_Out:SteamVR_Action{} } //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_Action_Pose.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Action_Pose.cs
using UnityEngine; using System.Collections; using System; using Valve.VR; using System.Runtime.InteropServices; using System.Collections.Generic;
namespace Valve.VR{ //Pose actions represent a position and orientation inside the tracked space. SteamVR also keeps a log of past poses so you can retrieve old poses with GetPoseAtTimeOffset or GetVelocitiesAtTimeOffset. You can also pass in times in the future to these methods for SteamVR’s best prediction of where the pose will be at that time.(立钻哥哥:姿态动作表示跟踪空间中的位置和方向。SteamVR还保存了一个过去姿势的日志,这样你就可以通过GetPoseAtTimeOffset或者GetVelocitiesAtTimeOffset来检索以前的姿势。你也可以在未来通过这些方法来预测SteamVR在那个时候的姿势。) public class SteamVR_Action_Pose : SteamVR_Action_In{ [NonSerialized] protected static ETrackingUniverseOrigin universeOrigin = ETrackingUniverseOrigin.TrackingUniverseRawAndUncalibrated;
[NonSerialized] public float predictedSecondsFromNow = 0;
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, Action<SteamVR_Action_Pose>> onTrackingChanged = new Dictionary<SteamVR_Input_Sources, Action<SteamVR_Action_Pose>>(new SteamVR_Input_Sources_Comporer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, Action<SteamVR_Action_Pose>> onValidPoseChanged = new Dictionary<SteamVR_Input_Sources, Action<SteamVR_Action_Pose>>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, Action<SteamVR_Action_Pose>> onDeviceConnectedChanged = new Dictionary<SteamVR_Input_Sources, Action<SteamVR_Action_Pose>>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, InputPoseActionData_t> poseActionData = new Dictionary<SteamVR_Input_Sources, InputPoseActionData_t>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, InputPoseActionData_t> lastPoseActionData = new Dictionary<SteamVR_Input_Sources, InputPoseActionData_t>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Dources, InputPoseActionData_t> lastRecordedPoseActionData = new Dictionary<SteamVR_Input_Sources, InputPoseActionData_t>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, bool> lastRecordedActive = new Dictionary<SteamVR_Input_Sources, bool>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected InputPoseActionData_t tempPoseActionData = new InputPoseActionData_t();
[NonSerialized] protected uint poseActionData_size = 0;
public override void Initialize(){} protected override void InitializeDictionaries(SteamVR_Input_Sources source){} public override void UpdateValue(SteamVR_Input_Sources inputSource){} protected void ResetLastStates(SteamVR_Input_Sources inputSource){} public virtual void UpdateValue(SteamVR_Input_Sources inputSource, bool skipStateAndEventUpdates){}
//SteamVR keeps a log of past poses so you can retrieve old poses or estimated poses in the future by passing in a secondsFromNow value that is negative or positive.(立钻哥哥:SteamVR保存了一个过去姿势的日志,这样你就可以通过传递一个秒数fromnow的值来检索过去的姿势或者估计未来的姿势。) public bool GetVelocitiesAtTimeOffset(SteamVR_Input_Sources inputSource, float secondsFromNow, out Vector3 velocity, out Vector3 angularVelocity){}
public bool GetPoseAtTimeOffset(SteamVR_Input_Sources inputSource, float secondsFromNow, out Vector3 position, out Quaternion rotation, out Vector3 velocity, out Vector3 angularVelocity){}
//Update a transform’s local position and local rotation to match the pose.(立钻哥哥:更新变换的局部位置和局部旋转以匹配该姿态。) public void UpdateTransform(SteamVR_Input_Sources inputSource, Transform transformToUpdate){}
protected void CheckAndSendEvents(SteamVR_Input_Sources inputSource){} public static void SetTrackingUniverseOrigin(ETrackingUniverseOrigin newUniverseOrigin){}
//The local position of the pose relative to the center of the tracked space.(立钻哥哥:相对于跟踪空间中心的位置。) public Vector3 GetLocalPosition(SteamVR_Input_Sources inputSource){} public Quaternion GetLocalRotation(SteamVR_Input_Sources inputSource){} public Vector3 GetVelocity(SteamVR_Input_Sources inputSource){} public Vector3 GetAngularVelocity(SteamVR_Input_Sources inputSource){}
public bool GetDeviceIsConnected(SteamVR_Input_Sources inputSource){} public bool GetPoseIsValid(SteamVR_Input_Sources inputSource){} public ETrackingResult GetTrackingResult(SteamVR_Input_Sources inputSource){}
public Vector3 GetLastLocalPosition(SteamVR_Input_Sources inputSource){} public Quaternion GetLastLocalPosition(SteamVR_Input_Sources inputSource){} public Vector3 GetLastVelocity(SteamVR_Input_Sources inputSource){} public Vector3 GetLastAngularVelocity(SteamVR_Input_Sources inputSource){} public bool GetLastDeviceIsConnected(SteamVR_Input_Sources inputSource){} public bool GetLastPoseIsValid(SteamVR_Input_Sources inputSource){} public ETrackingResult GetLastTrackingResult(SteamVR_Input_Sources inputSource){}
//Fires an event when a device is connected or disconnected.(立钻哥哥:在设备连接或断开连接时触发事件。) public void AddOnDeviceConnectedChanged(SteamVR_Input_Sources inputSource, Action<SteamVR_Action_Pose> action){} public void RemoveOnDeviceConnectedChanged(SteamVR_Input_Sources inputSource, Action<SteamVR_Action_Pose> action){}
//Fires an event when the tracking of the device has changed.(立钻哥哥:当设备的跟踪发生更改时触发事件。) public void AddOnTrackingChanged(SteamVR_Input_Sources inputSource, Action<SteamVR_Action_Pose> action){} public void RemoveOnTrackingChanged(SteamVR_Input_Sources inputSource, Action<SteamVR_Action_Pose> action){}
//Fires an event when the device now has a valid pose or no longer has a valid pose.(立钻哥哥:当设备现在具有有效姿势或不再具有有效姿势时触发事件。) public void RemoveOnValidPoseChanged(SteamVR_Input_Sources inputSource, Action<SteamVR_Action_Pose> action){}
} //立钻哥哥:public class SteamVR_Action_Pose:SteamVR_Action_In{} } //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_Action_Single.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Action_Single.cs
using UnityEngine; using System.Collections; using System; using Valve.VR; using System.Runtime.InteropServices; using System.Collections.Generic;
namespace Valve.VR{ //An analog action with a value generally from 0 to 1. Also provides a delta since the last update.(立钻哥哥:一种模拟动作,其值一般为0到1。还提供自上次更新以来的增量。) public class SteamVR_Action_Single : SteamVR_Action_In{ [NonSerialized] protected Dictionary<SteamVR_Input_Sources, InputAnalogActionData_t> actionData = new Dictionary<SteamVR_Input_Sources, InputAnalogActionData_t>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, InputAnalogActionData_t> lastActionData = new Dictionary<SteamVR_Input_Sources, InputAnalogActionData_t>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected InputAnalogActionData_t tempActionData = new InputAnalogActionData_t();
[NonSerialized] protected uint actionData_size = 0;
public override void Initialize(){} protected override void InitializeDictionaries(SteamVR_Input_Sources source){} public override void UpdateValue(SteamVR_Input_Sources inputSource){}
public float GetAxis(SteamVR_Input_Sources inputSource){} public float GetAxisDelta(SteamVR_Input_Sources inputSource){} public float GetLastAxis(SteamVR_Input_Sources inputSource){} public float GetLastAxisDelta(SteamVR_Input_Sources inputSource){}
} //立钻哥哥:public class SteamVR_Action_Single:SteamVR_Action_In{} } //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_Action_Skeleton.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Action_Skeleton.cs
using UnityEngine; using System.Collections; using System; using System.Runtime.InteropServices; using System.Collections.Generic;
namespace Valve.VR{ //Skeleton Actions are our best approximation of where your hands are while holding vr controllers and pressing buttons. We give you 31 bones to help you animate hand models. For more information check out this blog past:https://steamcommunity.com/games/250820/announcements/detail/1690421280625220068 (立钻哥哥:当你手持vr控制器并按下按钮时,骨架动作是你的手的最佳近似值。我们给你31块骨头来帮助你制作手的动画模型。想了解更多信息,请访问这个博客:https://steamcommunity.com/games/250820/announcements/detail/1690421280625220068) public class SteamVR_Action_Skeleton : SteamVR_Action_Pose{ public const int numBones = 31;
[NonSerialized] protected List<Vector3[]> bonePositions = new List<Vector3[]>();
[NonSerialized] protected List<Quaternion[]> boneRotations = new List<Quaternion[]>();
[NonSerialized] protected List<Vector3[]> lastBonePositions = new List<Vector3[]>();
[NonSerialized] protected List<Quaternion[]> lastBoneRotations = new List<Quaternion[]>();
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, EVRSkeletalMotionRange> rangeOfMotion = new Dictionary<SteamVR_Input_Sources, EVRSKeletalMotionRange>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected VRBoneTransform_t tempBoneTransforms = new VRBoneTransform_t[numBones];
[NonSerialized] protected InputSkeletalActionData_t tempSkeletorActionData = new InputSkeletalActionData_t();
[NonSerialized] protected uint skeletonActionData_size = 0;
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, EVRSkelealTransformSpace> skeletalTransformSpace = new Dictionary<SteamVR_Input_Sources, EVRSkeletalTransformSpace>(new SteamVR_Input_Sources_Comparer());
public override void Initialize(){} protected override void InitializeDictionaries(SteamVR_Input_Sources source){} public override void UpdateValue(SteamVR_Input_Sources inputSource){} public override void UpdateValue(SteamVR_Input_Sources inputSource, bool skipStateAndEventUpdates){}
public Vector3[] GetBonePositions(SteamVR_Input_Sources inputSource){} public Quaternion[] GetBoneRotations(SteamVR_Input_Sources inputSource){} public Vector3[] GetLastBonePositions(SteamVR_Input_Sources inputSource){} public Quaternion[] GetLastBoneRotations(SteamVR_Input_Sources inputSource){}
//Set the range of the motion of the bones in this skeleton. Options are “With Controller” as if your hand is holding your VR controller. Or “Without Controller” as if your hand is empty.(立钻哥哥:设定骨骼运动的范围。选项是“With Controller”,就像你的手握着VR控制器一样。或者“没有控制器”,就好像你的手是空的。) public void SetRangeOfMotion(SteamVR_Input_Sources inputSource, EVRSkeletalMotionRange range){}
//Sets the space that you’ll get bone data back in. Options are relative to the Model, relative to the Parent bone, and Additive.(立钻哥哥:设置你会得到骨头数据的空间。选项是相对于模型、相对于父骨骼和附加的。) public void SetSkeletalTransformSpace(SteamVR_Input_Sources inputSource, EVRSkeletalTransformSpace space){}
} //立钻哥哥:public class SteamVR_Action_Skeleton:SteamVR_Action_Pose{}
//The change in range of the motion of the bones in the skeleton. Options are “With Controller” as if your hand is holding your VR controller. Or “Without Controller” as if your hand is empty.(立钻哥哥:骨骼运动范围的变化。选项是“With Controller”,就像你的手握着VR控制器一样。或者“没有控制器”,就好像你的手是空的。) public enum SkeletalMotionRangeChange{ None = -1, WithController = 0, WithoutController = 1, } //立钻哥哥:public enum SkeletalMotionRangeChange{}
} //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_Action_Vector2.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Action_Vector2.cs
using UnityEngine; using System.Collections; using System; using Valve.VR; using System.Runtime.InteropServices; using System.Collections.Generic;
namespace Valve.VR{ //Vector2 actions are useful when you need two analog values from the same device. Radial menu navigation or character controllers are good examples of this.(立钻哥哥:当您需要来自同一设备的两个模拟值时,Vector2操作非常有用。径向菜单导航或字符控制器就是很好的例子。) public class SteamVR_Action_Vector2 : SteamVR_Action_In{ [NonSerialized] protected Dictionary<SteamVR_Input_Sources, InputAnalogActionData_t> actionData = new Dictionary<SteamVR_Input_Sources, InputAnalogActionData_t>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, InputAnalogActionData_t> lastActionData = new Dictionary<SteamVR_Input_Sources, InputAnalogActionData_t>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected InputAnalogActionData_t tempActionData = new InputAnalogActionData_t();
[NonSerialized] protected uint actionData_size = 0;
public override void Initialize(){} protected override void InitializeDictionaries(SteamVR_Input_Source source){} public override void UpdateValue(SteamVR_Input_Source inputSource){} public Vector2 GetAxis(SteamVR_Input_Sources inputSource){} public Vector2 GetAxisDelta(SteamVR_Input_Sources inputSource){} public Vector2 GetLastAxis(SteamVR_Input_Sources inputSource){} public Vector2 GetLastAxisDelta(SteamVR_Input_Sources inputSource){}
} //立钻哥哥:public class SteamVR_Action_Vector2:SteamVR_Action_In{} } //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_Action_Vector3.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Action_Vector3.cs
using UnityEngine; using System.Collections; using System; using Valve.VR; using System.Runtime.InteropServices; using System.Collections.Generic;
namespace Valve.VR{ //Vector3 actions are relatively uncommon. If you’re looking for an action to get a 3d position from you probably want a Pose action.(立钻哥哥:Vector3操作相对少见。如果你在寻找一个动作来获得一个三维的位置,你可能想要一个姿势动作。) public class SteamVR_Action_Vector3 : SteamVR_Action_In{ [NonSerialized] protected Dictionary<SteamVR_Input_Sources, InputAnalogActionData_t> actionData = new Dictionary<SteamVR_Input_Sources, InputAnalogActionData_t>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected Dictionary<SteamVR_Input_Sources, InputAnalogActionData_t> lastActionData = new Dictionary<SteamVR_Input_Sources, InputAnalogActionData_t>(new SteamVR_Input_Sources_Comparer());
[NonSerialized] protected uint actionData_size = 0;
publlic override void Initialize(){} protected override void InitializeDictionaries(SteamVR_Input_Sources source){} public override void UpdateValue(SteamVR_Input_Sources inputSource){} public Vector3 GetAxis(SteamVR_Input_Sources inputSource){} public Vector3 GetAxisDelta(SteamVR_Input_Surces inputSource){} public Vector3 GetLastAxis(SteamVR_Input_Sources inputSource){} public Vector3 GetLastAxisDelta(SteamVR_Input_Sources inputSource){}
} //立钻哥哥:public class SteamVR_Action_Vector3:SteamVR_Action_In{} } //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_Action_Vibration.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Action_Vibration.cs
using UnityEngine; using System.Collections; using System; using Valve.VR; using System.Runtime.InteropServices;
namespace Valve.VR{ //Vibration actions are used to trigger haptic feedback in vr controllers.(立钻哥哥:在虚拟现实控制器中,采用振动动作触发触觉反馈。) public class SteamVR_Action_Vibration : SteamVR_Action_Out{ //Trigger the haptics at a certain time for a certain length.(立钻哥哥:在一定的时间、一定的长度触发触觉。) public void Execute(float secondsFromNow, float durationSeconds, float frequency, float amplitude, SteamVR_Input_Sources inputSource){}
} //立钻哥哥:public class SteamVR_Action_Vibration:SteamVR_Action_Out{} } //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_ActionDirections.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_ActionDirections.cs
namespace Valve.VR{ //The direction the action. In actions get input, Out actions send input.(立钻哥哥:行动的方向。In actions获取输入,Out actions发送输入。) public enmu SteamVR_ActionDirections{ In, Out, } //立钻哥哥:public enmu SteamVR_ActionDirections{} } //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_ActionSet.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_ActionSet.cs
using UnityEngine; using System.Collections; using System; using Valve.VR; using System.Runtime.InteropServices; using System.Collections.Generic;
namespace Valve.VR{ //Action sets are logical groupings of actions. Multiple sets can be active at one time.(立钻哥哥:操作集是操作的逻辑分组。多个集合可以同时处于活动状态。) public class SteamVR_ActionSet : ScriptableObject{ [NonSerialized] protected static VRActiveActionSet_t[] activeActionSets;
[NonSerialized] protected static List<VRActiveActionSet_t> activeActionSetsList = new List<VRActiveActionSet_t>();
[NonSerialized] protected VRActiveActionSet_t actionSet = new VRActiveActionSet_t();
public SteamVR_Action[] allActions; public SteamVR_Action_In[] nonVisualInActions; public SteamVR_Action_In[] visualActions; public SteamVR_Action_Pose[] poseActions; public SteamVR_Action_Skeleton[] skeletonActions; public SteamVR_Action_Out[] outActionArray;
//The full path to this action set(ex: /actions/in/default)(立钻哥哥:此操作集的完整路径(例如:/actions/in/default)) public string fullPath; public string usage;
[NonSerialized] public ulong handle;
[NonSerialized] protected bool setIsActive = false;
[NonSerialized] protected float lastChanged = -1;
[NonSerialized] protected static uint activeActionSetSize;
public void Initialize(){} public bool IsActive(){} public float GetTimeLastChanged(){}
//Activate this set as a primary action set so its actions can be called.(立钻哥哥:将此集激活为主要操作集,以便调用其操作。) public void ActivatePrimary(bool disableAllOtherActionSets = false){}
//Activate this set as a secondary action set so its actions can be called.(立钻哥哥:将此集激活为辅助操作集,以便可以调用它的操作。) public void ActivateSecondary(bool disableAllOtherActionSets = false){}
//Deactivate the action set so its actions can no longer be called.(立钻哥哥:停用操作集,这样它的操作就不能再被调用。) public void Deactivate(){}
//Disable all known action sets.(立钻哥哥:禁用所有已知的操作集。) public static void DisableAllActionSets(){}
protected static void UpdateActionSetArray(){}
[NonSerialized] protected static int lastFrameUpdated; public static void UpdateActionSetsState(bool force = false){}
[NonSerialized] private string cachedShortName;
//Gets the last part of the path for this action. Remove “actions” and direction. public string GetShortName(){}
} //立钻哥哥:public class SteamVR_ActionSet:ScriptableObject{} } //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_ActivateActionSetOnLoad.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_ActivateActionSetOnLoad.cs
using UnityEngine; using System.Collections;
namespace Valve.VR{ //Automatically activates an action set on Start() and deactivates the set on OnDestroy(). Optionally deactivating all other sets as well.(立钻哥哥:自动激活Start()和OnDestroy()上的设置。也可以选择停用所有其他设置。) public class SteamVR_ActivateActionSetOnLoad : MonoBehaviour{ [SteamVR_DefaultActionSet(“default”)] public SteamVR_ActionSet actionSet;
public bool disableAllOtherActionSets = false; public bool activateOnStart = ture; public bool deactivateOnDestroy = true;
private void Start(){} private void OnDestroy(){}
} //立钻哥哥:public class SteamVR_ActivateSetOnLoad:MonoBehaviour{} } //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_Behaviour_Boolean.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Behaviour_Boolean.cs
using System; using System.Collections.Generic; using System.Text; using UnityEngine; using UnityEngine.Events;
namespace Valve.VR{ //This component simplifies using boolean actions. Provides editor accessible events: onPress, onPressDown, onPressUp, onChange, and onUpdate.(立钻哥哥:这个组件简化了布尔操作。提供编辑器可访问的事件:onPress、onPressDown、onpressure、onChange和onUpdate。) public class SteamVR_Behaviour_Boolean : MonoBehaviour{ public SteamVR_Action_Boolean booleanAction;
[Tooltip(“The device this action should apply to. Any if the action is not device specific.(立钻哥哥:此操作应应用于的设备。如果操作不是特定于设备的,则为Any。)”)] public SteamVR_Behaviour_BooleanEvent onChange;
public SteamVR_Behaviour_BooleanEvent onUpdate; public SteamVR_Behaviour_BooleanEvent onPress; public SteamVR_Behaviour_BooleanEvent onPressDown; public SteamVR_Behaviour_BooleanEvent onPressUp;
//Returns true if this action is currently bound and its action set is active.(立钻哥哥:如果该操作当前被绑定且其操作集是活动的,则返回true。) public bool isActive{}
//Returns the action set that this action is in.(立钻哥哥:返回此操作所在的操作集。) public SteamVR_ActionSet actionSet{}
protected virtual void OnEnable(){} protected virtual void OnDisable(){} protected virtual void ActionUpdated(SteamVR_Action_In action){}
} //立钻哥哥:public class SteamVR_Behaviour_Boolean:MonoBehaviour{}
[Serializable] public class SteamVR_Behaviour_BooleanEvent : UnityEvent<SteamVR_Action_Boolean>{}
} //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_Behaviour_Pose.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Behaviour_Pose.cs
using System; using System.Threading; using UnityEngine; using UnityEngine.Events; using Valve.VR;
namespace Valve.VR{ //This component simplifies the use of Pose actions. Adding it to a gameObject will auto set that transform’s position and rotation every update to match the pose. Advanced velocity estimation is also handled through a buffer of the last 30 updates.(立钻哥哥:这个组件简化了姿势动作的使用。将其添加到gameObject(游戏物体)将自动设置转换的位置,并在每次更新时旋转以匹配姿势。高级速度估计也通过最近30次更新的缓冲区来处理。) public class SteamVR_Behaviour_Pose : MonoBehaviour{ [SteamVR_DefaultAction(“Pose”)] public SteamVR_Action_Pose poseAction;
[Tooltip(“The device this action should apply to. Any if the action is not device specific.(立钻哥哥:此操作应应用于的设备。如果操作不是特定于设备的,则为Any。)”)] public SteamVR_Input_Sources inputSource;
public Transform origin;
public bool isValid{} public bool isActive{}
public SteamVR_Behaviour_PoseEvent onTransformUpdated; public SteamVR_Behaviour_PoseEvent onTransformChanged; public SteamVR_Behaviour_PoseEvent onConnectedChanged; public SteamVR_Behaviour_PoseEvent onTrackingChanged;
protected int deviceIndex = -1;
protected SteamVR_HistoryBuffer historyBuffer = new SteamVR_HistoryBuffer(30);
protected virtual void Start(){} protected virtual void OnDeviceConnectedChanged(SteamVR_Action_Pose changedAction){} protected virtual void OnTrackingChanged(SteamVR_Action_Pose changedAction){} protected virtual void CheckDeviceIndex(){}
//Returns the device index for the device bound to the pose.(立钻哥哥:返回绑定到该姿势的设备的设备索引。) public int GetDeviceIndex(){}
protected virtual void OnEnable(){} protected virtual void OnDisable(){}
//Returns the current velocity of the pose(as of the last update.)(立钻哥哥:返回姿势的当前速度(在上次更新时)。) public Vector3 GetVelocity(){} public Vector3 GetAngularVelocity(){}
//Returns the velocities of the pose at the time specified. Can predict in the future or return past values.(立钻哥哥:返回指定时间的姿态速度。可以预测未来或返回过去的值。) public bool GetVelocitiesAtTimeOffset(float secondsFromNow, out Vector3 velocity, out Vector3 angularVelocity){}
protected void UpdateHistoryBuffer(){}
//Uses previously recorded values to find the peak speed of the pose and returns the corresponding velocity and angular velocity.(立钻哥哥:使用先前记录的值来找到位姿的峰值速度,并返回相应的速度和角速度。) public void GetEstimatedPeakVelocities(out Vector3 velocity, out Vector3 angularVelocity){}
private void SteamVR_Input_OnPosesUpdated(bool obj){} protected virtual void Update(){}
} //立钻哥哥:public class SteamVR_Behavour_Pose:MonoBehaviour{}
[Serializable] public class SteamVR_Behaviour_PoseEvent : UnityEvent<SteamVR_Action_Pose>{}
} //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_Behaviour_Single.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Behaviour_Single.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; using UnityEngine.Events;
namespace Valve.VR{ //SteamVR_Behaviour_Single simplifies the use of single actions. It gives an event to subscribe to for when the action has changed.(立钻哥哥:steamvr_behavioral _single简化了单个操作的使用。当操作发生更改时,它提供一个要订阅的事件。) public class SteamVR_Behaviour_Single : MonoBehaviour{
} //立钻哥哥:public class SteamVR_Behaviour_Single:MonoBehaviour{}
[Serializable] public class SteamVR_Behaviour_SingleEvent : UnityEvent<SteamVR_Action_Single>{}
} //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_Behaviour_Skeleton.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Behaviour_Skeleton.cs
using System.Collections; using UnityEngine; using Valve.VR;
namespace Valve.VR{ public class SteamVR_Behaviour_Skeleton : MonoBehaviour{ //The action this component will use to update the model. Must be a Skeleton type action.(立钻哥哥:此组件将用于更新模型的操作。必须是骨架类型的动作。) [SteamVR_DefaultAction(“Skeleton”, “default”, “inputSource”)] public SteamVR_Action_Skeleton skeletonAction;
[Tooltip(“The device this action should apply to. Any if the action is not device specific.”)] public SteamVR_Input_Sources inputSource;
[Tooltip(“The range of motion you’d like the hand to move in. With controller is the best estimate of the fingers wrapped around a controller. Without is from a flat hand to a fist.(立钻哥哥:你希望手移动的范围。用控制器是手指缠绕在控制器上的最佳估计值。没有是从平的手到拳头。)”)] public EVRSkeletalMotionRange rangeOfMotion = EVRSkeletalMotionRange.WithoutController;
//The root Transform of the skeleton. Needs to have a child(wrist) then wrist should have children in the order thumb, index, middle, ring, pinky.(立钻哥哥:骨架的根变换。需要有一个孩子(手腕)那么手腕应该有孩子的顺序拇指,食指,中指,戒指,小指。) [Tooltip(“This needs to be in the order of: root -> wrist -> thumb, index, middle, ring, pinky”)] public Transform skeletonRoot;
//The transform this transform should be relative to.(立钻哥哥:这个变换应该是相对的。) [Tooltip(“If not set, relative to parent.”)] public Transform origin;
//Whether or not to update this transform’s position and rotation inline with the skeleton transforms or if this is handled in another script.(立钻哥哥:是否与骨架转换一起更新此转换的位置和旋转,或者是否在另一个脚本中处理此转换。) [Tooltip(“Set to true if you want this script to update its position and rotation. False if this will be handled elsewhere.(立钻哥哥:如果您希望此脚本更新其位置和旋转,请将其设置为true。如果将在其他地方处理,则为False。)”)] public bool updatePose = true;
[Tooltip(“Check this to not set the positions of the bones. This is helpful for differently scaled skeletons.(立钻哥哥:检查一下,不要让骨头的位置固定。这对于不同比例的骨架是有帮助的。)”)] public bool onlySetRotations = false;
//How much of a blend to apply to the transform positions and rotations. Set to 0 for the transform orientation to be set by an animation. Set to 1 for the transform orientation to be set by the skeleton action.(立钻哥哥:有多少混合应用于变换位置和旋转。为动画要设置的转换方向设置为0。将骨架动作要设置的转换方向设置为1。) [Range(0, 1)] [Tooltip(“Modify this to blend between animations setup on the hand.(立钻哥哥:修改这一点,以混合之间的动画设置在手上。)”)] public float skeletonBlend = 1f;
//Can be set to mirror the bone data across the x axis.(立钻哥哥:可设置为在x轴上镜像骨骼数据。) [Tooltip(“Is this rendermodel a mirror of another one?”)] public MirrorType mirroring;
public bool isActive{}
public Transform root{} public Transform wrist{} public Transform indexMetacarpal{} public Transform indexProximal{} public Transform indexMiddle{} public Transform indexDistal{} public Transform indexTip{} public Transform middleMetacarpal{} public Transform middleProximal{} public Transform middleMiddle{} public Transform middleDistal{} public Transform middleTip{} public Transform pinkyMetacarpal{} public Transform pinkyProximal{} public Transform pinkyMiddle{} public Transform pinkyDistal{} public Transform pinkyTip{} public Transform ringMetacarpal{} public Transform ringProximal{} public Transform ringMiddle{} public Transform ringDistal{} public Transform ringTip{} public Transform thumbMetacarpal{} public Transform thumbProximal{} public Transform thumbMiddle{} public Transform thumbDistal{} public Transform thumbTip{} public Transform thumbAux{} public Transform indexAux{} public Transform middleAux{} public Transform ringAux{} public Transform pinkyAux{}
//An array of all the finger proximal joint transforms.(立钻哥哥:所有手指近端关节变换的数组。) public Transform[] proximals{}
//An array of all the finger middle joint transforms.(立钻哥哥:所有手指中间关节变换的数组。) public Transform[] middles{}
//An array of all the finger distal joint transforms.(立钻哥哥:所有手指远端关节变换的数组。) public Transform[] distals{}
//An array of all the finger tip transforms.(立钻哥哥:所有指尖变换的数组。) public Transform[] tips{}
//An array of all the finger aux transforms.(立钻哥哥:所有手指辅助变换的数组。) public Transform[] auxs{}
protected Coroutine blendRoutine; protected Coroutine rangeOfMotionBlendRoutine; protected Transform[] bones;
//The range of motion that is set temporarily (Call ResetTemporaryRangeOfMotion to reset to rangeOfMotion).(立钻哥哥:临时设置的运动范围(调用ResetTemporaryRangeOfMotion将其重置为rangeOfMotion)。) protected EVRSkeletalMotionRange? temporaryRangeOfMotion = null;
//Returns true if we are in the process of blending the skeletonBlend field (between animation and bone data).(立钻哥哥:如果我们正在混合骨架混合字段(在动画和骨骼数据之间),返回true。) public bool isBlending{}
protected virtual void Awake(){} protected virtual void AssignBonesArray(){} protected virtual void OnEnable(){} protected virtual void OnDisable(){} protected virtual void SteamVR_Input_OnSkeletonsUpdated(bool obj){} protected virtual void UpdateSkeleton(){}
//Sets a temporary range of motion for this action that can easily be reset (using ResetTemporaryRangeOfMotion). This is useful for short range of motion changes, for example picking up a controller shaped object.(立钻哥哥:为这个动作设置一个可以轻松重置的临时动作范围(使用ResetTemporaryRangeOfMotion)。这对于短范围的运动变化是有用的,例如拾取一个控制器形状的对象。) public void SetTemporaryRangeOfMotion(EVRSkeletalMotionRange newRangeOfMotion, float blendOverSeconds=0.1f){}
//Resets the previously set temporary range of motion. Will return to the range of motion defined by the rangeOfMotion field.(立钻哥哥:重置先前设置的临时运动范围。将返回到由rangeOfMotion字段定义的运动范围。) public void ResetTemporaryRangeOfMotion(float blendOverSeconds=0.1f){}
//Permanently sets the range of motion for this component.(立钻哥哥:永久设置此组件的运动范围。) //@param newRangeOfMotion:The new range of motion to be set. WithController being the best estimation of where fingers are wrapped around the controller (pressing buttons, etc). WithoutController being a range between a flat hand and a fist.(立钻哥哥:设置新的运动范围。控制器是对手指缠绕在控制器上的位置(按下按钮等)的最佳估计。没有控制器是一个介于平手和拳头之间的范围。) //@param blendOverSeconds:How long you want the blend to the new range of motion to take (in seconds).(立钻哥哥:你希望混合到新的运动范围需要多长时间(以秒为单位)。) public void SetRangeOfMotion(){}
//Blend from the current skeletonBlend amount to full bone data. (skeletonBlend = 1)(立钻哥哥:从当前骨骼混合到完整的骨骼数据。(skeletonBlend = 1)) public void BlendToSkeleton(float overTime=0.1f){}
//Blend from the current skeletonBlend amount to full animation data (no bone data. skeletonBlend = 0)(立钻哥哥:从当前骨骼混合到完整的动画数据(没有骨骼数据)。skeletonBlend = 0)) public void BlendToAnimation(float overTime=0.1f){}
//Blend from the current skeletonBlend amount to a specified new amount.(立钻哥哥:从当前骨架混合量到指定的新混合量。) public void BlendTo(float blendToAmount, float overTime){}
protected IEnumerator DoBlendRoutine(float blendToAmount, float overTime){} protected void RangeOfMotionBlend(EVRSkeletalMotionRange newRangeOfMotion, float blendOverSeconds){} protected void TemporaryRangeOfMotionBlend(EVRSkeletalMotionRange newRangeOfMotion, float blendOverSeconds){} protected void ResetTemporaryRangeOfMotionBlend(float blendOverSeconds){} protected IEnumerator DoRangeOfMotionBlend(EVRSkeletalMotionRange oldRangeOfMotion, EVRSkeletalMotionRange newRangeOfMotion, float overTime){} protected virtual void UpdateSkeletonTransforms(){} protected virtual void SetBonePosition(int boneIndex, Vector3 localPosition){} protected virtual void SetBoneRotation(int boneIndex, Quaternion localRotation){}
//Gets the transform for a bone by the joint index. Joint indexes specified in: SteamVR_Skeleton_JointIndexes. (立钻哥哥:通过关节指数得到骨头的变换。在:steamvr_skeleton on_joint索引中指定的联合索引。) public virtual Transform GetBone(int joint){} public Vector3 GetBonePosition(int joint, bool local=false){} public Vector3 GetBoneRotation(int joint, bool local=false){} protected Vector3[] GetBonePositions(SteamVR_Input_Sources inputSource){}
protected Quaternion rightFlipAngle = Quaternion.AngleAxis(180, Vector3.right); protected Quaternion[] GetBoneRotations(SteamVR_Input_Sources inputSource){}
protected virtual void UpdatePose(){}
public enum MirrorType{ None, LeftToRight, RightToLeft } //立钻哥哥:public enum MirrorType{}
protected bool IsMetacarpal(int boneIndex){}
} //立钻哥哥:public class SteamVR_Behaviour_Skeleton:MonoBehaviour{}
//The order of the joints that SteamVR Skeleton Input is expecting.(立钻哥哥:SteamVR骨架输入所期望的关节顺序。) public class SteamVR_Skeleton_JointIndexes{ public const int root = 0; public const int wrist = 1; public const int thumbMetacarpal = 2; public const int thumbProximal = 2; public const int thumbMiddle = 3; public const int thumbDistal = 4; public const int thumbTip = 5; public const int indexMetacarpal = 6; public const int indexProximal = 7; public const int indexMiddle = 8; public const int indexDistal = 9; public const int indexTip = 10; public const int middleMetacarpal = 11; public const int middleProximal = 12; public const int middleMiddle = 13; public const int middleDistal = 14; public const int middleTip = 15; public const int ringMetacarpal = 16; public const int ringProximal = 17; public const int ringMiddle = 18; public const int ringDistal = 19; public const int ringTip = 20; public const int pinkyMetacarpal = 21; public const int pinkyProximal = 22; public const int pinkyMiddle = 23; public const int pinkyDistal = 24; public const int pinkyTip = 25; public const int thumbAux = 26; public const int indexAux = 27; public const int middleAux = 28; public const int ringAux = 29; public const int pinkyAux = 30; } //立钻哥哥:public class SteamVR_Skeleton_JointIndexes{}
public enum SteamVR_Skeleton_JointIndexEnum{ root = SteamVR_Skeleton_JointIndexes.root, wrist = SteamVR_Skeleton_JointIndexes.wrist, thumbMetacarpal = SteamVR_Skeleton_JointIndexes.thumbMetacarpal, thumbProximal = SteamVR_Skeleton_JointIndexes.thumbProximal, thumbMiddle = SteamVR_Skeleton_JointIndexes.thumbMiddle, thumbDistal = SteamVR_Skeleton_JointIndexes.thumbDistal, thumbTip = SteamVR_Skeleton_JointIndexes.thumbTip, indexMetacarpal = SteamVR_Skeleton_JointIndexes.indexMetacarpal, indexProximal = SteamVR_Skeleton_JointIndexes.indexProximal, indexMiddle = SteamVR_Skeleton_JointIndexes.indexMiddle, indexDistal = SteamVR_Skeleton_JointIndexes.indexDistal, indexTip = SteamVR_Skeleton_JointIndexes.indexTip, middleMetacarpal = SteamVR_Skeleton_JointIndexes.middleMetacarpal, middleProximal = SteamVR_Skeleton_JointIndexes.middleProximal, middleMiddle = SteamVR_Skeleton_JointIndexes.middleMiddle, middleDistal = SteamVR_Skeleton_JointIndexes.middleDistal, middleTip = SteamVR_Skeleton_JointIndexes.middleTip, ringMetacarpal = SteamVR_Skeleton_JointIndexes.ringMetacarpal, ringProximal = SteamVR_Skeleton_JointIndexes.ringProximal, ringMiddle = SteamVR_Skeleton_JointIndexes.ringMiddle, ringDistal = SteamVR_Skeleton_JointIndexes.ringDistal, ringTip = SteamVR_Skeleton_JointIndexes.ringTip, pinkyMetacarpal = SteamVR_Skeleton_JointIndexes.pinkyMetacarpal, pinkyProximal = SteamVR_Skeleton_JointIndexes.pinkyProximal, pinkyMiddle = SteamVR_Skeleton_JointIndexes.pinkyMiddle, pinkyDistal = SteamVR_Skeleton_JointIndexes.pinkyDistal, pinkyTip = SteamVR_Skeleton_JointIndexes.pinkyTip, thumbAux = SteamVR_Skeleton_JointIndexes.thumbAux, indexAux = SteamVR_Skeleton_JointIndexes.indexAux, middleAux = SteamVR_Skeleton_JointIndexes.middleAux, ringAux = SteamVR_Skeleton_JointIndexes.ringAux, pinkyAux = SteamVR_Skeleton_JointIndexes.pinkyAux, } //立钻哥哥:public enum SteamVR_Skeleton_JointIndexEnum{}
} //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_Behaviour_SkeletonCustom.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Behaviour_SkeletonCustom.cs
using UnityEngine; using Valve.VR;
namespace Valve.VR{ //The major difference between the component and the standard SteamVR_Behaviour_Skeleton is this one lets you only use the joints you care about. You can set the transforms you’re concerned with and ignore the ones you’re not.(立钻哥哥:组件和标准steamvr_behavi_skeleton之间的主要区别是,这个组件只允许您使用您所关心的关节。您可以设置关心的转换,忽略不关心的转换。) public class SteamVR_Behaviour_SkeletonCustom : SteamVR_Behaviour_Skeleton{ [SerializeField] protected Transform _wrist;
[SerializeField] protected Transform _thumbMetacarpal;
[SerializeField] protected Transform _thumbProximal;
[SerializeField] protected Transform _thumbMiddle;
[SerializeField] protected Transform _thumbDistal;
[SerializeField] protected Transform _thumbTip;
[SerializeField] protected Transform _thumbAux;
[SerializeField] protected Transform _indexMetacarpal;
[SerializeField] protected Transform _indexProximal;
[SerializeField] protected Transform _indexMiddle;
[SerializeField] protected Transform _indexDistal;
[SerializeField] protected Transform _indexTip;
[SerializeField] protected Transform _indexAux;
[SerializeField] protected Transform _middleMetacarpal;
[SerializeField] protected Transform _middleProximal;
[SerializeField] protected Transform _middleMiddle;
[SerializeField] protected Transform _middleDistal;
[SerializeField] protected Transform _middleTip;
[SerializeField] protected Transform _middleAux;
[SerializeField] protected Transform _ringMetacarpal;
[SerializeField] protected Transform _ringProximal;
[SerializeField] protected Transform _ringMiddle;
[SerializeField] protected Transform _ringDistal;
[SerializeField] protected Transform _ringTip;
[SerializeField] protected Transform _ringAux;
[SerializeField] protected Transform _pinkyMetacarpal;
[SerializeField] protected Transform _pinkyProximal;
[SerializeField] protected Transform _pinkyMiddle;
[SerializeField] protected Transform _pinkyDistal;
[SerializeField] protected Transform _pinkyTip;
[SerializeField] protected Transform _pinkyAux;
protected override void AssignBonesArray(){}
} //立钻哥哥:public class SteamVR_Behaviour_SkeletonCustom{} } //立钻哥哥:namesapce Valve.VR{} |
++SteamVR/Input/SteamVR_Behaviour_Vector2.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Behaviour_Vector2.cs
using System; using System.Collecitons.Generic; using System.Linq; using System.Text; using UnityEngine; using UnityEngine.Events;
namespace Valve.VR{ //Simplifies the use of the Vector2 action. Provides an onChange event that fires whenever the Vector2 changes.(立钻哥哥:简化Vector2操作的使用。提供一个onChange事件,该事件在Vector2发生更改时触发。) public class SteamVR_Behaviour_Vector2 : MonoBehaviour{ //The Vector2 action to get data from.(立钻哥哥:获取数据的Vector2操作。) public SteamVR_Action_Vector2 vector2Action;
[Tooltip(“The device this action should apply to. Any if the action is not device specific.”)] public SteamVR_Input_Sources inputSource;
[Tooltip(“Fires whenever the action’s value has changed since the last updates.(立钻哥哥:自上次更新以来,每当操作值发生更改时触发。)”)] public SteamVR_Behaviour_Vector2Event onChange;
//Returns whether this action is bound and the action set is active.(立钻哥哥:返回此操作是否已绑定且该操作集是否活动。) public bool isActive{}
private void OnEnable(){} private void OnDisable(){} private void ActionChanged(SteamVR_Action_In action){}
} //立钻哥哥:public class SteamVR_Behaviour_Vector2:MonoBehaviour{}
[Serializable] public class SteamVR_Behaviour_Vector2Event : UnityEvent<SteamVR_Action_Vector2>{};
} //立钻哥哥:namespace Valve.VR{} |
++SteamVR/Input/SteamVR_Behaviour_Vector3.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_Behaviour_Vector3.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; using UnityEngine.Events;
namespace Valve.VR{ public class SteamVR_Behaviour_Vector3 : MonoBehaviour{ public SteamVR_Action_Vector3 vector3Action;
[Tooltip(“The device this action should apply to. Any if the action is not device specific.”)] public SteamVR_Input_Sources inputSource;
[Tooltip(“Fires whenever the action’s value has changed since the last update.”)] public SteamVR_Behaviour_Vector3Event onChange;
public bool isActive{} private void OnEnable(){} private void OnDisable(){} private void ActionChanged(SteamVR_Action_In action){}
} //立钻哥哥:public class SteamVR_Behaviour_Vector3:MonoBehaviour{}
[Serializable] public class SteamVR_Behaviour_Vector3Event : UnityEvent<SteamVR_Action_Vector3>{}
} //立钻哥哥:namespace Valve.VR{} |
???????????????????????????????????????????????????
++SteamVR/Input/SteamVR_DefaultAction.cs
++++立钻哥哥:\Assets\SteamVR\Input\SteamVR_DefaultAction.cs
Using UnityEngine; Using System.Collections; Using System; Using System.Reflection; Using System.Text; Using System.Linq;
Namespace Valve.VR{ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] Public class SteamVR_DefaultAction : System.Attribute{ Public string actionName; Public string actionSetName; Public string inputSourceFieldName; Public SteamVR_ActionDirections? Direction; Public bool overrideExistingOnGeneration;
//Sets up
} //立钻哥哥:public class SteamVR_DefaultAction:System.Attribute{} } //立钻哥哥:namespace Valve.VR{} |
++立钻哥哥推荐的拓展学习链接(Link_Url):
立钻哥哥推荐的拓展学习链接(Link_Url) |
++++立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz/
++++HTC_VIVE开发基础:https://blog.csdn.net/VRunSoftYanlz/article/details/81989970
++++Oculus杂谈:https://blog.csdn.net/VRunSoftYanlz/article/details/82469850
++++Oculus安装使用:https://blog.csdn.net/VRunSoftYanlz/article/details/82718982
++++SteamVR简介:https://blog.csdn.net/VRunSoftYanlz/article/details/86484254
++++SteamVR脚本功能分析:https://blog.csdn.net/VRunSoftYanlz/article/details/86531480
++++SteamVR/Extras:https://blog.csdn.net/VRunSoftYanlz/article/details/86584108
++++SteamVR/Input:https://blog.csdn.net/VRunSoftYanlz/article/details/86601950
++++OpenXR简介:https://blog.csdn.net/VRunSoftYanlz/article/details/85726365
++++VRTK杂谈:https://blog.csdn.net/VRunSoftYanlz/article/details/82562993
++++VRTK快速入门(杂谈):https://blog.csdn.net/VRunSoftYanlz/article/details/82955267
++++VRTK官方示例(目录):https://blog.csdn.net/VRunSoftYanlz/article/details/82955410
++++VRTK代码结构(目录):https://blog.csdn.net/VRunSoftYanlz/article/details/82780085
++++VRTK(SceneResources):https://blog.csdn.net/VRunSoftYanlz/article/details/82795400
++++VRTK_ControllerEvents:https://blog.csdn.net/VRunSoftYanlz/article/details/83099512
++++VRTK_InteractTouch:https://blog.csdn.net/VRunSoftYanlz/article/details/83120220
++++VR实验:以太网帧的构成:https://blog.csdn.net/VRunSoftYanlz/article/details/82598140
++++FrameVR示例V0913:https://blog.csdn.net/VRunSoftYanlz/article/details/82808498
++++FrameVR示例V1003:https://blog.csdn.net/VRunSoftYanlz/article/details/83066516
++++SwitchMachineV1022:https://blog.csdn.net/VRunSoftYanlz/article/details/83280886
++++PlaySceneManagerV1022:https://blog.csdn.net/VRunSoftYanlz/article/details/83280886
++++Unity5.x用户手册:https://blog.csdn.net/VRunSoftYanlz/article/details/81712741
++++Unity面试题ABC:https://blog.csdn.net/vrunsoftyanlz/article/details/78630687
++++Unity面试题D:https://blog.csdn.net/VRunSoftYanlz/article/details/78630838
++++Unity面试题E:https://blog.csdn.net/vrunsoftyanlz/article/details/78630913
++++Unity面试题F:https://blog.csdn.net/VRunSoftYanlz/article/details/78630945
++++Cocos2dx面试题:https://blog.csdn.net/VRunSoftYanlz/article/details/78630967
++++禅道[zentao]:https://blog.csdn.net/VRunSoftYanlz/article/details/83964057
++++Lua快速入门篇(Xlua拓展):https://blog.csdn.net/VRunSoftYanlz/article/details/81173818
++++Lua快速入门篇(XLua教程):https://blog.csdn.net/VRunSoftYanlz/article/details/81141502
++++Lua快速入门篇(基础概述):https://blog.csdn.net/VRunSoftYanlz/article/details/81041359
++++框架知识点:https://blog.csdn.net/VRunSoftYanlz/article/details/80862879
++++游戏框架(UI框架夯实篇):https://blog.csdn.net/vrunsoftyanlz/article/details/80781140
++++游戏框架(初探篇):https://blog.csdn.net/VRunSoftYanlz/article/details/80630325
++++设计模式简单整理:https://blog.csdn.net/vrunsoftyanlz/article/details/79839641
++++专题:设计模式(精华篇):https://blog.csdn.net/VRunSoftYanlz/article/details/81322678
++++U3D小项目参考:https://blog.csdn.net/vrunsoftyanlz/article/details/80141811
++++Unity案例(Vehicle):https://blog.csdn.net/VRunSoftYanlz/article/details/82355876
++++UML类图:https://blog.csdn.net/vrunsoftyanlz/article/details/80289461
++++PowerDesigner简介:https://blog.csdn.net/VRunSoftYanlz/article/details/86500084
++++Unity知识点0001:https://blog.csdn.net/vrunsoftyanlz/article/details/80302012
++++Unity知识点0008:https://blog.csdn.net/VRunSoftYanlz/article/details/81153606
++++U3D_Shader编程(第一篇:快速入门篇):https://blog.csdn.net/vrunsoftyanlz/article/details/80372071
++++U3D_Shader编程(第二篇:基础夯实篇):https://blog.csdn.net/vrunsoftyanlz/article/details/80372628
++++Unity引擎基础:https://blog.csdn.net/vrunsoftyanlz/article/details/78881685
++++Unity面向组件开发:https://blog.csdn.net/vrunsoftyanlz/article/details/78881752
++++Unity物理系统:https://blog.csdn.net/vrunsoftyanlz/article/details/78881879
++++Unity2D平台开发:https://blog.csdn.net/vrunsoftyanlz/article/details/78882034
++++UGUI基础:https://blog.csdn.net/vrunsoftyanlz/article/details/78884693
++++UGUI进阶:https://blog.csdn.net/vrunsoftyanlz/article/details/78884882
++++UGUI综合:https://blog.csdn.net/vrunsoftyanlz/article/details/78885013
++++Unity动画系统基础:https://blog.csdn.net/vrunsoftyanlz/article/details/78886068
++++Unity动画系统进阶:https://blog.csdn.net/vrunsoftyanlz/article/details/78886198
++++Navigation导航系统:https://blog.csdn.net/vrunsoftyanlz/article/details/78886281
++++Unity特效渲染:https://blog.csdn.net/vrunsoftyanlz/article/details/78886403
++++Unity数据存储:https://blog.csdn.net/vrunsoftyanlz/article/details/79251273
++++Unity中Sqlite数据库:https://blog.csdn.net/vrunsoftyanlz/article/details/79254162
++++WWW类和协程:https://blog.csdn.net/vrunsoftyanlz/article/details/79254559
++++Unity网络:https://blog.csdn.net/vrunsoftyanlz/article/details/79254902
++++C#事件:https://blog.csdn.net/vrunsoftyanlz/article/details/78631267
++++C#委托:https://blog.csdn.net/vrunsoftyanlz/article/details/78631183
++++C#集合:https://blog.csdn.net/vrunsoftyanlz/article/details/78631175
++++C#泛型:https://blog.csdn.net/vrunsoftyanlz/article/details/78631141
++++C#接口:https://blog.csdn.net/vrunsoftyanlz/article/details/78631122
++++C#静态类:https://blog.csdn.net/vrunsoftyanlz/article/details/78630979
++++C#中System.String类:https://blog.csdn.net/vrunsoftyanlz/article/details/78630945
++++C#数据类型:https://blog.csdn.net/vrunsoftyanlz/article/details/78630913
++++Unity3D默认的快捷键:https://blog.csdn.net/vrunsoftyanlz/article/details/78630838
++++游戏相关缩写:https://blog.csdn.net/vrunsoftyanlz/article/details/78630687
++++UnityAPI.Rigidbody刚体:https://blog.csdn.net/VRunSoftYanlz/article/details/81784053
++++UnityAPI.Material材质:https://blog.csdn.net/VRunSoftYanlz/article/details/81814303
++++UnityAPI.Android安卓:https://blog.csdn.net/VRunSoftYanlz/article/details/81843193
++++UnityAPI.AndroidJNI安卓JNI:https://blog.csdn.net/VRunSoftYanlz/article/details/81879345
++++UnityAPI.Transform变换:https://blog.csdn.net/VRunSoftYanlz/article/details/81916293
++++UnityAPI.WheelCollider轮碰撞器:https://blog.csdn.net/VRunSoftYanlz/article/details/82356217
++++UnityAPI.Resources资源:https://blog.csdn.net/VRunSoftYanlz/article/details/83155518
++++JSON数据结构:https://blog.csdn.net/VRunSoftYanlz/article/details/82026644
++++CocosStudio快速入门:https://blog.csdn.net/VRunSoftYanlz/article/details/82356839
++++Unity企业内训(目录):https://blog.csdn.net/VRunSoftYanlz/article/details/82634668
++++Unity企业内训(第1讲):https://blog.csdn.net/VRunSoftYanlz/article/details/82634733
++++Unity企业内训(第2讲):https://blog.csdn.net/VRunSoftYanlz/article/details/82861180
++++Unity企业内训(第3讲):https://blog.csdn.net/VRunSoftYanlz/article/details/82927699
++++Unity企业内训(第4讲):https://blog.csdn.net/VRunSoftYanlz/article/details/83479776
++++Unity企业内训(第5讲):https://blog.csdn.net/VRunSoftYanlz/article/details/83963811
++++Unity企业内训(第6讲):https://blog.csdn.net/VRunSoftYanlz/article/details/84207696
++++插件
++++计算机组成原理(教材篇):https://blog.csdn.net/VRunSoftYanlz/article/details/82719129
++++立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz/
--_--VRunSoft:lovezuanzuan--_--