A joint edge is used to connect bodies and joints together in a joint graph where each body is a node and each joint is an edge. A joint edge belongs to a doubly linked list maintained in each attached body. Each joint has two joint nodes, one for each attached body.
Esempio n. 1
0
        /// <summary>
        /// Constructor for fixed joint
        /// </summary>
        protected Joint(Body body)
        {
            BodyA = body;

            //Connected bodies should not collide by default
            CollideConnected = false;

            EdgeA = new JointEdge();
        }
Esempio n. 2
0
        public JointEdge Copy()
        {
            JointEdge result = new JointEdge();

            result.Joint = this.Joint;
            result.Next  = this.Next;
            result.Other = this.Other;
            result.Prev  = this.Prev;
            return(result);
        }
Esempio n. 3
0
        protected Joint(Body body, Body bodyB)
        {
            Debug.Assert(body != bodyB);

            BodyA = body;
            EdgeA = new JointEdge();
            BodyB = bodyB;
            EdgeB = new JointEdge();

            //Connected bodies should not collide by default
            CollideConnected = false;
        }
Esempio n. 4
0
        public Joint Copy()
        {
            Joint result = (Joint)this.MemberwiseClone();

            JointEdge resultEdgeA = EdgeA.Copy();

            resultEdgeA.Joint = result;
            result.EdgeA      = resultEdgeA;

            JointEdge resultEdgeB = EdgeB.Copy();

            resultEdgeB.Joint = result;
            result.EdgeB      = resultEdgeB;

            return(result);
        }
Esempio n. 5
0
        void removeJoints(JointEdge jointEdge)
        {
            scene.World.RemoveJoint(jointEdge.Joint);

            if (jointEdge.Next != null)
                removeJoints(jointEdge.Next);
        }
Esempio n. 6
0
        /// <summary>
        /// Constructor for fixed joint
        /// </summary>
        protected Joint(Body body)
        {
            BodyA = body;

            //Connected bodies should not collide by default
            CollideConnected = false;

            EdgeA = new JointEdge();
        }
Esempio n. 7
0
        protected Joint(Body body, Body bodyB)
        {
            Debug.Assert(body != bodyB);

            BodyA = body;
            EdgeA = new JointEdge();
            BodyB = bodyB;
            EdgeB = new JointEdge();

            //Connected bodies should not collide by default
            CollideConnected = false;
        }