/// <summary> /// Creates a physics material that defines two materials behave when they physically /// interact. /// </summary> /// <remarks> /// 'materialName1' and 'materialName2' can be the same if you want to define how /// the same material behave when they physically interact. /// </remarks> /// <param name="materialName1">The first material name</param> /// <param name="materialName2">The second material name</param> /// <param name="collidable">Whether these two materials are collidable</param> /// <param name="staticFriction">The static friction coefficient</param> /// <param name="kineticFriction">The kinetic friction coefficient</param> /// <param name="softness">The softness of the material. Softness defines how fiercely /// the two materials will repel from each other when the two materials penetrate /// against each other</param> /// <param name="elasticity">The elasticity coefficient</param> /// <param name="contactBeginCallback">The callback function when two materials /// begin to contact. Set to 'null' if you don't need this callback function.</param> /// <param name="contactProcessCallback">The callback function when two materials /// proceed contact. Set to 'null' if you don't need this callback function.</param> /// <param name="contactEndCallback">The callback function when two materials /// end contact. Set to 'null' if you don't need this callback function.</param> public NewtonMaterial(String materialName1, String materialName2, bool collidable, float staticFriction, float kineticFriction, float softness, float elasticity, ContactBegin contactBeginCallback, ContactProcess contactProcessCallback, ContactEnd contactEndCallback) { this.materialName1 = materialName1; this.materialName2 = materialName2; this.collidable = collidable; this.staticFriction = staticFriction; this.kineticFriction = kineticFriction; this.elasticity = elasticity; this.softness = softness; this.contactBeginCallback = contactBeginCallback; this.contactProcessCallback = contactProcessCallback; this.contactEndCallback = contactEndCallback; }
static extern void NewtonMaterialSetCollisionCallback( int worldId, int c0, int c1, int sbz, ContactBegin ContactBeginCallback, ContactProcess ContactProcessCallback, ContactEnd ContactEndCallback);