Exemplo 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);
    }
Exemplo n.º 2
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);
        }