Table of Contents

Class DebugRenderComponentScript

Namespace
Stride.CommunityToolkit.Bepu
Assembly
Stride.CommunityToolkit.Bepu.dll

Script that ensures a DebugRenderComponent is added to the owning Entity once the scene is ready (when visibility groups are present).

[Display("Debug Render (Bepu)", null)]
[ComponentCategory("Physics")]
public class DebugRenderComponentScript : SyncScript, IIdentifiable, ICollectorHolder
Inheritance
DebugRenderComponentScript
Implements
Inherited Members
Extension Methods

Remarks

The DebugRenderComponent enables Bepu physics debug rendering. The debug component itself exposes a Visible property and can be toggled at runtime using the keyboard key Keys.F11 (see DebugRenderComponent in the Bepu integration).

Important details:

  • Adding this script/component to a single entity in the scene will activate the debug mesh rendering for all Bepu physics entities in that scene (the debug rendering is global per-scene).
  • The component in this script is created with Visible = false by default to avoid enabling debug rendering unexpectedly.
  • When a physics body is not awake, its debug mesh is rendered with a lighter color to indicate the sleeping/non-awake state.
  • With ShowContacts the component also draws the contacts the solver is resolving, a marker at each point and a line along its normal (Stride 4.4.1), whenever the meshes are visible.

Properties

ShowContacts

Gets or sets whether the solver's contact points and normals are drawn with the debug meshes. Defaults to false.

public bool ShowContacts { get; set; }

Property Value

bool

Visible

Gets or sets whether the debug render is visible when the component is added. Defaults to false.

public bool Visible { get; set; }

Property Value

bool

Methods

Update()

Called once per frame by the engine. When the scene contains one or more visibility groups and the debug component has not yet been added, this method creates and adds a DebugRenderComponent to the Entity.

public override void Update()

Remarks

The component is added once; after that the method only returns. Press Keys.F11 to toggle it.