Example #1
0
        public void Render()
        {
            Matrix carOrientation = Matrix.Identity;

            carOrientation.Forward = _car.RenderDirection;
            carOrientation.Up      = _car.Up;
            carOrientation.Right   = Vector3.Cross(_car.RenderDirection, _car.Up);
            WheelModel.Render(
                _wheelMatrix *
                Matrix.CreateRotationX(_rotation / _size * 2f) *
                Matrix.CreateRotationY(_steeringAngle * 1.3f) *
                carOrientation *
                Matrix.CreateTranslation(GetOffsetPosition(_renderOffset)),
                _texture);
        }