Skip to content

Implement debug drawing system for physical entities. #4

@dkushner

Description

@dkushner

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions