Пример #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="car"></param>
        /// <param name="pos"></param>
        /// <param name="axisUp"></param>
        /// <param name="spring"></param>
        /// <param name="travel"></param>
        /// <param name="inertia"></param>
        /// <param name="radius"></param>
        /// <param name="sideFriction"></param>
        /// <param name="fwdFriction"></param>
        /// <param name="damping"></param>
        /// <param name="numRays"></param>
        public void Setup(RollingVehicle car,
                          Vector3 pos,    //< position relative to car, in car's space
                          Vector3 axisUp, //< in car's space
                          float spring,   //< force per suspension offset
                          float travel,   //< suspension travel upwards
                          float inertia,  //< inertia about the axel
                          float radius,
                          float sideFriction,
                          float fwdFriction,
                          float damping,
                          int numRays)
        {
            this.vehicle      = car;
            this.pos          = pos;
            this.axisUp       = axisUp;
            this.spring       = spring;
            this.travel       = travel;
            this.inertia      = inertia;
            this.radius       = radius;
            this.sideFriction = sideFriction;
            this.fwdFriction  = fwdFriction;
            this.damping      = damping;
            this.numRays      = numRays;

            pred = new WheelPred(car.chassis.Body.CollisionSkin);

            Reset();
        }
Пример #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="car"></param>
        public Chassis(RollingVehicle car)
        {
            body = new ChassisBody(car);
            collisionSkin = new CollisionSkin(body);

            body.CollisionSkin = collisionSkin;

            float length = 6.0f;
            float width = 2.3f;
            float height = 1.6f;

            Vector3 min = new Vector3(-0.5f * length, 0.0f, -width * 0.5f);
            Vector3 max = new Vector3(0.5f * length, height, width * 0.5f);

            SetDims(min, max);
        }
Пример #3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="car"></param>
        public Chassis(RollingVehicle car)
        {
            body          = new ChassisBody(car);
            collisionSkin = new CollisionSkin(body);

            body.CollisionSkin = collisionSkin;

            float length = 6.0f;
            float width  = 2.3f;
            float height = 1.6f;

            Vector3 min = new Vector3(-0.5f * length, 0.0f, -width * 0.5f);
            Vector3 max = new Vector3(0.5f * length, height, width * 0.5f);

            SetDims(min, max);
        }
Пример #4
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="car"></param>
        /// <param name="pos"></param>
        /// <param name="axisUp"></param>
        /// <param name="spring"></param>
        /// <param name="travel"></param>
        /// <param name="inertia"></param>
        /// <param name="radius"></param>
        /// <param name="sideFriction"></param>
        /// <param name="fwdFriction"></param>
        /// <param name="damping"></param>
        /// <param name="numRays"></param>
        public void Setup(RollingVehicle car,
              Vector3 pos, //< position relative to car, in car's space
              Vector3 axisUp, //< in car's space
              float spring,  //< force per suspension offset
              float travel,  //< suspension travel upwards
              float inertia, //< inertia about the axel
              float radius,
              float sideFriction,
              float fwdFriction,
              float damping,
              int numRays)
        {
            this.vehicle = car;
            this.pos = pos;
            this.axisUp = axisUp;
            this.spring = spring;
            this.travel = travel;
            this.inertia = inertia;
            this.radius = radius;
            this.sideFriction = sideFriction;
            this.fwdFriction = fwdFriction;
            this.damping = damping;
            this.numRays = numRays;

            pred = new WheelPred(car.chassis.Body.CollisionSkin);

            Reset();
        }
Пример #5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="car"></param>
 public ChassisBody(RollingVehicle car)
 {
     mCar = car;
 }
Пример #6
0
 public RoverChassis(RollingVehicle veh)
     : base(veh)
 {
 }
Пример #7
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="car"></param>
 public ChassisBody(RollingVehicle car)
 {
     mCar = car;
 }