/// <summary> /// Finds friction model type given native instance. /// </summary> /// <param name="native">Native friction model.</param> /// <returns>Native friction model type.</returns> public static EType FindType(agx.FrictionModel native) { if (native == null || native.asIterativeProjectedConeFriction() != null) { return(EType.IterativeProjectedFriction); } else if (native.asBoxFrictionModel() != null) { return(EType.BoxFriction); } return(EType.ScaleBoxFriction); }
/// <summary> /// Finds friction model type given native instance. /// </summary> /// <param name="native">Native friction model.</param> /// <returns>Native friction model type.</returns> public static EType FindType(agx.FrictionModel native) { if (native == null || native.asIterativeProjectedConeFriction() != null) { return(EType.IterativeProjectedFriction); } else if (native.asScaleBoxFrictionModel() != null) { return(EType.ScaleBoxFriction); } else if (native.asConstantNormalForceOrientedBoxFrictionModel() != null) { return(EType.ConstantNormalForceBoxFriction); } else if (native.asBoxFrictionModel() != null) { return(EType.BoxFriction); } Debug.LogWarning("Unknown native friction model type - returning default."); return(EType.IterativeProjectedFriction); }