DriverGame/DriverGame/Car.cs
/// <summary>
/// Render the car given the current properties
/// </summary>
/// <param name="device">The device used to render the car</param>
Render the car given the current properties
Render the car given the current properties
public void Draw(Device device)
        {
            device.Transform.World = Matrix.Scaling(Scale,
                Scale, Scale) * Matrix.Translation(carLocation, Height, Depth);
            for (int i = 0; i < carMaterials.Length; i++)
            {
                device.Material = carMaterials[i];
                device.SetTexture(0, carTextures[i]);
                carMesh.DrawSubset(i);
            }
        }
public void Draw ( Device device ) { device . Transform . World = Matrix . Scaling ( Scale , Scale , Scale ) * Matrix . Translation ( carLocation , Height , Depth ) ; for ( int i = 0 ; i < carMaterials . Length ; i ++ ) { device . Material = carMaterials [ i ] ; device . SetTexture ( 0 , carTextures [ i ] ) ; carMesh . DrawSubset ( i ) ; } }
Render the car given the current properties
Render the car given the current properties
// The car is a little bit too big, scale it down
device
Device
The device used to render the car
The device used to render the car