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

Fix the lag in the finger-poke #489

Merged
merged 1 commit into from
Jul 29, 2023

Conversation

Malcolmnixon
Copy link
Collaborator

This pull request fixes issue #328 by implementing the following changes:

  • Change the PokeBody from being a RigidBody3D driven by _integrate_forces to a StaticBody3D driven by _physics_process
  • Set the PlayerBody process_priority to -100 so its physics processing is performed before anything else

The problem with the old implementation is that _integrate_forces is not actually performed in the physics processing phase, and so ignores any priority rules. This means that we cannot enforce the body to move first, and then ensure the poke updates in the same frame with the updated body.

Unfortunately with Godot 4 removing KinematicBody, and CharacterBody3D being too tied to character movement; the move_and_slide functionality had to be implemented in gdscript.

This implementation uses StaticBody3D rather than directly using the PhysicsDirectSpaceState3D/PhysicsServer3D because only PhysicsBody3D objects get the logic to "de-collide" objects in C++, and implementing the loops in gdscript would be crippling.

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! probably should apply similar changes to CollisionHand in Digitals PR.

@DigitalN8m4r3
Copy link
Contributor

DigitalN8m4r3 commented Jul 28, 2023

lgtm! probably should apply similar changes to CollisionHand in Digitals PR.

just tried just setting process to -100 and sadly i got no change there regarding the col hands

Fix minor gdlint issues

Added ability to enable/disable pushing bodies. Added control over collision layer and mask. Organized properties into categories.
@Malcolmnixon
Copy link
Collaborator Author

The XRToolsPoke node now:

  • gives control over whether it pushes bodies
  • has documentation comments
  • organizes its properties into categories.

image

@Malcolmnixon Malcolmnixon merged commit c446462 into GodotVR:master Jul 29, 2023
2 checks passed
@Malcolmnixon Malcolmnixon deleted the fix-poke-lag branch July 29, 2023 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants