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

Add One Way Collision for 2D Physics tests #573

Merged

Conversation

pouleyKetchoupp
Copy link
Contributor

@pouleyKetchoupp pouleyKetchoupp commented Jan 4, 2021

Update 2D Physics tests with a new demo to test one way collision.

This test scene is inspired by the "Around the Clock" test made by @madmiraal in https://github.com/madmiraal/godot-gym in order to test this PR: godotengine/godot#42574

Like the original test, it allows testing collision between a rigid/kinematic body object and a one-way collision platform at different angles.

This new version is a bit different to be able to use it in a more practical way within the physics test framework:

  • There are options and sliders to set different test cases (kinematic or rigid body, platform size, etc.)
  • You can still test all angles around the clock, but you can also test only one particular case for debug purpose
  • When all angles have been tested, the log gives you information about which sets of parameters have failed
  • Only the platform rotates for "around the clock" test and the rigid body goes horizontally to avoid redundant cases

Overall, the idea is to be able to test a set of parameters in less than a minute, check the log for failed cases and test these failed cases easily.

@madmiraal I think it covers the same cases as your original test, but if you have some time to have a look, please let me know in case I overlooked something.

@pouleyKetchoupp pouleyKetchoupp force-pushed the physics-test-one-way-collision branch 2 times, most recently from c616fcd to f265275 Compare January 7, 2021 00:13
@pouleyKetchoupp
Copy link
Contributor Author

Thanks @aaronfranke! I've updated the test from all your suggestions.

@pouleyKetchoupp
Copy link
Contributor Author

I've just added proper support for KinematicBody2D, and key shortcuts.

@pouleyKetchoupp pouleyKetchoupp force-pushed the physics-test-one-way-collision branch from b4cae9e to 6a738c1 Compare January 7, 2021 03:25
@aaronfranke aaronfranke merged commit ca4cde1 into godotengine:master Jan 7, 2021
@pouleyKetchoupp pouleyKetchoupp deleted the physics-test-one-way-collision branch January 7, 2021 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants