Beispiel #1
0
        public void PreUpdate()
        {
            _outputTorque = 0f;
            wheelController.useExternalUpdate = true;
            wheelController.useExternalLongSlipCalculation = !_inputIsNull;
            wheelController.useExternalLatSlipCalculation  = false;

            if (surfacePreset != null && surfacePreset.frictionPreset != null)
            {
                wheelController.activeFrictionPreset = surfacePreset.frictionPreset;
                _BCDEz = surfacePreset.frictionPreset.BCDE.z;
            }
            else
            {
                _BCDEz = 1f;
            }

            angularVelocity  = wheelController.angularVelocity;
            LinearVelocity   = wheelController.forwardFriction.speed;
            VerticalLoad     = wheelController.wheel.load;
            _brakeTorque     = BrakeTorque;
            _radius          = Radius;
            _fixedDeltaTime  = vc.fixedDeltaTime;
            _loadCoefficient = wheelController.CalculateLoadCoefficient();
        }