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

[3.x] Optimize raycast with large Heightmap shape data #48709

Conversation

pouleyKetchoupp
Copy link
Contributor

Port raycast accelerator from Bullet's btHeightfieldTerrainShape (originally made by @Zylann).
Allows raycasting on heightmap shapes to have about the same performance in Godot Physics as in Bullet.

3.x backport of PR #48708

@pouleyKetchoupp pouleyKetchoupp added this to the 3.4 milestone May 14, 2021
@pouleyKetchoupp pouleyKetchoupp requested a review from a team May 14, 2021 00:47
@pouleyKetchoupp pouleyKetchoupp force-pushed the heightmap-raycast-acceleration-3.x branch 2 times, most recently from c3ce208 to b9a0e00 Compare May 14, 2021 00:58
@reduz reduz self-requested a review September 4, 2021 13:08
Copy link
Contributor

@Zylann Zylann left a comment

Choose a reason for hiding this comment

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

Been a while since I wrote this in Bullet, but it looks ok. Did not test because I dont have master setup.

I only left a few comments about minor improvements.
Also, considering this algorithm traverses a heightmap that will never exceed the largest sizes an image can have, I'm not sure if using real_t for double is necessary, but it's probably good enough

servers/physics/shape_sw.cpp Outdated Show resolved Hide resolved
servers/physics/shape_sw.cpp Outdated Show resolved Hide resolved
Port raycast accelerator from Bullet's btHeightfieldTerrainShape.
@pouleyKetchoupp pouleyKetchoupp force-pushed the heightmap-raycast-acceleration-3.x branch from b9a0e00 to bb6760a Compare September 6, 2021 22:59
@pouleyKetchoupp
Copy link
Contributor Author

@Zylann Thanks for the review! I've just rebased and made the changes you suggested. I'm merging since you said you approved on the chat.

@pouleyKetchoupp pouleyKetchoupp merged commit 26e6a80 into godotengine:3.x Sep 6, 2021
@pouleyKetchoupp pouleyKetchoupp deleted the heightmap-raycast-acceleration-3.x branch September 6, 2021 23:16
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.

None yet

3 participants