<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Chipmunk2D Pro API Reference: ChipmunkSpace Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Chipmunk2D Pro API Reference
 <span id="projectnumber">7.0.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Properties</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> |
<a href="#pub-methods">Instance Methods</a> |
<a href="#pub-static-methods">Class Methods</a> |
<a href="#properties">Properties</a> |
<a href="class_chipmunk_space-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">ChipmunkSpace Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Chipmunk spaces are simulation containers.
<a href="interface_chipmunk_space.html#details">More...</a></p>
<p><code>#import <<a class="el" href="_chipmunk_space_8h_source.html">ChipmunkSpace.h</a>></code></p>
<p>Inherits NSObject.</p>
<p>Inherited by <a class="el" href="interface_chipmunk_hasty_space.html">ChipmunkHastySpace</a>.</p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a6d373427b2f1cafad437e080a37c2b6c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6d373427b2f1cafad437e080a37c2b6c"></a>
typedef void(^ </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_space.html#a6d373427b2f1cafad437e080a37c2b6c">ChipmunkPostStepBlock</a> )(void)</td></tr>
<tr class="memdesc:a6d373427b2f1cafad437e080a37c2b6c"><td class="mdescLeft"> </td><td class="mdescRight">Block type used with [<a class="el" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a> addPostStepBlock:]. <br/></td></tr>
<tr class="separator:a6d373427b2f1cafad437e080a37c2b6c"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Instance Methods</h2></td></tr>
<tr class="memitem:a30859e07744b8e7dd703267490e5f1a5"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a30859e07744b8e7dd703267490e5f1a5">setDefaultCollisionHandler:begin:preSolve:postSolve:separate:</a></td></tr>
<tr class="memdesc:a30859e07744b8e7dd703267490e5f1a5"><td class="mdescLeft"> </td><td class="mdescRight">Set the default collision handler. <a href="#a30859e07744b8e7dd703267490e5f1a5">More...</a><br/></td></tr>
<tr class="separator:a30859e07744b8e7dd703267490e5f1a5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a44655d0695181e505c88e29afe676b31"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a44655d0695181e505c88e29afe676b31">addCollisionHandler:typeA:typeB:begin:preSolve:postSolve:separate:</a></td></tr>
<tr class="memdesc:a44655d0695181e505c88e29afe676b31"><td class="mdescLeft"> </td><td class="mdescRight">Set a collision handler to handle specific collision types. <a href="#a44655d0695181e505c88e29afe676b31">More...</a><br/></td></tr>
<tr class="separator:a44655d0695181e505c88e29afe676b31"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3c7c9546e958d23fac51a740ddfbfecd"><td class="memItemLeft" align="right" valign="top">(id) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a3c7c9546e958d23fac51a740ddfbfecd">add:</a></td></tr>
<tr class="memdesc:a3c7c9546e958d23fac51a740ddfbfecd"><td class="mdescLeft"> </td><td class="mdescRight">Add an object to the space. <a href="#a3c7c9546e958d23fac51a740ddfbfecd">More...</a><br/></td></tr>
<tr class="separator:a3c7c9546e958d23fac51a740ddfbfecd"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a59ea2ee0045c5301ecd0f3c5353b372f"><td class="memItemLeft" align="right" valign="top">(id) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a59ea2ee0045c5301ecd0f3c5353b372f">remove:</a></td></tr>
<tr class="memdesc:a59ea2ee0045c5301ecd0f3c5353b372f"><td class="mdescLeft"> </td><td class="mdescRight">Remove an object from the space. <a href="#a59ea2ee0045c5301ecd0f3c5353b372f">More...</a><br/></td></tr>
<tr class="separator:a59ea2ee0045c5301ecd0f3c5353b372f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7b3f97e1409e89399cefb4e92eed1bb5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7b3f97e1409e89399cefb4e92eed1bb5"></a>
(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a7b3f97e1409e89399cefb4e92eed1bb5">contains:</a></td></tr>
<tr class="memdesc:a7b3f97e1409e89399cefb4e92eed1bb5"><td class="mdescLeft"> </td><td class="mdescRight">Check if a space already contains a particular object: <br/></td></tr>
<tr class="separator:a7b3f97e1409e89399cefb4e92eed1bb5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6922581e458a8c0a7476df1f7bbe7fae"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6922581e458a8c0a7476df1f7bbe7fae"></a>
(id) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a6922581e458a8c0a7476df1f7bbe7fae">smartAdd:</a></td></tr>
<tr class="memdesc:a6922581e458a8c0a7476df1f7bbe7fae"><td class="mdescLeft"> </td><td class="mdescRight">If the space is locked and it's unsafe to call add: it will call addPostStepAddition: instead. <br/></td></tr>
<tr class="separator:a6922581e458a8c0a7476df1f7bbe7fae"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a651f5d3f7f52d15107499385f8bac05d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a651f5d3f7f52d15107499385f8bac05d"></a>
(id) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a651f5d3f7f52d15107499385f8bac05d">smartRemove:</a></td></tr>
<tr class="memdesc:a651f5d3f7f52d15107499385f8bac05d"><td class="mdescLeft"> </td><td class="mdescRight">If the space is locked and it's unsafe to call remove: it will call addPostStepRemoval: instead. <br/></td></tr>
<tr class="separator:a651f5d3f7f52d15107499385f8bac05d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aba148d84cea04c5b2c438a6a643b313b"><td class="memItemLeft" align="right" valign="top">(NSArray *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#aba148d84cea04c5b2c438a6a643b313b">addBounds:thickness:elasticity:friction:filter:collisionType:</a></td></tr>
<tr class="memdesc:aba148d84cea04c5b2c438a6a643b313b"><td class="mdescLeft"> </td><td class="mdescRight">Handy utility method to add a border of collision segments around a box. <a href="#aba148d84cea04c5b2c438a6a643b313b">More...</a><br/></td></tr>
<tr class="separator:aba148d84cea04c5b2c438a6a643b313b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a70c4c5287cbf6321474c14cc811e094a"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a70c4c5287cbf6321474c14cc811e094a">addPostStepCallback:selector:key:</a></td></tr>
<tr class="memdesc:a70c4c5287cbf6321474c14cc811e094a"><td class="mdescLeft"> </td><td class="mdescRight">Define a callback to be run just before [<a class="el" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a> step:] finishes. <a href="#a70c4c5287cbf6321474c14cc811e094a">More...</a><br/></td></tr>
<tr class="separator:a70c4c5287cbf6321474c14cc811e094a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a601fc53c6df561210fefedf9e6d5e2f0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a601fc53c6df561210fefedf9e6d5e2f0"></a>
(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a601fc53c6df561210fefedf9e6d5e2f0">addPostStepBlock:key:</a></td></tr>
<tr class="memdesc:a601fc53c6df561210fefedf9e6d5e2f0"><td class="mdescLeft"> </td><td class="mdescRight">Same as [<a class="el" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a> addPostStepCallback:] but with a block. The block is copied. <br/></td></tr>
<tr class="separator:a601fc53c6df561210fefedf9e6d5e2f0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afe4e87fa5df76a3e85dfe05d4bd917d0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afe4e87fa5df76a3e85dfe05d4bd917d0"></a>
(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#afe4e87fa5df76a3e85dfe05d4bd917d0">addPostStepAddition:</a></td></tr>
<tr class="memdesc:afe4e87fa5df76a3e85dfe05d4bd917d0"><td class="mdescLeft"> </td><td class="mdescRight">Add the Chipmunk Object to the space at the end of the step. <br/></td></tr>
<tr class="separator:afe4e87fa5df76a3e85dfe05d4bd917d0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a64f0b58af1ee6de24086f05e31c958ea"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a64f0b58af1ee6de24086f05e31c958ea"></a>
(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a64f0b58af1ee6de24086f05e31c958ea">addPostStepRemoval:</a></td></tr>
<tr class="memdesc:a64f0b58af1ee6de24086f05e31c958ea"><td class="mdescLeft"> </td><td class="mdescRight">Remove the Chipmunk Object from the space at the end of the step. <br/></td></tr>
<tr class="separator:a64f0b58af1ee6de24086f05e31c958ea"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acf8ab8981d9b90e001c8fb1083bbcc08"><td class="memItemLeft" align="right" valign="top">(NSArray *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#acf8ab8981d9b90e001c8fb1083bbcc08">pointQueryAll:maxDistance:filter:</a></td></tr>
<tr class="memdesc:acf8ab8981d9b90e001c8fb1083bbcc08"><td class="mdescLeft"> </td><td class="mdescRight">Return an array of ChipmunkNearestPointQueryInfo objects for shapes within <code>maxDistance</code> of <code>point</code>. <a href="#acf8ab8981d9b90e001c8fb1083bbcc08">More...</a><br/></td></tr>
<tr class="separator:acf8ab8981d9b90e001c8fb1083bbcc08"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a50246df09637c9b70e30c6c22c7892eb"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interface_chipmunk_point_query_info.html">ChipmunkPointQueryInfo</a> *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a50246df09637c9b70e30c6c22c7892eb">pointQueryNearest:maxDistance:filter:</a></td></tr>
<tr class="memdesc:a50246df09637c9b70e30c6c22c7892eb"><td class="mdescLeft"> </td><td class="mdescRight">Find the closest shape to a point that is within <code>maxDistance</code> of <code>point</code>. <a href="#a50246df09637c9b70e30c6c22c7892eb">More...</a><br/></td></tr>
<tr class="separator:a50246df09637c9b70e30c6c22c7892eb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af093af367e7fd1ec9a3aaa44409ec6ad"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af093af367e7fd1ec9a3aaa44409ec6ad"></a>
(NSArray *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#af093af367e7fd1ec9a3aaa44409ec6ad">segmentQueryAllFrom:to:radius:filter:</a></td></tr>
<tr class="memdesc:af093af367e7fd1ec9a3aaa44409ec6ad"><td class="mdescLeft"> </td><td class="mdescRight">Return a NSArray of <a class="el" href="interface_chipmunk_segment_query_info.html" title="Holds collision information from segment queries. You should never need to create one...">ChipmunkSegmentQueryInfo</a> objects for all the shapes that overlap the segment. The objects are unsorted. <br/></td></tr>
<tr class="separator:af093af367e7fd1ec9a3aaa44409ec6ad"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2c07aa19af2e0e07c3dbbe3e63099492"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2c07aa19af2e0e07c3dbbe3e63099492"></a>
(<a class="el" href="interface_chipmunk_segment_query_info.html">ChipmunkSegmentQueryInfo</a> *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a2c07aa19af2e0e07c3dbbe3e63099492">segmentQueryFirstFrom:to:radius:filter:</a></td></tr>
<tr class="memdesc:a2c07aa19af2e0e07c3dbbe3e63099492"><td class="mdescLeft"> </td><td class="mdescRight">Returns the first shape that overlaps the given segment. The segment is treated as having the given group and layers. <br/></td></tr>
<tr class="separator:a2c07aa19af2e0e07c3dbbe3e63099492"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a520446c4c453230a509c09a07017ba6e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a520446c4c453230a509c09a07017ba6e"></a>
(NSArray *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a520446c4c453230a509c09a07017ba6e">bbQueryAll:filter:</a></td></tr>
<tr class="memdesc:a520446c4c453230a509c09a07017ba6e"><td class="mdescLeft"> </td><td class="mdescRight">Returns a NSArray of all shapes whose bounding boxes overlap the given bounding box. The box is treated as having the given group and layers. <br/></td></tr>
<tr class="separator:a520446c4c453230a509c09a07017ba6e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad38f1e3da89b9a3eb3e9dc73df977954"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad38f1e3da89b9a3eb3e9dc73df977954"></a>
(NSArray *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#ad38f1e3da89b9a3eb3e9dc73df977954">shapeQueryAll:</a></td></tr>
<tr class="memdesc:ad38f1e3da89b9a3eb3e9dc73df977954"><td class="mdescLeft"> </td><td class="mdescRight">Returns a NSArray of <a class="el" href="interface_chipmunk_shape_query_info.html" title="Holds collision information from segment queries. You should never need to create one...">ChipmunkShapeQueryInfo</a> objects for all the shapes that overlap <code>shape</code>. <br/></td></tr>
<tr class="separator:ad38f1e3da89b9a3eb3e9dc73df977954"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9d1b5e13dc34625e1260f2cc428b9de5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9d1b5e13dc34625e1260f2cc428b9de5"></a>
(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a9d1b5e13dc34625e1260f2cc428b9de5">shapeTest:</a></td></tr>
<tr class="memdesc:a9d1b5e13dc34625e1260f2cc428b9de5"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the shape overlaps anything in the space. <br/></td></tr>
<tr class="separator:a9d1b5e13dc34625e1260f2cc428b9de5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6910bd876890703dd30f7e46736f88b1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6910bd876890703dd30f7e46736f88b1"></a>
(NSArray *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a6910bd876890703dd30f7e46736f88b1">bodies</a></td></tr>
<tr class="memdesc:a6910bd876890703dd30f7e46736f88b1"><td class="mdescLeft"> </td><td class="mdescRight">Get a copy of the list of all the bodies in the space. <br/></td></tr>
<tr class="separator:a6910bd876890703dd30f7e46736f88b1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aba89ce69592a80749d3e019d759f0871"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aba89ce69592a80749d3e019d759f0871"></a>
(NSArray *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#aba89ce69592a80749d3e019d759f0871">shapes</a></td></tr>
<tr class="memdesc:aba89ce69592a80749d3e019d759f0871"><td class="mdescLeft"> </td><td class="mdescRight">Get a copy of the list of all the shapes in the space. <br/></td></tr>
<tr class="separator:aba89ce69592a80749d3e019d759f0871"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a32d8c540d18f4a6ffeed754face7048c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a32d8c540d18f4a6ffeed754face7048c"></a>
(NSArray *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a32d8c540d18f4a6ffeed754face7048c">constraints</a></td></tr>
<tr class="memdesc:a32d8c540d18f4a6ffeed754face7048c"><td class="mdescLeft"> </td><td class="mdescRight">Get a copy of the list of all the constraints in the space. <br/></td></tr>
<tr class="separator:a32d8c540d18f4a6ffeed754face7048c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a74612d62b4b6bea07eeeeda9a5db3664"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a74612d62b4b6bea07eeeeda9a5db3664"></a>
(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a74612d62b4b6bea07eeeeda9a5db3664">reindexStatic</a></td></tr>
<tr class="memdesc:a74612d62b4b6bea07eeeeda9a5db3664"><td class="mdescLeft"> </td><td class="mdescRight">Update all the static shapes. <br/></td></tr>
<tr class="separator:a74612d62b4b6bea07eeeeda9a5db3664"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa5454a9054f51ff42b299ac68027721a"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#aa5454a9054f51ff42b299ac68027721a">reindexShape:</a></td></tr>
<tr class="memdesc:aa5454a9054f51ff42b299ac68027721a"><td class="mdescLeft"> </td><td class="mdescRight">Update the collision info for a single shape. <a href="#aa5454a9054f51ff42b299ac68027721a">More...</a><br/></td></tr>
<tr class="separator:aa5454a9054f51ff42b299ac68027721a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af51faf937f258387df9c1b89768dd746"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af51faf937f258387df9c1b89768dd746"></a>
(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#af51faf937f258387df9c1b89768dd746">reindexShapesForBody:</a></td></tr>
<tr class="memdesc:af51faf937f258387df9c1b89768dd746"><td class="mdescLeft"> </td><td class="mdescRight">Update the collision info for all shapes attached to a body. <br/></td></tr>
<tr class="separator:af51faf937f258387df9c1b89768dd746"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7ca0baa1f9f99376e474f7e9b3bb1309"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7ca0baa1f9f99376e474f7e9b3bb1309"></a>
(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_space.html#a7ca0baa1f9f99376e474f7e9b3bb1309">step:</a></td></tr>
<tr class="memdesc:a7ca0baa1f9f99376e474f7e9b3bb1309"><td class="mdescLeft"> </td><td class="mdescRight">Step time forward. While variable timesteps may be used, a constant timestep will allow you to reduce CPU usage by using fewer iterations. <br/></td></tr>
<tr class="separator:a7ca0baa1f9f99376e474f7e9b3bb1309"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Class Methods</h2></td></tr>
<tr class="memitem:a355b38ec2cabce5e0643af6005598b8d"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interface_chipmunk_space.html">ChipmunkSpace</a> *) </td><td class="memItemRight" valign="bottom">+ <a class="el" href="interface_chipmunk_space.html#a355b38ec2cabce5e0643af6005598b8d">spaceFromCPSpace:</a></td></tr>
<tr class="memdesc:a355b38ec2cabce5e0643af6005598b8d"><td class="mdescLeft"> </td><td class="mdescRight">Get the <a class="el" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a> object associciated with a <a class="el" href="structcp_space.html">cpSpace</a> pointer. <a href="#a355b38ec2cabce5e0643af6005598b8d">More...</a><br/></td></tr>
<tr class="separator:a355b38ec2cabce5e0643af6005598b8d"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="properties"></a>
Properties</h2></td></tr>
<tr class="memitem:a14ae29e48719422333bc51ebfc292553"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_space.html#a14ae29e48719422333bc51ebfc292553">iterations</a></td></tr>
<tr class="memdesc:a14ae29e48719422333bc51ebfc292553"><td class="mdescLeft"> </td><td class="mdescRight">The iteration count is how many solver passes the space should use when solving collisions and joints (default is 10). <a href="#a14ae29e48719422333bc51ebfc292553">More...</a><br/></td></tr>
<tr class="separator:a14ae29e48719422333bc51ebfc292553"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afb02e25c8c4f20a9598b2602c0e6f2e6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afb02e25c8c4f20a9598b2602c0e6f2e6"></a>
<a class="el" href="structcp_vect.html">cpVect</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_space.html#afb02e25c8c4f20a9598b2602c0e6f2e6">gravity</a></td></tr>
<tr class="memdesc:afb02e25c8c4f20a9598b2602c0e6f2e6"><td class="mdescLeft"> </td><td class="mdescRight">Global gravity value to use for all rigid bodies in this space (default value is <code>cpvzero</code>). <br/></td></tr>
<tr class="separator:afb02e25c8c4f20a9598b2602c0e6f2e6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a591e8e360264f67fc7f6f4494dde10b7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__basic_types.html#gac1ed65573e035bf892505768c852d8d3">cpFloat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_space.html#a591e8e360264f67fc7f6f4494dde10b7">damping</a></td></tr>
<tr class="memdesc:a591e8e360264f67fc7f6f4494dde10b7"><td class="mdescLeft"> </td><td class="mdescRight">Global viscous damping value to use for all rigid bodies in this space (default value is 1.0 which disables damping). <a href="#a591e8e360264f67fc7f6f4494dde10b7">More...</a><br/></td></tr>
<tr class="separator:a591e8e360264f67fc7f6f4494dde10b7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad79276e72714d0e3d8025fb51efca906"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad79276e72714d0e3d8025fb51efca906"></a>
<a class="el" href="group__basic_types.html#gac1ed65573e035bf892505768c852d8d3">cpFloat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_space.html#ad79276e72714d0e3d8025fb51efca906">idleSpeedThreshold</a></td></tr>
<tr class="memdesc:ad79276e72714d0e3d8025fb51efca906"><td class="mdescLeft"> </td><td class="mdescRight">If a body is moving slower than this speed, it is considered idle. The default value is 0, which signals that the space should guess a good value based on the current gravity. <br/></td></tr>
<tr class="separator:ad79276e72714d0e3d8025fb51efca906"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8137619872454fb466471ac5af743347"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__basic_types.html#gac1ed65573e035bf892505768c852d8d3">cpFloat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_space.html#a8137619872454fb466471ac5af743347">sleepTimeThreshold</a></td></tr>
<tr class="memdesc:a8137619872454fb466471ac5af743347"><td class="mdescLeft"> </td><td class="mdescRight">Elapsed time before a group of idle bodies is put to sleep (defaults to infinity which disables sleeping). <a href="#a8137619872454fb466471ac5af743347">More...</a><br/></td></tr>
<tr class="separator:a8137619872454fb466471ac5af743347"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6068fdf28eb183b1d45aac4f6c705fff"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__basic_types.html#gac1ed65573e035bf892505768c852d8d3">cpFloat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_space.html#a6068fdf28eb183b1d45aac4f6c705fff">collisionSlop</a></td></tr>
<tr class="memdesc:a6068fdf28eb183b1d45aac4f6c705fff"><td class="mdescLeft"> </td><td class="mdescRight">Amount of encouraged penetration between colliding shapes. <a href="#a6068fdf28eb183b1d45aac4f6c705fff">More...</a><br/></td></tr>
<tr class="separator:a6068fdf28eb183b1d45aac4f6c705fff"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4328a8f473c7082520259e5ec6c8a100"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__basic_types.html#gac1ed65573e035bf892505768c852d8d3">cpFloat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_space.html#a4328a8f473c7082520259e5ec6c8a100">collisionBias</a></td></tr>
<tr class="memdesc:a4328a8f473c7082520259e5ec6c8a100"><td class="mdescLeft"> </td><td class="mdescRight">Determines how fast overlapping shapes are pushed apart. <a href="#a4328a8f473c7082520259e5ec6c8a100">More...</a><br/></td></tr>
<tr class="separator:a4328a8f473c7082520259e5ec6c8a100"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2cdefacf8c4c442a8de938f689beae24"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__basic_types.html#gaa24652c104082d0725066ea5ac7dc83f">cpTimestamp</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_space.html#a2cdefacf8c4c442a8de938f689beae24">collisionPersistence</a></td></tr>
<tr class="memdesc:a2cdefacf8c4c442a8de938f689beae24"><td class="mdescLeft"> </td><td class="mdescRight">Number of frames that contact information should persist. <a href="#a2cdefacf8c4c442a8de938f689beae24">More...</a><br/></td></tr>
<tr class="separator:a2cdefacf8c4c442a8de938f689beae24"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abea8947ecd2c50ed272d91ae051ceb43"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abea8947ecd2c50ed272d91ae051ceb43"></a>
<a class="el" href="structcp_space.html">cpSpace</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43">space</a></td></tr>
<tr class="memdesc:abea8947ecd2c50ed272d91ae051ceb43"><td class="mdescLeft"> </td><td class="mdescRight">Returns a pointer to the underlying <a class="el" href="structcp_space.html">cpSpace</a> C struct. <br/></td></tr>
<tr class="separator:abea8947ecd2c50ed272d91ae051ceb43"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a858a6a13360cc3bbbb79339b76af1554"><td class="memItemLeft" align="right" valign="top"><a class="el" href="interface_chipmunk_body.html">ChipmunkBody</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_space.html#a858a6a13360cc3bbbb79339b76af1554">staticBody</a></td></tr>
<tr class="memdesc:a858a6a13360cc3bbbb79339b76af1554"><td class="mdescLeft"> </td><td class="mdescRight">The space's designated static body. <a href="#a858a6a13360cc3bbbb79339b76af1554">More...</a><br/></td></tr>
<tr class="separator:a858a6a13360cc3bbbb79339b76af1554"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4001e81be1b64ee426f08ded1c82da89"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4001e81be1b64ee426f08ded1c82da89"></a>
<a class="el" href="group__basic_types.html#gac1ed65573e035bf892505768c852d8d3">cpFloat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_space.html#a4001e81be1b64ee426f08ded1c82da89">currentTimeStep</a></td></tr>
<tr class="memdesc:a4001e81be1b64ee426f08ded1c82da89"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the current (if you are in a callback from [<a class="el" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a> step:]) or most recent (outside of a [<a class="el" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a> step:] call) timestep. <br/></td></tr>
<tr class="separator:a4001e81be1b64ee426f08ded1c82da89"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac9d4fc919b094440420e12c0de645977"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac9d4fc919b094440420e12c0de645977"></a>
BOOL </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_space.html#ac9d4fc919b094440420e12c0de645977">locked</a></td></tr>
<tr class="memdesc:ac9d4fc919b094440420e12c0de645977"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the space is currently executing a timestep. <br/></td></tr>
<tr class="separator:ac9d4fc919b094440420e12c0de645977"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa2c62f81e33d3a64d6d4a111e2aa2c4c"><td class="memItemLeft" align="right" valign="top">id </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_space.html#aa2c62f81e33d3a64d6d4a111e2aa2c4c">userData</a></td></tr>
<tr class="memdesc:aa2c62f81e33d3a64d6d4a111e2aa2c4c"><td class="mdescLeft"> </td><td class="mdescRight">An object that this space is associated with. <a href="#aa2c62f81e33d3a64d6d4a111e2aa2c4c">More...</a><br/></td></tr>
<tr class="separator:aa2c62f81e33d3a64d6d4a111e2aa2c4c"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Chipmunk spaces are simulation containers. </p>
<p>You add a bunch of physics objects to a space (rigid bodies, collision shapes, and joints) and step the entire space forward through time as a whole. If you have Chipmunk Pro, you'll want to use the <a class="el" href="interface_chipmunk_hasty_space.html" title="ChipmunkHastySpace is an Objective-Chipmunk wrapper for cpHastySpace.">ChipmunkHastySpace</a> subclass instead as it has iPhone specific optimizations. Unfortunately because of how Objective-C code is linked I can't dynamically substitute a <a class="el" href="interface_chipmunk_hasty_space.html" title="ChipmunkHastySpace is an Objective-Chipmunk wrapper for cpHastySpace.">ChipmunkHastySpace</a> from a static library. </p>
</div><h2 class="groupheader">Method Documentation</h2>
<a class="anchor" id="a3c7c9546e958d23fac51a740ddfbfecd"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (id) add: </td>
<td></td>
<td class="paramtype">(NSObject< <a class="el" href="protocol_chipmunk_object-p.html">ChipmunkObject</a> > *) </td>
<td class="paramname"><em>obj</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Add an object to the space. </p>
<p>This can be any object that implements the <a class="el" href="protocol_chipmunk_object-p.html" title="Allows you to add composite objects to a space in a single method call.">ChipmunkObject</a> protocol. This includes all the basic types such as <a class="el" href="interface_chipmunk_body.html" title="Rigid bodies are the basic unit of simulation in Chipmunk.">ChipmunkBody</a>, <a class="el" href="interface_chipmunk_shape.html" title="Abstract base class for collsion shape types.">ChipmunkShape</a> and <a class="el" href="interface_chipmunk_constraint.html" title="Constraints connect two ChipmunkBody objects together.">ChipmunkConstraint</a> as well as any composite game objects you may define that implement the protocol. </p>
<dl class="section warning"><dt>Warning</dt><dd>This method may not be called from a collision handler callback. See smartAdd: or ChipmunkSpace.addPostStepCallback:selector:context: for information on how to do that. </dd></dl>
</div>
</div>
<a class="anchor" id="aba148d84cea04c5b2c438a6a643b313b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (NSArray *) addBounds: </td>
<td></td>
<td class="paramtype">(<a class="el" href="structcp_b_b.html">cpBB</a>) </td>
<td class="paramname"><em>bounds</em></td>
</tr>
<tr>
<td class="paramkey">thickness:</td>
<td></td>
<td class="paramtype">(<a class="el" href="group__basic_types.html#gac1ed65573e035bf892505768c852d8d3">cpFloat</a>) </td>
<td class="paramname"><em>radius</em></td>
</tr>
<tr>
<td class="paramkey">elasticity:</td>
<td></td>
<td class="paramtype">(<a class="el" href="group__basic_types.html#gac1ed65573e035bf892505768c852d8d3">cpFloat</a>) </td>
<td class="paramname"><em>elasticity</em></td>
</tr>
<tr>
<td class="paramkey">friction:</td>
<td></td>
<td class="paramtype">(<a class="el" href="group__basic_types.html#gac1ed65573e035bf892505768c852d8d3">cpFloat</a>) </td>
<td class="paramname"><em>friction</em></td>
</tr>
<tr>
<td class="paramkey">filter:</td>
<td></td>
<td class="paramtype">(<a class="el" href="structcp_shape_filter.html">cpShapeFilter</a>) </td>
<td class="paramname"><em>filter</em></td>
</tr>
<tr>
<td class="paramkey">collisionType:</td>
<td></td>
<td class="paramtype">(id) </td>
<td class="paramname"><em>collisionType</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Handy utility method to add a border of collision segments around a box. </p>
<p>See <a class="el" href="interface_chipmunk_shape.html" title="Abstract base class for collsion shape types.">ChipmunkShape</a> for more information on the other parameters. Returns an NSArray of the shapes. Since NSArray implements the <a class="el" href="protocol_chipmunk_object-p.html" title="Allows you to add composite objects to a space in a single method call.">ChipmunkObject</a> protocol, you can use the [<a class="el" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a> remove:] method to remove the bounds. </p>
</div>
</div>
<a class="anchor" id="a44655d0695181e505c88e29afe676b31"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) addCollisionHandler: </td>
<td></td>
<td class="paramtype">(id) </td>
<td class="paramname"><em>delegate</em></td>
</tr>
<tr>
<td class="paramkey">typeA:</td>
<td></td>
<td class="paramtype">(<a class="el" href="group__basic_types.html#gae83e2f50965eb441e36ffff1e32e6d02">cpCollisionType</a>) </td>
<td class="paramname"><em>a</em></td>
</tr>
<tr>
<td class="paramkey">typeB:</td>
<td></td>
<td class="paramtype">(<a class="el" href="group__basic_types.html#gae83e2f50965eb441e36ffff1e32e6d02">cpCollisionType</a>) </td>
<td class="paramname"><em>b</em></td>
</tr>
<tr>
<td class="paramkey">begin:</td>
<td></td>
<td class="paramtype">(SEL) </td>
<td class="paramname"><em>begin</em></td>
</tr>
<tr>
<td class="paramkey">preSolve:</td>
<td></td>
<td class="paramtype">(SEL) </td>
<td class="paramname"><em>preSolve</em></td>
</tr>
<tr>
<td class="paramkey">postSolve:</td>
<td></td>
<td class="paramtype">(SEL) </td>
<td class="paramname"><em>postSolve</em></td>
</tr>
<tr>
<td class="paramkey">separate:</td>
<td></td>
<td class="paramtype">(SEL) </td>
<td class="paramname"><em>separate</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set a collision handler to handle specific collision types. </p>
<p>The methods are called only when shapes with the specified collisionTypes collide.</p>
<p><code>typeA</code> and <code>typeB</code> should be the same object references set to <a class="el" href="interface_chipmunk_shape.html#a4a72455ce454f3e56ea49eb2232ad899" title="An object reference used as a collision type identifier.">ChipmunkShape.collisionType</a>. They can be any uniquely identifying object. Class and global NSString objects work well as collision types as they are easy to get a reference to and do not require you to allocate any objects.</p>
<p>The expected method selectors are as follows: </p>
<div class="fragment"><div class="line">- (bool)begin:(<a class="code" href="structcp_arbiter.html">cpArbiter</a> *)arbiter <a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a>:(<a class="code" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a>*)<a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a></div>
<div class="line">- (<span class="keywordtype">bool</span>)preSolve:(<a class="code" href="structcp_arbiter.html">cpArbiter</a> *)arbiter <a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a>:(<a class="code" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a>*)<a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a></div>
<div class="line">- (void)postSolve:(<a class="code" href="structcp_arbiter.html">cpArbiter</a> *)arbiter <a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a>:(<a class="code" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a>*)<a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a></div>
<div class="line">- (<span class="keywordtype">void</span>)separate:(<a class="code" href="structcp_arbiter.html">cpArbiter</a> *)arbiter <a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a>:(<a class="code" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a>*)<a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a70c4c5287cbf6321474c14cc811e094a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (BOOL) addPostStepCallback: </td>
<td></td>
<td class="paramtype">(id) </td>
<td class="paramname"><em>target</em></td>
</tr>
<tr>
<td class="paramkey">selector:</td>
<td></td>
<td class="paramtype">(SEL) </td>
<td class="paramname"><em>selector</em></td>
</tr>
<tr>
<td class="paramkey">key:</td>
<td></td>
<td class="paramtype">(id) </td>
<td class="paramname"><em>key</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Define a callback to be run just before [<a class="el" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a> step:] finishes. </p>
<p>The main reason you want to define post-step callbacks is to get around the restriction that you cannot call the add/remove methods from a collision handler callback. Post-step callbacks run right before the next (or current) call to <a class="el" href="interface_chipmunk_space.html#a7ca0baa1f9f99376e474f7e9b3bb1309" title="Step time forward. While variable timesteps may be used, a constant timestep will allow you to reduce...">step:</a> returns when it is safe to add and remove objects. You can only schedule one post-step callback per key value, this prevents you from accidentally removing an object twice. Registering a second callback for the same key is a no-op.</p>
<p>The method signature of the method should be: </p>
<div class="fragment"><div class="line">- (void)postStepCallback:(<span class="keywordtype">id</span>)key</code></pre></div>
</div><!-- fragment --><p>This makes it easy to call a removal method on your game controller to remove a game object that died or was destroyed as the result of a collision: </p>
<div class="fragment"><div class="line">[<a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a> addPostStepCallback:gameController selector:<span class="keyword">@selector</span>(<span class="keyword">remove</span>:) key:gameObject];</div>
</div><!-- fragment --><dl class="section attention"><dt>Attention</dt><dd>Not to be confused with post-solve collision handler callbacks. </dd></dl>
<dl class="section warning"><dt>Warning</dt><dd><code>target</code> and <code>object</code> cannot be retained by the <a class="el" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a>. If you need to release either after registering the callback, use autorelease to ensure that they won't be deallocated until after [<a class="el" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a> step:] returns. </dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="interface_chipmunk_space.html#a64f0b58af1ee6de24086f05e31c958ea" title="Remove the Chipmunk Object from the space at the end of the step.">- addPostStepRemoval:</a> </dd></dl>
</div>
</div>
<a class="anchor" id="acf8ab8981d9b90e001c8fb1083bbcc08"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (NSArray *) pointQueryAll: </td>
<td></td>
<td class="paramtype">(<a class="el" href="structcp_vect.html">cpVect</a>) </td>
<td class="paramname"><em>point</em></td>
</tr>
<tr>
<td class="paramkey">maxDistance:</td>
<td></td>
<td class="paramtype">(<a class="el" href="group__basic_types.html#gac1ed65573e035bf892505768c852d8d3">cpFloat</a>) </td>
<td class="paramname"><em>maxDistance</em></td>
</tr>
<tr>
<td class="paramkey">filter:</td>
<td></td>
<td class="paramtype">(<a class="el" href="structcp_shape_filter.html">cpShapeFilter</a>) </td>
<td class="paramname"><em>filter</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Return an array of ChipmunkNearestPointQueryInfo objects for shapes within <code>maxDistance</code> of <code>point</code>. </p>
<p>The point is treated as having the given group and layers. </p>
</div>
</div>
<a class="anchor" id="a50246df09637c9b70e30c6c22c7892eb"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (<a class="el" href="interface_chipmunk_point_query_info.html">ChipmunkPointQueryInfo</a> *) pointQueryNearest: </td>
<td></td>
<td class="paramtype">(<a class="el" href="structcp_vect.html">cpVect</a>) </td>
<td class="paramname"><em>point</em></td>
</tr>
<tr>
<td class="paramkey">maxDistance:</td>
<td></td>
<td class="paramtype">(<a class="el" href="group__basic_types.html#gac1ed65573e035bf892505768c852d8d3">cpFloat</a>) </td>
<td class="paramname"><em>maxDistance</em></td>
</tr>
<tr>
<td class="paramkey">filter:</td>
<td></td>
<td class="paramtype">(<a class="el" href="structcp_shape_filter.html">cpShapeFilter</a>) </td>
<td class="paramname"><em>filter</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Find the closest shape to a point that is within <code>maxDistance</code> of <code>point</code>. </p>
<p>The point is treated as having the given layers and group. </p>
</div>
</div>
<a class="anchor" id="aa5454a9054f51ff42b299ac68027721a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) reindexShape: </td>
<td></td>
<td class="paramtype">(<a class="el" href="interface_chipmunk_shape.html">ChipmunkShape</a> *) </td>
<td class="paramname"><em>shape</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Update the collision info for a single shape. </p>
<p>Can be used to update individual static shapes that were moved or active shapes that were moved that you want to query against. </p>
</div>
</div>
<a class="anchor" id="a59ea2ee0045c5301ecd0f3c5353b372f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (id) remove: </td>
<td></td>
<td class="paramtype">(NSObject< <a class="el" href="protocol_chipmunk_object-p.html">ChipmunkObject</a> > *) </td>
<td class="paramname"><em>obj</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Remove an object from the space. </p>
<p>This can be any object that implements the <a class="el" href="protocol_chipmunk_object-p.html" title="Allows you to add composite objects to a space in a single method call.">ChipmunkObject</a> protocol. This includes all the basic types such as <a class="el" href="interface_chipmunk_body.html" title="Rigid bodies are the basic unit of simulation in Chipmunk.">ChipmunkBody</a>, <a class="el" href="interface_chipmunk_shape.html" title="Abstract base class for collsion shape types.">ChipmunkShape</a> and <a class="el" href="interface_chipmunk_constraint.html" title="Constraints connect two ChipmunkBody objects together.">ChipmunkConstraint</a> as well as any composite game objects you may define that implement the protocol. </p>
<dl class="section warning"><dt>Warning</dt><dd>This method may not be called from a collision handler callback. See smartRemove: or ChipmunkSpace.addPostStepCallback:selector:context: for information on how to do that. </dd></dl>
</div>
</div>
<a class="anchor" id="a30859e07744b8e7dd703267490e5f1a5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setDefaultCollisionHandler: </td>
<td></td>
<td class="paramtype">(id) </td>
<td class="paramname"><em>delegate</em></td>
</tr>
<tr>
<td class="paramkey">begin:</td>
<td></td>
<td class="paramtype">(SEL) </td>
<td class="paramname"><em>begin</em></td>
</tr>
<tr>
<td class="paramkey">preSolve:</td>
<td></td>
<td class="paramtype">(SEL) </td>
<td class="paramname"><em>preSolve</em></td>
</tr>
<tr>
<td class="paramkey">postSolve:</td>
<td></td>
<td class="paramtype">(SEL) </td>
<td class="paramname"><em>postSolve</em></td>
</tr>
<tr>
<td class="paramkey">separate:</td>
<td></td>
<td class="paramtype">(SEL) </td>
<td class="paramname"><em>separate</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the default collision handler. </p>
<p>The default handler is used for all collisions when a specific collision handler cannot be found.</p>
<p>The expected method selectors are as follows: </p>
<div class="fragment"><div class="line">- (bool)begin:(<a class="code" href="structcp_arbiter.html">cpArbiter</a> *)arbiter <a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a>:(<a class="code" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a>*)<a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a></div>
<div class="line">- (<span class="keywordtype">bool</span>)preSolve:(<a class="code" href="structcp_arbiter.html">cpArbiter</a> *)arbiter <a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a>:(<a class="code" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a>*)<a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a></div>
<div class="line">- (void)postSolve:(<a class="code" href="structcp_arbiter.html">cpArbiter</a> *)arbiter <a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a>:(<a class="code" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a>*)<a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a></div>
<div class="line">- (<span class="keywordtype">void</span>)separate:(<a class="code" href="structcp_arbiter.html">cpArbiter</a> *)arbiter <a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a>:(<a class="code" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a>*)<a class="code" href="interface_chipmunk_space.html#abea8947ecd2c50ed272d91ae051ceb43" title="Returns a pointer to the underlying cpSpace C struct.">space</a></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a355b38ec2cabce5e0643af6005598b8d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">+ (<a class="el" href="interface_chipmunk_space.html">ChipmunkSpace</a> *) spaceFromCPSpace: </td>
<td></td>
<td class="paramtype">(<a class="el" href="structcp_space.html">cpSpace</a> *) </td>
<td class="paramname"><em>space</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the <a class="el" href="interface_chipmunk_space.html" title="Chipmunk spaces are simulation containers.">ChipmunkSpace</a> object associciated with a <a class="el" href="structcp_space.html">cpSpace</a> pointer. </p>
<p>Undefined if the <a class="el" href="structcp_space.html">cpSpace</a> wasn't created using Objective-Chipmunk. </p>
</div>
</div>
<h2 class="groupheader">Property Documentation</h2>
<a class="anchor" id="a4328a8f473c7082520259e5ec6c8a100"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">- (<a class="el" href="group__basic_types.html#gac1ed65573e035bf892505768c852d8d3">cpFloat</a>) collisionBias</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">read</span><span class="mlabel">write</span><span class="mlabel">nonatomic</span><span class="mlabel">assign</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Determines how fast overlapping shapes are pushed apart. </p>
<p>Expressed as a fraction of the error remaining after each second. Defaults to pow(1.0 - 0.1, 60.0) meaning that Chipmunk fixes 10% of overlap each frame at 60Hz. </p>
</div>
</div>
<a class="anchor" id="a2cdefacf8c4c442a8de938f689beae24"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">- (<a class="el" href="group__basic_types.html#gaa24652c104082d0725066ea5ac7dc83f">cpTimestamp</a>) collisionPersistence</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">read</span><span class="mlabel">write</span><span class="mlabel">nonatomic</span><span class="mlabel">assign</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Number of frames that contact information should persist. </p>
<p>Defaults to 3. There is probably never a reason to change this value. </p>
</div>
</div>
<a class="anchor" id="a6068fdf28eb183b1d45aac4f6c705fff"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">- (<a class="el" href="group__basic_types.html#gac1ed65573e035bf892505768c852d8d3">cpFloat</a>) collisionSlop</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">read</span><span class="mlabel">write</span><span class="mlabel">nonatomic</span><span class="mlabel">assign</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Amount of encouraged penetration between colliding shapes. </p>
<p>Used to reduce oscillating contacts and keep the collision cache warm. Defaults to 0.1. If you have poor simulation quality, increase this number as much as possible without allowing visible amounts of overlap. </p>
</div>
</div>
<a class="anchor" id="a591e8e360264f67fc7f6f4494dde10b7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">- (<a class="el" href="group__basic_types.html#gac1ed65573e035bf892505768c852d8d3">cpFloat</a>) damping</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">read</span><span class="mlabel">write</span><span class="mlabel">nonatomic</span><span class="mlabel">assign</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Global viscous damping value to use for all rigid bodies in this space (default value is 1.0 which disables damping). </p>
<p>This value is the fraction of velocity a body should have after 1 second. A value of 0.9 would mean that each second, a body would have 80% of the velocity it had the previous second. </p>
</div>
</div>
<a class="anchor" id="a14ae29e48719422333bc51ebfc292553"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">- (int) iterations</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">read</span><span class="mlabel">write</span><span class="mlabel">nonatomic</span><span class="mlabel">assign</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The iteration count is how many solver passes the space should use when solving collisions and joints (default is 10). </p>
<p>Fewer iterations mean less CPU usage, but lower quality (mushy looking) physics. </p>
</div>
</div>
<a class="anchor" id="a8137619872454fb466471ac5af743347"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">- (<a class="el" href="group__basic_types.html#gac1ed65573e035bf892505768c852d8d3">cpFloat</a>) sleepTimeThreshold</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">read</span><span class="mlabel">write</span><span class="mlabel">nonatomic</span><span class="mlabel">assign</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Elapsed time before a group of idle bodies is put to sleep (defaults to infinity which disables sleeping). </p>
<p>If an entire group of touching or jointed bodies has been idle for at least this long, the space will put all of the bodies into a sleeping state where they consume very little CPU. </p>
</div>
</div>
<a class="anchor" id="a858a6a13360cc3bbbb79339b76af1554"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">- (<a class="el" href="interface_chipmunk_body.html">ChipmunkBody</a>*) staticBody</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">read</span><span class="mlabel">nonatomic</span><span class="mlabel">assign</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The space's designated static body. </p>
<p>Collision shapes added to the body will automatically be marked as static shapes, and rigid bodies that come to rest while touching or jointed to this body will fall asleep. </p>
</div>
</div>
<a class="anchor" id="aa2c62f81e33d3a64d6d4a111e2aa2c4c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">- (id) userData</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">read</span><span class="mlabel">write</span><span class="mlabel">nonatomic</span><span class="mlabel">assign</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>An object that this space is associated with. </p>
<p>You can use this get a reference to your game state or controller object from within callbacks. </p>
<dl class="section attention"><dt>Attention</dt><dd>Like most <code>delegate</code> properties this is a weak reference and does not call <code>retain</code>. This prevents reference cycles from occuring. </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="_chipmunk_space_8h_source.html">ChipmunkSpace.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jul 2 2015 11:28:12 for Chipmunk2D Pro API Reference by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.3.1
</small></address>
</body>
</html>