FarseerPhysics.Dynamics.BreakableBody.onPostSolve C# (CSharp) Method

onPostSolve() public method

public onPostSolve ( Contact contact, ContactVelocityConstraint impulse ) : void
contact FarseerPhysics.Dynamics.Contacts.Contact
impulse FarseerPhysics.Dynamics.Contacts.ContactVelocityConstraint
return void
		void onPostSolve( Contact contact, ContactVelocityConstraint impulse )
		{
			if( !isBroken )
			{
				if( parts.Contains( contact.fixtureA ) || parts.Contains( contact.fixtureB ) )
				{
					float maxImpulse = 0.0f;
					int count = contact.manifold.pointCount;

					for( int i = 0; i < count; ++i )
					{
						maxImpulse = Math.Max( maxImpulse, impulse.points[i].normalImpulse );
					}

					if( maxImpulse > strength )
					{
						// Flag the body for breaking.
						_break = true;
					}
				}
			}
		}