MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / GetComponentState

Method GetComponentState

headers/openvr_api.cs:4038–4060  ·  view source on GitHub ↗
(string pchRenderModelName,string pchComponentName,ref VRControllerState_t pControllerState,ref RenderModel_ControllerMode_State_t pState,ref RenderModel_ComponentState_t pComponentState)

Source from the content-addressed store, hash-verified

4036 public _GetComponentStatePacked pGetComponentStatePacked;
4037 }
4038 public bool GetComponentState(string pchRenderModelName,string pchComponentName,ref VRControllerState_t pControllerState,ref RenderModel_ControllerMode_State_t pState,ref RenderModel_ComponentState_t pComponentState)
4039 {
4040 IntPtr pchRenderModelNameUtf8 = Utils.ToUtf8(pchRenderModelName);
4041 IntPtr pchComponentNameUtf8 = Utils.ToUtf8(pchComponentName);
4042#if !UNITY_METRO
4043 if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
4044 (System.Environment.OSVersion.Platform == System.PlatformID.Unix))
4045 {
4046 GetComponentStateUnion u;
4047 VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed(pControllerState);
4048 u.pGetComponentStatePacked = null;
4049 u.pGetComponentState = FnTable.GetComponentState;
4050 bool packed_result = u.pGetComponentStatePacked(pchRenderModelNameUtf8,pchComponentNameUtf8,ref state_packed,ref pState,ref pComponentState);
4051
4052 state_packed.Unpack(ref pControllerState);
4053 return packed_result;
4054 }
4055#endif
4056 bool result = FnTable.GetComponentState(pchRenderModelNameUtf8,pchComponentNameUtf8,ref pControllerState,ref pState,ref pComponentState);
4057 Marshal.FreeHGlobal(pchRenderModelNameUtf8);
4058 Marshal.FreeHGlobal(pchComponentNameUtf8);
4059 return result;
4060 }
4061 public bool RenderModelHasComponent(string pchRenderModelName,string pchComponentName)
4062 {
4063 IntPtr pchRenderModelNameUtf8 = Utils.ToUtf8(pchRenderModelName);

Callers

nothing calls this directly

Calls 2

ToUtf8Method · 0.80
UnpackMethod · 0.45

Tested by

no test coverage detected