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

Generified collision mesh generation #595

Closed

Conversation

IsaacLic
Copy link
Contributor

Description

This PR generifies collision mesh creation. Rather than needing to create a separate system for each type of Body with a new instance of CollisionMeshLoader, the new CollisionMeshBuilderSystem handles all Body creation.

The BodyLinked component has two new fields - one for the JSON path to the mesh data, and another for the schema file that details how the data is laid out. When an entity has a BodyLinked component, the system will build a Body using the mesh data when it receives a GenerateBodyEvent (which will happen at the next tick).

Testing

Shoot the testing asteroid (the golden asteroid visible on startup). The projectile should still collide with it, so the asteroid should be destroyed.

Outstanding Work

This PR will cause merge conflicts with #593. I'm marking this as a draft until after that PR is merged, and then I'll address the conflicts.

@Cervator
Copy link
Member

Cervator commented Sep 3, 2021

@Cervator
Copy link
Member

#593 has been merged, ready for conflict resolution and finalizing 👍

Does this likely clash any with the updated mesh work for mazes in the GSOC project? I guess that might relate more to just arranging meshes rather than generating them. Mazes are still pretty whacky on collision shapes but I think that's pre-existing.

@IsaacLic IsaacLic closed this Oct 11, 2021
@IsaacLic IsaacLic deleted the collisionMeshGeneration branch October 11, 2021 16:11
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