Class WheeledVehicleConstraint

Wheeled Vehicle Constraint.

Hierarchy (view full)

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.

    Default Value

    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

    Default Value

    10 (k m^2 s^-1)
    
  • get differentialLimitedSlipRatio(): number
  • Ratio max / min average wheel speed of each differential (measured at the clutch). When the ratio is exceeded all torque gets distributed to the differential with the minimal average velocity. This allows implementing a limited slip differential between differentials. Set to Number.MAX_VALUE for an open differential. Value should be greater than 1.

    Returns number

    Slip ratio.

    Default Value

    1.4
    
  • get entity(): any
  • The PlayCanvas Entity that is used as a visual model for the vehicle body. Its position and rotation will automatically be updated to match the physical body.

    Returns any

    Entity or null if none is set.

    Default Value

    null
    
  • 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.

    Default Value

    ~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