getWorldManifold() public méthode

Gets the world manifold.
public getWorldManifold ( System.Vector2 &normal, FixedArray2 &points ) : void
normal System.Vector2
points FixedArray2
Résultat void
Exemple #1
0
		void preSolve( Contact contact, ref Manifold oldManifold )
		{
			if( ( flags & DebugViewFlags.ContactPoints ) == DebugViewFlags.ContactPoints )
			{
				Manifold manifold = contact.manifold;

				if( manifold.pointCount == 0 )
					return;

				Fixture fixtureA = contact.fixtureA;

				FixedArray2<PointState> state1, state2;
				FarseerPhysics.Collision.Collision.getPointStates( out state1, out state2, ref oldManifold, ref manifold );

				FixedArray2<Vector2> points;
				Vector2 normal;
				contact.getWorldManifold( out normal, out points );

				for( int i = 0; i < manifold.pointCount && _pointCount < maxContactPoints; ++i )
				{
					if( fixtureA == null )
						_points[i] = new ContactPoint();

					ContactPoint cp = _points[_pointCount];
					cp.position = points[i];
					cp.normal = normal;
					cp.state = state2[i];
					_points[_pointCount] = cp;
					++_pointCount;
				}
			}
		}