Exemple #1
0
        public override void _ApplySteering(TargetAcceleration acceleration, float delta)
        {
            RigidBody2D _body = (RigidBody2D)_body_ref.GetRef();

            if (_body == null)
            {
                return;
            }

            _applied_steering = true;

            _body.ApplyCentralImpulse(Utils.ToVector2(acceleration.linear));
            _body.ApplyTorqueImpulse(acceleration.angular);
            if (calculate_velocities)
            {
                linear_velocity  = Utils.ToVector3(_body.LinearVelocity);
                angular_velocity = _body.AngularVelocity;
            }
        }