-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added Collision Hands Demo #478
Conversation
adds collision to the Open_XR_Tools_Hands by using a CharacterBody3D that follows the corresponding XRController3D. it is able to collide with the world and with static objects optional: * collision on pickables * weight on pickables * zero_g movement currently not supported: * accounting for switching grab points this scene contains a two handed example and the collision hands are made to account for this, currently the two handed is mainly useable for ranged weapon objects. however under its additional settings, there is a optional mod. if enabled, changing the rotational offset may produce something along the lines of a melee two handed object.
to add something to punch at, here am throwin in my muscleboy 3d model License: CC0 Public Domain
this adds new collision toys, weight models 1kg/3kg/5kg to showcase the heavy lift up and weight of the collision hands
this updates the weight models with a texture/material updated the collision hands optional weight to automaticly set zero g, at the same time this lets you move ur hands at normal speed if not holding a pickable Note: RigidBodys with higher mass of 1 are only producing noticeable weight feel. the included weight models in the demo scene demnonstrate this pretty good and u can get a better feel for what mass to use
adds boxing gloves to the collision demo as pickables, they got a child script that is responsible for adjusting depending on which controller picked it up bonus: added the gloves as xr tools hands this might come in handy, maybe for the rumble demo?
this adds some more punching toys along with some fixes to the pickable gloves - collision fixed missing teleport to main link in transporter updated License.txt
theme: neon and kickboxing by Kevin MacLeod additional audio files by various artists from freesound.org
adds a boxing ring 3D model License CC0 made it climbable, feels pretty nice
feel like am almost done here, might need to change some things here n there but this should be good for a review, the way it is right now. |
this adds code to the interactable_handle/handle_drive.gd scripts that code makes the hand latch onto the interactable additionaly it adds a left_hand_marker_3d.tscn along with a right one, those are drop in setups, all the interactables got those now added Do Note: this will be mainly useable for when the collision hands are used, since those reset their position on drop. why am mentioning this, if using the functionality with a normal hand or phyiscs hand, the hands postion upon drop isnt being reset, it will be displaced since there is no code in place to do this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, your Collision Hands work great! I just have a few concerns before this can be merged.
hand_remote.set_transform(_hand.get_transform()) | ||
hand_remote.remote_path = _hand.get_path() | ||
pickup_remote.set_transform(_pickup.get_transform()) | ||
pickup_remote.remote_path = _pickup.get_path() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These can easily crash the game if they're set to a null instance (not configured by the user)
|
||
if pickable_collision: | ||
_pickup.has_picked_up.connect(add_colliders) | ||
_pickup.has_dropped.connect(remove_colliders) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly used to using github reviews, bear with me here :p
## select controller | ||
@export var controller_path : NodePath | ||
|
||
## select visual hand | ||
@export var _hand_path : NodePath | ||
|
||
## select function_pickup | ||
@export var _pickup_path : NodePath #Should be child of ARVRController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rework these to get the nodes themselves, not the path to the node. It allows for class limiting of the node so that the user can't put in an incorrect node (It also allows for highlighting when selecting a node directly.)
One issue I didn't note is that when using the physics hands, the collision doesn't match the fingers, it only matches the fist pose. Aside from that, this works great! No performance hits when using them. |
First, thank you for taking the time to test and write your feel and concerns about it! indeed but this is supposed to be the developers responsibility when using the col hands, however am gonna look up at making the setup automatic regarding the other thing, with that being said, if you do not wish to use pickable_collision, just dont tick the box and it wont add colliders. the thing regarding no collision on fingers, if you look at the col hands, they contain a collisionshape3d node that is called palm_shape, this one is soley being used for collision for the hand the system is limited to this since it would involve a lot more to get collision going for fingers, i do have a idea or 2 on how i would approach this but the way it is now, it is intended to be and the physics hands are not supposed to be used with the col hands. best practice for making collision shapes for pickable items is to make them inside the editor, create a collisionshape3d node on your pickable or use the exsisting one.
(of course you can add multiple of these to your pickable, only the first one will be taken into account for collision when being held as the system copys the first collisionshape3d node into a dictionary into the col hand) with that being said, the system works just best with simplistic shapes. |
First of all, thanks for your work. It 's a lot of effort put inside this pr I was testing the scene and, while the basic collision works fine, and the pickable collision is also working, it is buggy with the weight option. If you try to raise the 5kg weight it sticks to the table and then jumps to the hand.. it also make the two handed object to fly crazy sometimes and the basket ball also goes crazy if you shake your hand fast. Also the weight makes the two hand to stick to the floor or whatever object it collides, and then fly around. Also, if you activate optional weight in right hand and not activated in left hand, then you pick the 1kg witth left hand and 5kg with right hand, you put your arms up and the right hand is always a bit shorter than the other (but it should reach the same height, only in a longer time) On UX: don't really get why you can't punch the objects with the hand but you can with the gloves, it's a bit confusing. Also, its annoying that you can't go inside the square with the gloves... maybe you can put a second pair of gloves inside the square. I would recomend to separate the pr into pieces, and merge stable features first, and then put the optional ones in a next step, otherwise it seems to be a big effort to make work everyhing. |
btw: i tested it in godot 4.1, but the project is in g 4.0 |
i do already have the gloves in the ring for the next commit but am investigating if i can add em as snapables to some kind wristholster (not working currently) currently the weight for example is a cheap trick that uses apply floor snap and it makes use of the zero g part of the col hands to enhance this effect, it might be cool if we could get it to be raised to where the hand is after some time or after a certain height is reached but i wasnt able to do this yet, still i would want to keep this in the pr as it might just be a metter of time till we can get this working, granted it is not working perfect but i hope to get some help from mux here n there to fix some of the issues |
Ok, finally had a good look at this. This is very impressive work, there are some issues that need polishing up but it's a solid base to work on. One small nitpick is that while I appreciate the artistic license, seeing our target audience is of all ages I think the blood on the mat is a bit much :) I think it's cool, but we do represent the Godot Project so :) I did do a PR with some structural changes, Digital already merged it, there are a few things to still solve here, so just copying this from my PR:
I'll find some time to keep helping out and working on those issues. Note that the change is that It still works the same, but the magic is in setting |
made a couple of climbing wall grips to be used in the toolset and inside the collision hands demo, feel free to reuse it License: CC0 Public Domain
changed climbing grips material to use backlight so the grips can be seen better expanded the climbing section inside the demo to go half circle around the holodeck, try it, gives some exercise feel
@@ -22,6 +22,20 @@ extends XRToolsPickable | |||
## Distance from the handle origin to auto-snap the grab | |||
@export var snap_distance : float = 0.3 | |||
|
|||
@export_group("Optional attach Hand") | |||
## this latches the grabbing Hand onto the Interactable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for taking a look at this, wasnt aware that this would actualy produce this kind of mess.
gonna look into it and remove unecassary comments.
this removes hardcoding of variables and makes the previously hardcoded parts use the XRTools.find_xr_child function updated in script documentation, will still need some clean up, thats why pass 1
this pr will stay open, simply to showcase another approach to collision hands |
Closed |
RingTheBell.mp4
addedPunchingToys.mp4
ColHandUpdate_Weight.mp4
adds collision to the Open_XR_Tools_Hands by using a CharacterBody3D that follows the corresponding XRController3D.
it is able to collide with the world and with static objects
optional:
currently not supported:
this pull request fixes/closes the following issues/requests:
Closes #158
Closes #136
this scene contains a two handed example
and the collision hands are made to account for this, currently the two handed is mainly useable for ranged weapon objects.
however under its additional settings, there is a optional mod. if enabled, changing the rotational offset may produce something along the lines of a melee two handed object.
Additional Note and Thanks - Collision Hands:
this work was based on the CollisionHands work by https://github.com/n8-ball
from the Godot Dojo - https://github.com/Godot-Dojo/Godot-XR-Collision-Hands
Repository.
Additional Note and Thanks - Two Handed:
in the process of makin this work and expand for Godot 4, i received valuable help and input by
https://github.com/stumpynub who explained to me how to get two handed started
@teddybear082 for makin the two handed working
last but not least @Malcolmnixon who as always helped me debug and get the two handed actualy to this state
Finally i would like to extend a welcome to evryone who is interested in this to participate in testing this pr and or adding ideas/ functionality by improving the code
Thanks