public CCPhysicsContact() : base(PHYSICSCONTACT_EVENT_NAME) { _world = null; _shapeA = null; _shapeB = null; _eventCode = EventCode.NONE; _info = null; _notificationEnable = true; _result = true; _data = null; _contactInfo = null; _contactData = null; _preContactData = null; }
public void GenerateContactData() { if (_contactInfo == null) { return; } cpArbiter arb = (cpArbiter)_contactInfo; _preContactData = _contactData; _contactData = new CCPhysicsContactData(); for (int i = 0; i < _contactData.count && i < CCPhysicsContactData.POINT_MAX; ++i) { _contactData.points[i] = PhysicsHelper.cpVectToCCPoint(arb.GetPointA(i)); } _contactData.normal = _contactData.count > 0 ? PhysicsHelper.cpVectToCCPoint(arb.GetNormal()) : CCPoint.Zero; }
public void GenerateContactData() { if (_contactInfo == null) { return; } cpArbiter arb = (cpArbiter)_contactInfo; _preContactData = _contactData; _contactData = new CCPhysicsContactData(); for (int i = 0; i < _contactData.count && i < CCPhysicsContactData.POINT_MAX; ++i) { _contactData.points[i] = arb.GetPointA(i); } _contactData.normal = _contactData.count > 0 ? arb.GetNormal() : cpVect.Zero; }