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 shapecasts + raycasts #5440

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

metalgearsloth
Copy link
Contributor

Actual raycasts. Need this for AI LIDAR experiment.

@eoineoineoin
Copy link
Contributor

Coincidentally, I started to take a look at the raycast end of this recently (https://github.com/eoineoineoin/RobustToolbox/commits/eoin/2024.09.xx.raycasts/) - I took a slightly different approach of putting a castray() function on the shapes interface which is a bit clearer IMO (though, that strategy doesn't work for shapecasts).

If you want to run with this, that's fine, I'll leave it - I still had to finish some functions, had a bunch of todos, polish, and tests to do, but I did notice a few issues with the SharedPhysicsSystem.Queries.cs which would also be good to include.

/// Gets the position of the Matrix. Will have some precision loss.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector2 Position(this Matrix3x2 t)
Copy link
Contributor

@eoineoineoin eoineoineoin Sep 16, 2024

Choose a reason for hiding this comment

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

Not sure what you mean by "precision loss", but this method already exists (Matrix3x2.Translation), so no need for it (along with the tests).

@metalgearsloth
Copy link
Contributor Author

I'm porting the new C code from box2d.

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.

2 participants