public getWorldManifold ( System.Vector2 &normal, FixedArray2 |
||
normal | System.Vector2 | |
points | FixedArray2 |
|
return | void |
public void getWorldManifold( out Vector2 normal, out FixedArray2<Vector2> points )
{
var bodyA = fixtureA.body;
var bodyB = fixtureB.body;
var shapeA = fixtureA.shape;
var shapeB = fixtureB.shape;
ContactSolver.WorldManifold.initialize( ref manifold, ref bodyA._xf, shapeA.radius, ref bodyB._xf, shapeB.radius, out normal, out points );
}
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; } } }