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

Collision mesh building #625

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Collision mesh building #625

wants to merge 3 commits into from

Conversation

IsaacLic
Copy link
Contributor

@IsaacLic IsaacLic commented Oct 11, 2021

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. Then try flying into the rubble. The ship should not pass through the rubble.

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.

1 participant