Skip to content

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.

2 participants