Book Image

iOS Game Programming Cookbook

Book Image

iOS Game Programming Cookbook

Overview of this book

Table of Contents (19 chapters)
iOS Game Programming Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Physics joints


We have already seen lots of interesting features of the physics engine. However, we can make our games even more interesting by connecting the physics bodies with each other using joints. All the physics simulation and forces will be applied on the bodies after considering the way they are joined together.

Getting ready

There are various ways of joining two physics bodies together. They vary based on the places and the location of the bodies that are joined. Joints are divided into the following types based on the ways they connect bodies with each other:

  • Pin Joint: This type of joint joins/pins two physics together such that they both can independently rotate around their anchor point. The joint will look something similar to following diagram:

  • Limit Joint: In this type of joints the bodies always maintain the fix maximum distance from each other. This is something like the bodies are connected to each other with a rote with a fixed maximum distance which is the length of...