void Model( Model model, Color color, float duration, Transform transform, bool overlay, bool castShadows, Material materialOveride )

robot_2Generated
code_blocksInput

Description

The Model method in the DebugOverlaySystem class is used to draw a 3D model in the world for debugging purposes. This method allows you to specify various parameters such as the model to be drawn, its color, duration of visibility, transformation, and rendering options like overlay and shadow casting.

Usage

To use the Model method, you need to provide the following parameters:

  • model: The Sandbox.Model instance representing the 3D model you want to draw.
  • color: A Color object that defines the color of the model.
  • duration: A float value indicating how long the model should be visible in seconds.
  • transform: A Transform object that specifies the position, rotation, and scale of the model in the world.
  • overlay: A bool indicating whether the model should be drawn as an overlay.
  • castShadows: A bool that determines if the model should cast shadows.
  • materialOveride: A Sandbox.Material object to override the model's material if needed.

Example

```csharp
// Example usage of the Model method in DebugOverlaySystem
var model = new Sandbox.Model("path/to/model");
var color = new Color(1.0f, 0.0f, 0.0f); // Red color
float duration = 5.0f; // Visible for 5 seconds
var transform = new Transform(Vector3.Zero, Rotation.Identity, 1.0f);
bool overlay = true;
bool castShadows = false;
var materialOverride = new Sandbox.Material("path/to/material");

DebugOverlaySystem debugOverlay = new DebugOverlaySystem();
debugOverlay.Model(model, color, duration, transform, overlay, castShadows, materialOverride);
```