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

Implement debug drawing system for physical entities. #4

Open
dkushner opened this issue Dec 22, 2017 · 0 comments
Open

Implement debug drawing system for physical entities. #4

dkushner opened this issue Dec 22, 2017 · 0 comments

Comments

@dkushner
Copy link

dkushner commented Dec 22, 2017

Given the fairly advanced mathematical models involved with simulating rigid body physics, it becomes difficult for users of the library to analytically determine what is happening in the physics world through debug messages alone. For this reason, the amethyst integration of rhusics should include facilities to draw "debug geometry" that is representative of the underlying parameters to the simulation. This addition should support the following features:

  • Velocity vectors with direction and scale proportional to their physical quantities.
  • Collision shape wireframes to observe the dimension and orientation of collision geometry and understood by the physics engine.
  • Contact manifold highlighting to observe interactions between collision geometry under simulation.

This addition can be implemented in multiple parts.

  1. Creating a specs system implementation that aggregates all existing collision shape, velocity and rigid body components. For each of these components, debug line geometry is constructed by inspecting the properties of the component. This geometry is assigned to the entity as an additional (perhaps custom) mesh component with vertex structure [Pos, Color].
  2. Creating a specs system implementation that reads from the collision event queue and generates mesh geometry from contact manifold. Can also include collision geometry of involved bodies to support contact "ghosting" allowing for a visual representation of a contact to persist after the contact has been resolved.
  3. A custom pass is implemented to render these debug meshes using a barycentric coordinate wireframe fragment shader.
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

No branches or pull requests

1 participant