Physics Components
    Preparing search index...

    Class TrackedVehicleConstraint

    Tracked Vehicle Constraint.

    Hierarchy (View Summary)

    Index

    Accessors

    • get castType(): number

      Collision tester that tests wheels collision. Following types available:

      VEHICLE_CAST_TYPE_RAY
      
      VEHICLE_CAST_TYPE_SPHERE
      
      VEHICLE_CAST_TYPE_CYLINDER
      

      Returns number

      Cast type number.

      VEHICLE_CAST_TYPE_RAY
      
    • get clutchStrength(): number

      Strength of the clutch when fully engaged. Total torque a clutch applies is

      Torque = ClutchStrength * (Velocity Engine - Avg Velocity Wheels At Clutch)
      

      Returns number

      Clutch strength

      10 (k m^2 s^-1)
      
    • 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)
      
    • get tracks(): number[][]

      An array of arrays. Each array represents a track and lists indices of wheels that are inside that track. The last element in each track array will become a driven wheel (an index that points to a wheel that is connected to the engine).

      Example with 2 tracks, and each having 4 wheels:

      [[0, 1, 2, 3], [4, 5, 6, 7]]
      

      Returns number[][]

      Arrays with tracks of wheels.

      []
      

    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