예제 #1
0
 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;
 }
예제 #2
0
        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;
        }
예제 #3
0
		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;
		}
예제 #4
0
		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;
		}