rollingrock / Fallout-4-VR-Body

Developing mod to add full body support with IK for Fallout 4 VR!
MIT License
45 stars 8 forks source link

Two handed weapons idea #30

Closed omarehaly closed 2 years ago

omarehaly commented 2 years ago

I am not familiar with the api but i have a simple idea for two-handed weapons: here is a alogorithm

left Hand is Grabbing

check if left hand to right hand vector has a high dot product to right hand forward vector (is left hand in front of right hand)

if dotproduct is >0.8f make right hand enter look at mode

right hand rotation is based on a look at function to left hand

if left hand ungrabs disable look at mode

omarehaly commented 2 years ago

The upvector for the lookat function will be the left hand upvector

rollingrock commented 2 years ago

hey thanks for the suggestion.

I was thinking of doing something very similar but making use of this feature i put into FRIK called bone spheres. Basically I can attached a sphere to any node in a mesh and check if the hand is ever in side it. if so then allow the left hand to grab the weapon.

then yeah do some sort of rotation calculation based off the right hand looking at the left hand as you say.

I need to look though because your idea of a dot product might be a cheaper detection method I haven't thought of. May be simpler to to be honest.

Until I can figure out how to do the whole grab the mesh like happens with HIGGS in skyrim this would be a great short term solution! thanks for posting

omarehaly commented 2 years ago

Thank you for the amazing work, looking forward to the update, you can even add gun rolling if you make the right hand upvector follow the left hand one

elliotttate commented 2 years ago

More than anything else, the lack of two handed holding of weapons is the biggest thing keeping me from truly enjoying Fallout 4 VR. This would be amazing if something could be added for that! Shooting giant weapons with one hand just feels so bad. Thanks for all your amazing work on VRIK!

elliotttate commented 2 years ago

Btw, not sure if seeing how Praydog handled two handed weapon holding and VRIK for RE would be helpful to look at, but it might give some ideas! https://github.com/praydog/REFramework

MaverickMartyn commented 2 years ago

This would be awesome. It added so much to Skyrim when using greatswords and crossbows, but it would be even better for FO4s modern weapon selection. Loving FRIK so far though. Immersion levels are through the roof!