Esempio n. 1
0
    public float stuckThreshlod = 10 * 1000 / 3600;//(10 km/h)

    // Use this for initialization
    void Start()
    {
        if (speedText != null)
        {
            speedText.text = "AISpeed: 0 km/h";
        }


        rb = GetComponent <Rigidbody>();
        rb.centerOfMass = com;
        if (path != null)
        {
            pathPoints = path.GetComponentsInChildren <Transform>();
        }

        flController = frontLeft.GetComponent <WheelController>();
        frController = frontRight.GetComponent <WheelController>();
        rlController = rearLeft.GetComponent <WheelController>();
        rrController = rearRight.GetComponent <WheelController>();

        flController.ConfigureWheelSubsteps(speedThreshold, stepsBelowThreshold, stepsAboveThreshold);
        flController.ConfigureFriction(forwardStiffness, sidewayStiffness);
        frController.ConfigureWheelSubsteps(speedThreshold, stepsBelowThreshold, stepsAboveThreshold);
        frController.ConfigureFriction(forwardStiffness, sidewayStiffness);
        rlController.ConfigureWheelSubsteps(speedThreshold, stepsBelowThreshold, stepsAboveThreshold);
        rlController.ConfigureFriction(forwardStiffness, sidewayStiffness);
        rrController.ConfigureWheelSubsteps(speedThreshold, stepsBelowThreshold, stepsAboveThreshold);
        rrController.ConfigureFriction(forwardStiffness, sidewayStiffness);
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        rb = GetComponent <Rigidbody>();
        rb.centerOfMass = com;
        speedText.text  = "0 km/h";

        flController = frontLeft.GetComponent <WheelController>();
        frController = frontRight.GetComponent <WheelController>();
        rlController = rearLeft.GetComponent <WheelController>();
        rrController = rearRight.GetComponent <WheelController>();

        flController.ConfigureWheelSubsteps(speedThreshold, stepsBelowThreshold, stepsAboveThreshold);
        flController.ConfigureFriction(forwardStiffness, sidewayStiffness);
        frController.ConfigureWheelSubsteps(speedThreshold, stepsBelowThreshold, stepsAboveThreshold);
        frController.ConfigureFriction(forwardStiffness, sidewayStiffness);
        rlController.ConfigureWheelSubsteps(speedThreshold, stepsBelowThreshold, stepsAboveThreshold);
        rlController.ConfigureFriction(forwardStiffness, sidewayStiffness);
        rrController.ConfigureWheelSubsteps(speedThreshold, stepsBelowThreshold, stepsAboveThreshold);
        rrController.ConfigureFriction(forwardStiffness, sidewayStiffness);
    }