Speedometer (for Vehicles) - user-grinch/ModelExtras GitHub Wiki



Speedometer Integration for Dashboard

Overview

The Speedometer feature displays the vehicle's speed on the dashboard with an analog display. The needle of the speedometer rotates on the Y-axis, providing a visual representation of the speed. Follow the instructions below to adapt your model for the Speedometer functionality.

Needle Naming and Positioning

  1. Needle Naming:

    • Name the needle of your Speedometer as x_sm.
  2. Needle Positioning:

    • Position the needle to point to 0 on the speed scale.

Example

Suppose you want to configure the Speedometer with a maximum speed of 160 mph and a rotation of 220 degrees to point to the maximum speed:

  • Name the needle x_sm.
  • Position the needle to point to 0 on the speed scale.
  • Pass parameters: x_sm_m160r220.

To use kilometers per hour:

  • Name the needle x_sm_kph.
  • Position the needle to point to 0 on the speed scale.
  • Pass parameters: x_sm_kph_m260r220.

By following these steps, you integrate the Speedometer feature into your model, providing a simulated representation of the vehicle's speed on the dashboard.

JSONC Configuration Method (Recommended)

Instead of renaming nodes manually, you can configure the data via JSONC, allowing easier tuning and adjustments.

📂 JSONC File Location & Structure

📌 Path: ModelExtras/data/<model_id or model_name>.jsonc
📌 Example File: ModelExtras/data/522.jsonc (for model_ID 522)

{
    "speedmeter": {
        "maxspeed": 100.0,
        "maxrotation": 100.0,
        "kph": true
    }
}
⚠️ **GitHub.com Fallback** ⚠️