public void AddShape(CCPhysicsShapeInfo shape)
 {
     foreach (var item in shape.GetShapes())
     {
         _space.AddShape(item);
     }
 }
		public void RemoveShape(CCPhysicsShapeInfo shapeInf)
		{
			foreach (var shape in shapeInf.GetShapes())
			{
				if (_space.ContainsShape(shape))
					_space.RemoveShape(shape);
			}

		}
		public void AddShape(CCPhysicsShapeInfo shape)
		{

			foreach (var item in shape.GetShapes())
			{
				_space.AddShape(item);
			}

		}
 public void RemoveShape(CCPhysicsShapeInfo shapeInf)
 {
     foreach (var shape in shapeInf.GetShapes())
     {
         if (_space.ContainsShape(shape))
         {
             _space.RemoveShape(shape);
         }
     }
 }
Exemple #5
0
        public void SetRestitution(float restitution)
        {
            _material.restitution = restitution;

            foreach (cpShape shape in _info.GetShapes())
            {
                shape.SetElasticity(restitution);
            }
        }
 /** Test point is in shape or not */
 public bool ContainsPoint(CCPoint point)
 {
     foreach (var shape in _info.GetShapes())
     {
         cpPointQueryInfo info = null;
         shape.PointQuery(PhysicsHelper.CCPointToCpVect(point), ref info);
         if (info != null)
         {
             return(true);
         }
     }
     return(false);
 }