Physics Components
    Preparing search index...

    Class VehicleConstraint

    Base class for different types of vehicles.

    Hierarchy (View Summary)

    Index

    Accessors

    • get maxPitchRollAngle(): number

      Defines the maximum pitch/roll angle, can be used to avoid the car from getting upside down. The vehicle up direction will stay within a cone centered around the up axis with half top angle maxPitchRollAngle, set to pi to turn off.

      Returns number

      Max pitch/roll angle in radians.

      ~1.04 rad (60 degrees)
      

    Methods

    • Sets driver steering input for the vehicle.

      Parameters

      • input0: number

        Forward input in [-1:1] range.

      • input1: number

        Right input for wheeled and moto vehicles in [-1:1] range. Left ratio for tracked vehicle in [-1:1] range.

      • input2: number

        Brake input for wheeled and moto vehicles in [0:1] range. Right ratio for tracked vehicle in [-1:1] range.

      • input3: number

        Hand brake for wheeled and moto vehicles in [0:1] range. Brake input for tracked vehicle in [0:1] range.

      Returns void

    • Allows to enable/disable a constraint without destroying it.

      Parameters

      • enabled: boolean

        true - enable constraint, false - disable.

      • Optionalactivate: boolean = true

        If true, activate connected bodies after changing the state.

      Returns void