public WheelInfo(WheelInfoConstructionInfo ci)
        {
            SuspensionRestLength1 = ci.SuspensionRestLength;
            MaxSuspensionTravelCm = ci.MaxSuspensionTravelCm;

            WheelsRadius = ci.WheelRadius;
            SuspensionStiffness = ci.SuspensionStiffness;
            WheelsDampingCompression = ci.WheelsDampingCompression;
            WheelsDampingRelaxation = ci.WheelsDampingRelaxation;
            ChassisConnectionPointCS = ci.ChassisConnectionCS;
            WheelDirectionCS = ci.WheelDirectionCS;
            WheelAxleCS = ci.WheelAxleCS;
            FrictionSlip = ci.FrictionSlip;
            Steering = 0;
            EngineForce = 0;
            Rotation = 0;
            DeltaRotation = 0;
            Brake = 0;
            RollInfluence = 0.1f;
            IsFrontWheel = ci.IsFrontWheel;
            MaxSuspensionForce = ci.MaxSuspensionForce;

            //ClientInfo = IntPtr.Zero;
            //ClippedInvContactDotSuspension = 0;
            WorldTransform = Matrix.Identity;
            //WheelsSuspensionForce = 0;
            //SuspensionRelativeVelocity = 0;
            //SkidInfo = 0;
            RaycastInfo = new RaycastInfo();
        }
Beispiel #2
0
        public WheelInfo(WheelInfoConstructionInfo ci)
        {
            SuspensionRestLength1 = ci.SuspensionRestLength;
            MaxSuspensionTravelCm = ci.MaxSuspensionTravelCm;

            WheelsRadius             = ci.WheelRadius;
            SuspensionStiffness      = ci.SuspensionStiffness;
            WheelsDampingCompression = ci.WheelsDampingCompression;
            WheelsDampingRelaxation  = ci.WheelsDampingRelaxation;
            ChassisConnectionPointCS = ci.ChassisConnectionCS;
            WheelDirectionCS         = ci.WheelDirectionCS;
            WheelAxleCS        = ci.WheelAxleCS;
            FrictionSlip       = ci.FrictionSlip;
            Steering           = 0;
            EngineForce        = 0;
            Rotation           = 0;
            DeltaRotation      = 0;
            Brake              = 0;
            RollInfluence      = 0.1f;
            IsFrontWheel       = ci.IsFrontWheel;
            MaxSuspensionForce = ci.MaxSuspensionForce;

            //ClientInfo = IntPtr.Zero;
            //ClippedInvContactDotSuspension = 0;
            WorldTransform = Matrix.Identity;
            //WheelsSuspensionForce = 0;
            //SuspensionRelativeVelocity = 0;
            //SkidInfo = 0;
            RaycastInfo = new RaycastInfo();
        }
        public WheelInfo AddWheel(Vector3 connectionPointCS, Vector3 wheelDirectionCS0, Vector3 wheelAxleCS, float suspensionRestLength, float wheelRadius, VehicleTuning tuning, bool isFrontWheel)
        {
            var ci = new WheelInfoConstructionInfo()
            {
                ChassisConnectionCS      = connectionPointCS,
                WheelDirectionCS         = wheelDirectionCS0,
                WheelAxleCS              = wheelAxleCS,
                SuspensionRestLength     = suspensionRestLength,
                WheelRadius              = wheelRadius,
                IsFrontWheel             = isFrontWheel,
                SuspensionStiffness      = tuning.SuspensionStiffness,
                WheelsDampingCompression = tuning.SuspensionCompression,
                WheelsDampingRelaxation  = tuning.SuspensionDamping,
                FrictionSlip             = tuning.FrictionSlip,
                MaxSuspensionTravelCm    = tuning.MaxSuspensionTravelCm,
                MaxSuspensionForce       = tuning.MaxSuspensionForce
            };

            Array.Resize(ref wheelInfo, wheelInfo.Length + 1);
            var wheel = new WheelInfo(ci);

            wheelInfo[wheelInfo.Length - 1] = wheel;

            UpdateWheelTransformsWS(wheel, false);
            UpdateWheelTransform(NumWheels - 1, false);
            return(wheel);
        }
Beispiel #4
0
 public unsafe static void SetWheelDirectionCS(this WheelInfoConstructionInfo obj, ref OpenTK.Vector3 value)
 {
     fixed(OpenTK.Vector3 *valuePtr = &value)
     {
         obj.WheelDirectionCS = *(BulletSharp.Math.Vector3 *)valuePtr;
     }
 }
Beispiel #5
0
 public unsafe static void GetChassisConnectionCS(this WheelInfoConstructionInfo obj, out OpenTK.Vector3 value)
 {
     fixed(OpenTK.Vector3 *valuePtr = &value)
     {
         *(BulletSharp.Math.Vector3 *)valuePtr = obj.ChassisConnectionCS;
     }
 }
        public WheelInfo AddWheel(Vector3 connectionPointCS, Vector3 wheelDirectionCS0, Vector3 wheelAxleCS, float suspensionRestLength, float wheelRadius, VehicleTuning tuning, bool isFrontWheel)
        {
            WheelInfoConstructionInfo ci = new WheelInfoConstructionInfo();

            ci.ChassisConnectionCS      = connectionPointCS;
            ci.WheelDirectionCS         = wheelDirectionCS0;
            ci.WheelAxleCS              = wheelAxleCS;
            ci.SuspensionRestLength     = suspensionRestLength;
            ci.WheelRadius              = wheelRadius;
            ci.SuspensionStiffness      = tuning.SuspensionStiffness;
            ci.WheelsDampingCompression = tuning.SuspensionCompression;
            ci.WheelsDampingRelaxation  = tuning.SuspensionDamping;
            ci.FrictionSlip             = tuning.FrictionSlip;
            ci.IsFrontWheel             = isFrontWheel;
            ci.MaxSuspensionTravelCm    = tuning.MaxSuspensionTravelCm;
            ci.MaxSuspensionForce       = tuning.MaxSuspensionForce;

            Array.Resize <WheelInfo>(ref wheelInfo, wheelInfo.Length + 1);
            WheelInfo wheel = new WheelInfo(ci);

            wheelInfo[wheelInfo.Length - 1] = wheel;

            UpdateWheelTransformsWS(wheel, false);
            UpdateWheelTransform(NumWheels - 1, false);
            return(wheel);
        }
        public WheelInfo AddWheel(Vector3 connectionPointCS, Vector3 wheelDirectionCS0, Vector3 wheelAxleCS, float suspensionRestLength, float wheelRadius, RaycastVehicle.VehicleTuning tuning, bool isFrontWheel)
        {
            WheelInfoConstructionInfo ci = new WheelInfoConstructionInfo();

            ci.ChassisConnectionCS = connectionPointCS;
            ci.WheelDirectionCS = wheelDirectionCS0;
            ci.WheelAxleCS = wheelAxleCS;
            ci.SuspensionRestLength = suspensionRestLength;
            ci.WheelRadius = wheelRadius;
            ci.SuspensionStiffness = tuning.SuspensionStiffness;
            ci.WheelsDampingCompression = tuning.SuspensionCompression;
            ci.WheelsDampingRelaxation = tuning.SuspensionDamping;
            ci.FrictionSlip = tuning.FrictionSlip;
            ci.IsFrontWheel = isFrontWheel;
            ci.MaxSuspensionTravelCm = tuning.MaxSuspensionTravelCm;
            ci.MaxSuspensionForce = tuning.MaxSuspensionForce;

            wheelInfo.Add(new WheelInfo(ci));
            ci.Dispose();

            WheelInfo wheel = wheelInfo[NumWheels - 1];

            UpdateWheelTransformsWS(wheel, false);
            UpdateWheelTransform(NumWheels - 1, false);
            return wheel;
        }
Beispiel #8
0
 public static void SetWheelDirectionCS(this WheelInfoConstructionInfo obj, OpenTK.Vector3 value)
 {
     SetWheelDirectionCS(obj, ref value);
 }
Beispiel #9
0
 public static OpenTK.Vector3 GetWheelDirectionCS(this WheelInfoConstructionInfo obj)
 {
     OpenTK.Vector3 value;
     GetWheelDirectionCS(obj, out value);
     return(value);
 }