Rotary spring joints
Giống như Spring Joints, nhưng làm việc với các trục quay.
m_world->addJoint(PhysicsJointPin::construct(paddleBody1, boundBody, Vec2(300, 300))); m_world->addJoint(PhysicsJointPin::construct(paddleBody2, boundBody, Vec2(600, 300))); PhysicsJointRotarySpring* jointRotarySpring = PhysicsJointRotarySpring::construct(paddleBody1, paddleBody2, stiffness, damping); m_world->addJoint(jointRotarySpring);
Với boundBody là Physics Body của cái khung bao quanh màn hình.
Rotary limit joints
Giống như Limit Joint, nhưng làm việc với các trục quay.
m_world->addJoint(PhysicsJointPin::construct(paddleBody1, boundBody, Vec2(300, 300))); m_world->addJoint(PhysicsJointPin::construct(paddleBody2, boundBody, Vec2(600, 300))); PhysicsJointRotaryLimit* jointRotaryLimit = PhysicsJointRotarySpring::construct(paddleBody1, paddleBody2, min, max); m_world->addJoint(jointRotarySpring);
Ratchet joints
Làm việc như một ổ khóa, nếu xoay một trong các bodies, body còn lại sẽ quay cùng chiều với body ban đầu. Khi quay càng nhanh thì body còn lại sẽ quay theo càng nhanh. Nhưng nếu quay ngược lại thì body còn lại vẫn quay theo chiều ban đầu.
m_world->addJoint(PhysicsJointPin::construct(paddleBody1, boundBody, Vec2(300, 300))); m_world->addJoint(PhysicsJointPin::construct(paddleBody2, boundBody, Vec2(600, 300))); PhysicsJointRatchet* jointRotarySpring = PhysicsJointRachet::construct(paddleBody1, paddleBody2, phase, ratchet); m_world->addJoint(jointRotarySpring);
Gear joints
Giữ tỷ lệ vận tốc góc của cặp bodies tham gia vào joint liên tục. Tỷ lệ luôn luôn được đo trong điều kiện tuyệt đối.
m_world->addJoint(PhysicsJointPin::construct(paddleBody1, boundBody, Vec2(300, 300))); m_world->addJoint(PhysicsJointPin::construct(paddleBody2, boundBody, Vec2(600, 300))); PhysicsJointGear* jointRotarySpring = PhysicsJointGear::construct(paddleBody1, paddleBody2, phase, ratio); m_world->addJoint(jointRotarySpring);
Motor joints
Giữ vận tốc góc tương đối của hai đối tượng tham gia vào joint liên tục.
m_world->addJoint(PhysicsJointPin::construct(paddleBody1, boundBody, Vec2(300, 300))); m_world->addJoint(PhysicsJointPin::construct(paddleBody2, boundBody, Vec2(600, 300))); PhysicsJointMotor* jointRotarySpring = PhysicsJointRotarySpring::construct(paddleBody1, paddleBody2,rate); m_world->addJoint(jointRotarySpring);