/// <summary>This callback is called once for each wheel and sub step before the wheel constraints are setup and fed to the SDK. The values passed in the parameters can be adjusted to affect the vehicle simulation. The most interesting values are contactPosition, contactPoint, and contactNormal. The contactPosition value specifies how far on the travel distance the contactPoint was found. If you want to simulate a bumpy road, then this is the main parameter to change. It is also good to adjust the contactPoint variable, so that the wheel forces are applied in the correct position. </summary> /// <param name="wheelShape">The WheelShape that is being processed. </param> /// <param name="contactPoint">The contact point (in world coordinates) that is being used for the wheel. </param> /// <param name="contactNormal">The normal of the geometry at the contact point. </param> /// <param name="contactPosition">The distance on the spring travel distance where the wheel would end up if it was resting on the contact point. </param> /// <param name="normalForce">The normal force on the wheel from the last simulation step. </param> /// <param name="otherShape">The shape with which the wheel is in contact. </param> /// <param name="otherShapeMaterialIndex">The material on the other shape in the position where the wheel is in contact. Currently has no effect on the simulation. </param> /// <param name="otherShapeFeatureIndex">The feature on the other shape in the position where the wheel is in contact.</param> public virtual bool onWheelContact(NxWheelShape wheelShape, ref NxVec3 contactPoint, ref NxVec3 contactNormal, ref float contactPosition, ref float normalForce, NxShape otherShape, ref ushort otherShapeMaterialIndex, uint otherShapeFeatureIndex) { if (doSetFunctionPointers) { throw new System.NotSupportedException("Cannot call abstract base member"); } return NxUserWheelContactModify_onWheelContact_INVOKE(ClassPointer, doSetFunctionPointers, (wheelShape!=null ? wheelShape.ClassPointer : NullRef), ref contactPoint, ref contactNormal, ref contactPosition, ref normalForce, (otherShape!=null ? otherShape.ClassPointer : NullRef), ref otherShapeMaterialIndex, otherShapeFeatureIndex); }
private bool onWheelContact_virtual(IntPtr wheelShape, [In()] [Out()] ref NxVec3 contactPoint, [In()] [Out()] ref NxVec3 contactNormal, [In()] [Out()] ref float contactPosition, [In()] [Out()] ref float normalForce, IntPtr otherShape, [In()] [Out()] ref ushort otherShapeMaterialIndex, uint otherShapeFeatureIndex) { return onWheelContact(NxWheelShape.GetClass(wheelShape), ref contactPoint, ref contactNormal, ref contactPosition, ref normalForce, NxShape.GetClass(otherShape), ref otherShapeMaterialIndex, otherShapeFeatureIndex); }