GithubHelp home page GithubHelp logo

dabeschte / vrarmik Goto Github PK

View Code? Open in Web Editor NEW
156.0 13.0 19.0 63 KB

Unity Inverse Kinematics solution for arms in VR

License: MIT License

C# 96.36% ShaderLab 3.64%
vr arms animation inverse-kinematics virtual-reality unity unity3d

vrarmik's People

Contributors

dabeschte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vrarmik's Issues

Hands behind head isn't accurate and causes odd shoulder rotations

Hi again! I've been running into this issue consistently and have only managed to come up with hacky solutions that aren't quite ideal.

The problem is that when the "Hands Behind Head" bool switches to true, it occasionally doesn't switch back, despite the player holding their hands to neutral positions directly in front of them. This causes the shoulder to stay rotated to it's maximum value, causing all sorts of wonkiness. This can easily be replicated in the demo scene by drawing a circle around your head with only one hand. You essentially need to "unwind" the circle or throw both hands behind your head again to get the shoulder back to it's correct position and for the bool to switch back.

This is particularly frustrating as it can occur when climbing overhangs and using weapon holsters in the over-the-shoulder position. Any suggestions for better handling this?

shoulderrot

RotateShoulderUp calculation appears incorrect when forwardDistanceRatio is negative and distinctShoulderRotationLimitBackward is not 0

I've been working on porting your code to Unreal, and while looking through I found this code which looks wrong:

targetAngle.y = Mathf.Clamp(-(forwardDistanceRatio + 0.08f) * distinctShoulderRotationMultiplier * 10f,
-distinctShoulderRotationLimitBackward, 0f);

forwardDistanceRatio is guaranteed to be negative here, so flipping it and then clamping with a max of 0 will ensure that the yaw will be 0 if forwardDistanceRatio is less than -0.08.

Note that although it does appear that this line is incorrect, it doesn't matter as long as distinctShoulderRotationLimitBackward is 0.

public float distinctShoulderRotationLimitBackward = 0f;

If distinctShoulderRotationLimitBackward is not 0, the way the thresholds are set up, it would look something like this... (scaled to the appropriate limits and multipliers)
image

The discontinuity would cause a shoulder pop, I imagine...

Not working with the latest version of Unity XR

I can't seem to get the demo scene working with the latest Unity XR package (Unity 2019.4, XR plugin management version 3.2.16)
I noticed that The method:
UnityEngine.XR.InputTracking.GetLocalPosition(node)
is obsolete. This may be the cause of the issue?

Custom Scaling

Hi, thanks for developing this plugin!

I want to use it for a VR game where the player's camera rig will be scaled up. As a result the avatar and shoulder objects will have to be scaled to match, however this causes a lot of things to go wrong. Would it be possible to make your solution work at a scale of say, 15x on all axes?

Thanks in advance

Oculus Hands

Hello,

I love this plugin, and am trying to use it to build a VR game for Oculus Rift/Quest. I would like to use the Oculus hand prefabs with this plugin, but I don't know how to set them up without breaking it. It almost works right if I child the hand prefabs to the Hand transform in your supplied arm prefab, but when the editor runs the hands usually generate way out of place with no way to bring them back closer. Do you have any idea why that might be or have any experience working with the Oculus samples?

Thanks,
Joe

Avatar Facing Down

I know this problem was in the readme, but it was just explained so poorly. My problem is that the avatar is facing downwards which screws up the entire system. I need a better explanation on how to fix this. Thanks.

Full body avatar rotations won't rotate shoulders

Hi and thanks for the awesome asset! In my project I have the player set as the child of a moving object, specifically the cockpit of a ship. The ship is able to move and rotate freely, and the player follows its position perfectly, but when the ship rotates on the X and Z axes, the Shoulder object under the Avatar does not follow and instead remains vertically oriented in the world (so when the ship is upside down, the player's body now appears to be above their head). My desired behavior is for the entire avatar to stay locked to the ship's orientation (so if the player remains perfectly still while the ship does a flip, the avatar should remain perfectly fixed in place relative to the player's perspective). I've managed to get as far as locking the Shoulder's local X and Z rotations to the ship's orientation, but then the Shoulder will still rotate on it's local Y axis unexpectedly during flips. Do you have any tips or ideas on how this could be solved?

SteamVR glove hand replacement not behaving as desired

Hey, i'm having a similar issue with the SteamVR_Input as issue #2, i've replaced the original hand with the Steam_VR vr_glove prefab, attached a mesh collider to my vr_glove and now skeleton poses are working with the VRarmIK, my only issue is the glove is now deformed and at the wrong angle, do you have any recommendations to fix this? (I know the repository is not regularly supported but this may help someone in the future)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.