Ejemplo n.º 1
0
        private void Draw(cpGrooveJoint constraint)
        {
            var a = constraint.a.LocalToWorld(constraint.grv_a);
            var b = constraint.a.LocalToWorld(constraint.grv_b);
            var c = constraint.b.LocalToWorld(constraint.anchorB);

            DrawSegment(a, b, 1, CONSTRAINT_COLOR);
            DrawCircle(c, 5f, CONSTRAINT_COLOR);
        }
Ejemplo n.º 2
0
		private void Draw(cpGrooveJoint constraint)
		{

			var a = constraint.a.LocalToWorld(constraint.grv_a);
			var b = constraint.a.LocalToWorld(constraint.grv_b);
			var c = constraint.b.LocalToWorld(constraint.anchorB);

			DrawSegment(a, b, 1, CONSTRAINT_COLOR);
			DrawCircle(c, 5f, CONSTRAINT_COLOR);
		}
Ejemplo n.º 3
0
		protected bool Init(CCPhysicsBody a, CCPhysicsBody b, CCPoint grooveA, CCPoint grooveB, CCPoint anchr)
		{

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

			cpConstraint joint = new cpGrooveJoint(GetBodyInfo(a).Body,
												   GetBodyInfo(b).Body,
                PhysicsHelper.CCPointToCpVect(grooveA),
                PhysicsHelper.CCPointToCpVect(grooveB),
                PhysicsHelper.CCPointToCpVect(anchr));


			if (joint == null)
				return false;

			_info.Add(joint);


			return true;

		}
Ejemplo n.º 4
0
		protected bool Init(CCPhysicsBody a, CCPhysicsBody b, cpVect grooveA, cpVect grooveB, cpVect anchr)
		{

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

			cpConstraint joint = new cpGrooveJoint(GetBodyInfo(a).GetBody(),
												   GetBodyInfo(b).GetBody(),
												  grooveA,
												  grooveB,
												  anchr);


			if (joint == null)
				return false;

			_info.Add(joint);


			return true;

		}