Skip to main content
Participant
July 13, 2017

Button Touch State and/or Custom finger poses added to default localAvatar

Hi,

I am trying to find a way to get the "button touch state" in Unity of the touch controller through code. Right now I am only seeing this available in the PC SDK section. Can someone help me out here, I would like to make custom finger poses based on whether that value is null or not?

If getting the touch controllers button touch state is only available in C++ is there a way for me to ad my custom finger poses to the already default ones without disabling those? Right now a solution I had was to use the animation tool in conjunction with the grip pose scene and save those alterations out to the animator and call those animations out in script based on button presses. However this is disabling the default animations, from what I can see, when you add this to the local avatar custom pose slot.

Any help would be appreciated.

Thanks!
This topic has been closed for replies.

2 replies

chololensAuthor
Participant
July 14, 2017
A little update. You can toggle between the default hand gestures and custom poses without having the custom pose slot override the default ones by adding a restriction in the OvrAvatar script under the Void UpdateCustomPoses() method. In there change this 
if (sdkAvatar != IntPtr.Zero)
{

{
if (cachedLeftHandCustomPose != null && UpdateTransforms(cachedLeftHandJoints, cachedLeftHandTransforms))
{
CAPI.ovrAvatar_SetLeftHandCustomGesture(sdkAvatar, (uint)cachedLeftHandTransforms.Length, cachedLeftHandTransforms);
}
}
to something like this for example

if (sdkAvatar != IntPtr.Zero)
{
if (Input.GetKeyDown(KeyCode.A))
{
if (cachedLeftHandCustomPose != null && UpdateTransforms(cachedLeftHandJoints, cachedLeftHandTransforms))
{
CAPI.ovrAvatar_SetLeftHandCustomGesture(sdkAvatar, (uint)cachedLeftHandTransforms.Length, cachedLeftHandTransforms);
}
}
 


Participant
July 14, 2017
Hi,

You can refer to our documentation using OVRInput which is available with the Oculus Utilities for Unity:

https://developer.oculus.com/documentation/unity/latest/concepts/unity-ovrinput/#unity-ovrinput-usage

In particular see the section 'Button, Touch, and Near Touch'. You can use 
OVRInput.Get(OVRInput.Button.One); 
Which will return true of the 'A' button of the Touch controller is pressed.

You can also refer to the OVRInput API for more methods to access to the other buttons, thumbsticks and triggers of the Touch controller.

https://developer3.oculus.com/doc/1.16-unity/class_o_v_r_input.html
 





Please tag me, @juanoldinho, in your forum post/response if you need immediate assistance or want additional support or context on an issue you are having with our software or integrations. Having an issue with our platform, services, or integrations? Try using our new bug tool to report this and receive emailed updates as we proceed to address it internally.