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); }
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; }
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; }