-
Notifications
You must be signed in to change notification settings - Fork 64
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
Conversation
l(almost)gtm 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 |
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 |
gettin better there, 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 bugs/issues: |
@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 |
@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):
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 |
a42a144
to
8670822
Compare
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>
8670822
to
26a6f4c
Compare
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.
lgtm, if we merge I'll make some time tomorrow to do a bunch of git-fu to get more of digitals work in.
This PR implements the following:
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](https://private-user-images.githubusercontent.com/1863707/257021324-de108b92-0fc3-4a96-a18d-b03bbc4f923e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkzMTEyOTcsIm5iZiI6MTcxOTMxMDk5NywicGF0aCI6Ii8xODYzNzA3LzI1NzAyMTMyNC1kZTEwOGI5Mi0wZmMzLTRhOTYtYTE4ZC1iMDNiYmM0ZjkyM2UucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjVUMTAyMzE3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MmUwNTc0YjU4NjkzOTY4YWZlOGMwOThhOTRhYmU1NWFlYzlmMzdlMWEzMzcwYzdiZDVkZjU2NzJhNjUxZWVhNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.zajjqTNYPK0Ma-INUrFER3AF_MmfAv64yAxBmxgAtCY)
![image](https://private-user-images.githubusercontent.com/1863707/257021292-28c9e480-990b-4975-84da-24b33f14d6f2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkzMTEyOTcsIm5iZiI6MTcxOTMxMDk5NywicGF0aCI6Ii8xODYzNzA3LzI1NzAyMTI5Mi0yOGM5ZTQ4MC05OTBiLTQ5NzUtODRkYS0yNGIzM2YxNGQ2ZjIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjVUMTAyMzE3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjFkMjRmYWE4NTVlOGExYzMwZmFmMzY1YTU1YmNkNGYyMWQxOTFmODExM2Y1MTIxMDVjMmNmZjdhNDJhZWYxYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.a5BMXAAG-wK2KtufNmQ7Wqvu2bfSG1smIhe825PBz84)
The XRToolsCollisionHand script has a few experimental modes:
![image](https://private-user-images.githubusercontent.com/1863707/257021311-2f7bd532-7d4d-4def-bada-dd5b92c6efda.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkzMTEyOTcsIm5iZiI6MTcxOTMxMDk5NywicGF0aCI6Ii8xODYzNzA3LzI1NzAyMTMxMS0yZjdiZDUzMi03ZDRkLTRkZWYtYmFkYS1kZDViOTJjNmVmZGEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjVUMTAyMzE3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTY3ZDI2YzE4MTU3MzA3NDZlMmI3ZTY0MzE5MDg1ODBiMGRlOGFmY2M5NmI4ZWExOGEyZTMxN2E0NmM0YzkwYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.ZjAOb-RtOyfls2tFI_O7HcCexXRnqvary0VUkmazMZ8)