NWH Wheel Controller 3D
Search Results for

    Show / Hide Table of Contents

    Class WheelControllerManager

    Centralized physics manager for high-frequency wheel substepping. Runs N substeps per FixedUpdate to improve wheel physics stability.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    WheelControllerManager
    Namespace: NWH.WheelController3D
    Assembly: NWH.WheelController.dll
    Syntax
    [DefaultExecutionOrder(110)]
    public class WheelControllerManager : MonoBehaviour

    Fields

    | Edit this page View Source

    FixedDeltaTime

    Frame physics timestep (cached Time.fixedDeltaTime).

    Declaration
    public static float FixedDeltaTime
    Field Value
    Type Description
    float
    | Edit this page View Source

    Gravity

    Physics.gravity cached for the current FixedUpdate. Constant within a tick, so wheels read this instead of the native property to skip a per-wheel-per-substep read and magnitude sqrt.

    Declaration
    public static Vector3 Gravity
    Field Value
    Type Description
    Vector3
    | Edit this page View Source

    GravityMagnitude

    Magnitude of Gravity, cached per FixedUpdate.

    Declaration
    public static float GravityMagnitude
    Field Value
    Type Description
    float
    | Edit this page View Source

    currentSubstep

    Current substep index within the current FixedUpdate (0 to substepCount-1).

    Declaration
    public static int currentSubstep
    Field Value
    Type Description
    int
    | Edit this page View Source

    physicsFrameCount

    Global physics tick counter for synchronization.

    Declaration
    public static int physicsFrameCount
    Field Value
    Type Description
    int
    | Edit this page View Source

    substepCount

    Current number of substeps (computed from targetEffectiveRate and fixedDeltaTime).

    Declaration
    [NonSerialized]
    public int substepCount
    Field Value
    Type Description
    int
    | Edit this page View Source

    substepDeltaTime

    Current substep delta time.

    Declaration
    public static float substepDeltaTime
    Field Value
    Type Description
    float
    | Edit this page View Source

    targetEffectiveRate

    Target effective physics rate in Hz. Substeps are computed automatically. E.g., 200Hz target at 50Hz physics = 4 substeps.

    Declaration
    [Tooltip("Target effective physics rate. Substeps are auto-calculated based on fixedDeltaTime.")]
    public float targetEffectiveRate
    Field Value
    Type Description
    float

    Properties

    | Edit this page View Source

    Instance

    Singleton instance. Auto-creates if not present.

    Declaration
    public static WheelControllerManager Instance { get; }
    Property Value
    Type Description
    WheelControllerManager

    Methods

    | Edit this page View Source

    BreakAllStaticFriction(Rigidbody, bool)

    Force static friction break on all wheels of a rigidbody group. Used for both vehicles that have one wheel wake up which means we want to wake the rest up, as well as vehicle trailers that need to wake when the vehicle wakes.

    Declaration
    public void BreakAllStaticFriction(Rigidbody rb, bool clearFilterHistory = true)
    Parameters
    Type Name Description
    Rigidbody rb
    bool clearFilterHistory
    | Edit this page View Source

    Deregister(WheelController)

    Deregister a wheel from the physics manager.

    Declaration
    public void Deregister(WheelController wheel)
    Parameters
    Type Name Description
    WheelController wheel
    | Edit this page View Source

    GetGroup(Rigidbody)

    Get the rigidbody group for a specific rigidbody.

    Declaration
    public WheelControllerGroup GetGroup(Rigidbody rb)
    Parameters
    Type Name Description
    Rigidbody rb
    Returns
    Type Description
    WheelControllerGroup
    | Edit this page View Source

    Register(WheelController)

    Register a wheel with the physics manager.

    Declaration
    public void Register(WheelController wheel)
    Parameters
    Type Name Description
    WheelController wheel
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics