Example #1
0
 public CarObject GetCar(Model carModel, Model wheelModel)
 {
     CarObject carObject = null;
     try
     {
         carObject = new CarObject(0,
             //new Vector3(-60, 0.5f, 8), // camera's left
             new Vector3(0, 2.5f, 0),
             carModel, wheelModel, true, true, 30.0f, 5.0f, 4.7f, 5.0f, 0.20f, 0.4f, 0.05f, 0.45f, 0.3f, 1, 520.0f, PhysicsSystem.Gravity.Length());
         carObject.Car.EnableCar();
         carObject.Car.Chassis.Body.AllowFreezing = false;
     }
     catch (Exception E)
     {
         System.Diagnostics.Debug.WriteLine(E.StackTrace);
     }
     return carObject;
 }
Example #2
0
 private Gobject SpawnCar(int ownerid, int objectid)
 {
     Gobject newobject  = physicsManager.GetCar(carModel, wheelModel);
     newobject.ID = objectid;
     physicsManager.AddNewObject(newobject);
     if (ownerid == MyClientID) // Only select the new car if its OUR new car
     {
         myCar = (CarObject)newobject;
         SelectGameObject(myCar);
     }
     return newobject;
 }