Skip to content
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

Implement basic collision hands #490

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

Malcolmnixon
Copy link
Collaborator

This PR implements the following:

  • Extracted force-pushing-body logic from PokeBody into XRToolsForceBody.
  • Modified XRToolsHand so it can be any descendant of an XRController3D (from DigitalN8m4r3/BastiaanOlij)
  • Added rough XRToolsCollisionHand script
  • Modified interactables demo to hack XRToolsCollisionHand in for now

The interactable demo scene puts an XRToolsCollisionHand under the left controller, and moves everything else under it. It also adds a basic box as a hand collider:
image
image

The XRToolsCollisionHand script has a few experimental modes:
image

@DigitalN8m4r3
Copy link
Contributor

l(almost)gtm
it seems to fix the hand drifting away/ staying behind issue we currently have

currently what is not working good is when usign it with climbables, might just be the same issue i had at the beggining regarding collision layers but this needs some more investigating since being able to pull urself up/down using climbables is actualy one of the main selling points for the col hand

@BastiaanOlij
Copy link
Member

I'll find some time this week to test as well but it's looking good so far.

Digitals issue with the drift we'll need to think about whether we fix that first or whether we leave that for a future enhancement. As we're not actually grabbing anything and we're still attempting to follow the real hands position it's normal that the hand doesn't stay in one position.

The thing I wanted to add here is to have a mode that if a static body is grabbed, instead of anchoring the object to the hand (like we do with rigidbodies), we anchor the hand to the object. In this case it becomes a lot easier because we simply switch by following the parent (the XRController3D node) to "following" the thing we've grabbed (which in essence will mean that we disable collisions and just position the XRToolsCollisionHandNode on one of the grab points).
If the position of the node gets to far away from the XRController3D node we'll "let go" automatically.

@DigitalN8m4r3
Copy link
Contributor

gettin better there,
climbing works pretty good now, only thing i dont like is when u climb the offset is too fast, introducing a smooth/ease would be verry welcome since it could otherwise intoduce motion sickness

collision on pickables, not good the way it is introduced in the pickables demo... the pickables collide just with the hands and upon drop perform a instant throw off due to collision issues with the other hand
(lets just keep this simple and plain and use actual pickable collision the way i intended it in the col demo)

bugs/issues:
snap turining while holding objects - object lags behind and adds a visual distortion due to frame inconsistency
moving while holding objects - object lags behind

@BastiaanOlij
Copy link
Member

collision on pickables, not good the way it is introduced in the pickables demo... the pickables collide just with the hands and upon drop perform a instant throw off due to collision issues with the other hand
(lets just keep this simple and plain and use actual pickable collision the way i intended it in the col demo)

@DigitalN8m4r3 we've simply not implemented this yet, Malcolm just added collision hands to all the demos just to test various things but that will be remove before we merge this.

We're looking at enhancing what you build to include other collision shapes as well, one of the things I want to combine for instance is the logic in physics hands (which will likely become obsolete), so this will likely all happen in a follow up PR

@BastiaanOlij
Copy link
Member

@Malcolmnixon this looks good to me for a first pass, works pretty well. As discussed we should remove the changes to the existing demos and rebase the PR so we can merge.

Follow ups then become (in no particular order):

  • rebasing Digitals PR and getting most of his example scene in to demo this logic
  • start working on implementing his collision improvements combined with our ideas to also combine in physics hands
  • look into the two handed mode
  • evaluate which of our current scenes should include collision hands

Something I also want to start thinking about is if we can do something with angular collisions instead of just re-orienting the hands. It be nice that if we bring a hand down on a table, it flattens itself on the surface instead of retaining the angle of the hand. Though I don't think we can start looking into that until after we have our finger collisions

@Malcolmnixon Malcolmnixon force-pushed the collision-hands branch 2 times, most recently from a42a144 to 8670822 Compare August 1, 2023 23:59
@Malcolmnixon Malcolmnixon marked this pull request as ready for review August 1, 2023 23:59
This commit implements basic collision hands by:
- Adding a new XRToolsCollisionHand script and scenes with physics priority of -90 (after body, but before everything else)
- Adding collision exclusions between XRToolsCollisionHand and any held XRToolsPickable
- Modified XRToolsPickable to track held objects to the ancestor XRController3D
- Modified XRToolsClimbable so it creates dynamic grab "handles" when grabbed by the player
- Modified XRToolsMovementClimb to use the dynamic grab "handles"

Co-Authored-By: Miodrag Sejic <56046022+DigitalN8m4r3@users.noreply.github.com>
Copy link
Member

@BastiaanOlij BastiaanOlij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, if we merge I'll make some time tomorrow to do a bunch of git-fu to get more of digitals work in.

@Malcolmnixon Malcolmnixon changed the title This PR exists to evaluate different approaches for collision hands Implement basic collision hands Aug 2, 2023
@Malcolmnixon Malcolmnixon merged commit 7b4177f into GodotVR:master Aug 2, 2023
2 checks passed
@Malcolmnixon Malcolmnixon deleted the collision-hands branch August 2, 2023 01:25
@BastiaanOlij BastiaanOlij added the enhancement New feature or request label Aug 2, 2023
@BastiaanOlij BastiaanOlij added this to the 4.2.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants