Example #1
0
        public Object m_clientInfo;//can be used to store pointer to sync transforms...

	    public WheelInfo(ref WheelInfoConstructionInfo ci)
	    {
		    m_suspensionRestLength1 = ci.m_suspensionRestLength;
		    m_maxSuspensionTravelCm = ci.m_maxSuspensionTravelCm;

		    m_wheelsRadius = ci.m_wheelRadius;
		    m_suspensionStiffness = ci.m_suspensionStiffness;
		    m_wheelsDampingCompression = ci.m_wheelsDampingCompression;
		    m_wheelsDampingRelaxation = ci.m_wheelsDampingRelaxation;
		    m_chassisConnectionPointCS = ci.m_chassisConnectionCS;
		    m_wheelDirectionCS = ci.m_wheelDirectionCS;
		    m_wheelAxleCS = ci.m_wheelAxleCS;
		    m_frictionSlip = ci.m_frictionSlip;
		    m_steering = 0f;
		    m_engineForce = 0f;
		    m_rotation = 0f;
		    m_deltaRotation = 0f;
		    m_brake = 0f;
		    m_rollInfluence = .1f;
		    m_bIsFrontWheel = ci.m_bIsFrontWheel;
            m_maxSuspensionForce = ci.m_maxSuspensionForce;

	    }
Example #2
0
        public WheelInfo AddWheel(ref Vector3 connectionPointCS0, ref Vector3 wheelDirectionCS0, ref Vector3 wheelAxleCS, float suspensionRestLength, float wheelRadius, VehicleTuning tuning, bool isFrontWheel)
        {
            WheelInfoConstructionInfo ci = new WheelInfoConstructionInfo();

            ci.m_chassisConnectionCS = connectionPointCS0;
            ci.m_wheelDirectionCS = wheelDirectionCS0;
            ci.m_wheelAxleCS = wheelAxleCS;
            ci.m_suspensionRestLength = suspensionRestLength;
            ci.m_wheelRadius = wheelRadius;
            ci.m_suspensionStiffness = tuning.m_suspensionStiffness;
            ci.m_wheelsDampingCompression = tuning.m_suspensionCompression;
            ci.m_wheelsDampingRelaxation = tuning.m_suspensionDamping;
            ci.m_frictionSlip = tuning.m_frictionSlip;
            ci.m_bIsFrontWheel = isFrontWheel;
            ci.m_maxSuspensionTravelCm = tuning.m_maxSuspensionTravelCm;
            ci.m_maxSuspensionForce = tuning.m_maxSuspensionForce;

            WheelInfo wheel = new WheelInfo(ref ci);
            m_wheelInfo.Add(wheel);

            UpdateWheelTransformsWS(wheel, false);
            UpdateWheelTransform(GetNumWheels() - 1, false);
            return wheel;
        }