Beispiel #1
0
        public void Draw(cpSlideJoint constraint)
        {
            cpVect a = cpTransform.Point(constraint.a.transform, constraint.GetAnchorA());
            cpVect b = cpTransform.Point(constraint.b.transform, constraint.GetAnchorB());

            DrawSegment(a, b, 1, cpColor.Grey);
            DrawDot(a, 5, CONSTRAINT_COLOR);
            DrawDot(b, 5, CONSTRAINT_COLOR);
        }
		public void Draw(cpSlideJoint constraint)
		{

			cpVect a = cpTransform.Point(constraint.a.transform, constraint.GetAnchorA());
			cpVect b = cpTransform.Point(constraint.b.transform, constraint.GetAnchorB());

			DrawSegment(a, b, 1, cpColor.Grey);
			DrawDot(a, 5, CONSTRAINT_COLOR);
			DrawDot(b, 5, CONSTRAINT_COLOR);

		}
Beispiel #3
0
		protected bool Init(CCPhysicsBody a, CCPhysicsBody b, CCPoint anchr1, CCPoint anchr2, float min, float max)
		{

			if (!base.Init(a, b))
				return false;

			cpConstraint joint = new cpSlideJoint(GetBodyInfo(a).Body, GetBodyInfo(b).Body,
                PhysicsHelper.CCPointToCpVect(anchr1),
                PhysicsHelper.CCPointToCpVect(anchr2),
										  min,
										  max);

			if (joint == null)
				return false;

			_info.Add(joint);

			return true;

		}
Beispiel #4
0
		protected bool Init(CCPhysicsBody a, CCPhysicsBody b, cpVect anchr1, cpVect anchr2, float min, float max)
		{

			if (!base.Init(a, b))
				return false;

			cpConstraint joint = new cpSlideJoint(GetBodyInfo(a).GetBody(), GetBodyInfo(b).GetBody(),
										  anchr1,
										  anchr2,
										  min,
										  max);

			if (joint == null)
				return false;

			_info.Add(joint);

			return true;

		}