Exemple #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;
 }
Exemple #2
0
        //public static PhysicsContact Construct(PhysicsShape a, PhysicsShape b)
        //{
        //	PhysicsContact contact = new PhysicsContact();
        //	if (contact != null && contact.Init(a, b))
        //	{
        //		return contact;
        //	}
        //	return null;
        //}

        bool Init(CCPhysicsShape a, CCPhysicsShape b)
        {
            if (a == null || b == null)
            {
                return(false);
            }

            _info = new CCPhysicsContactInfo(this);

            if (_info == null)
            {
                return(false);
            }

            _shapeA = a;
            _shapeB = b;

            return(true);
        }
		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 static PhysicsContact Construct(PhysicsShape a, PhysicsShape b)
		//{
		//	PhysicsContact contact = new PhysicsContact();
		//	if (contact != null && contact.Init(a, b))
		//	{
		//		return contact;
		//	}
		//	return null;
		//}

		bool Init(CCPhysicsShape a, CCPhysicsShape b)
		{
			if (a == null || b == null)
				return false;

			_info = new CCPhysicsContactInfo(this);

			if (_info != null)
				return false;

			_shapeA = a;
			_shapeB = b;

			return true;
		}