1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473
|
<!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"/>
<title>Objective Chipmunk: ChipmunkBody Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</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 id="searchli">
<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 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>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="#properties">Properties</a> </div>
<div class="headertitle">
<h1>ChipmunkBody Class Reference</h1> </div>
</div>
<div class="contents">
<!-- doxytag: class="ChipmunkBody" --><!-- doxytag: inherits="ChipmunkBaseObject-p" -->
<p>Rigid bodies are the basic unit of simulation in Chipmunk.
<a href="#_details">More...</a></p>
<p><code>#import <<a class="el" href="_chipmunk_body_8h_source.html">ChipmunkBody.h</a>></code></p>
<p>Inherits <a class="el" href="protocol_chipmunk_base_object-p.html">ChipmunkBaseObject-p</a>.</p>
<p><a href="class_chipmunk_body-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(id) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_body.html#acc3839d7874e4522d71994aefbe9e3ce">initWithMass:andMoment:</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize a rigid body with the given mass and moment of inertia. <a href="#acc3839d7874e4522d71994aefbe9e3ce"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(id) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_body.html#a9349b53f033aada612e7136c76fd3288">initStaticBody</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize a rigid body with infinite mass and moment. <a href="#a9349b53f033aada612e7136c76fd3288"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(cpVect) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_body.html#a61f151546c76bf446b12ef3a0f532ac2">local2world:</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert from body local to world coordinates. <a href="#a61f151546c76bf446b12ef3a0f532ac2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(cpVect) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_body.html#aba6a0872c2934c41ba3118321be00d6c">world2local:</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert from world to body local Coordinates. <a href="#aba6a0872c2934c41ba3118321be00d6c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_body.html#acd2c663de51eb794250a66299274d0f6">resetForces</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Reset force and torque. <a href="#acd2c663de51eb794250a66299274d0f6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_body.html#a31c1a30a42c382dd3b4184bb7f6ef85f">applyForce:offset:</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply a force to a rigid body. <a href="#a31c1a30a42c382dd3b4184bb7f6ef85f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_body.html#ad3216b9ef1a8cca95deb25254e165242">applyImpulse:offset:</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply an impulse to a rigid body. <a href="#ad3216b9ef1a8cca95deb25254e165242"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a21bd1e326418c725ef27059e42df5056"></a><!-- doxytag: member="ChipmunkBody::activate" ref="a21bd1e326418c725ef27059e42df5056" args="()" -->
(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_body.html#a21bd1e326418c725ef27059e42df5056">activate</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Wake up the body if it's sleeping, or reset the idle timer if it's active. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_body.html#ab90684f19dade1d6ff6c20c00371f031">sleepWithGroup:</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Force the body to sleep immediately. <a href="#ab90684f19dade1d6ff6c20c00371f031"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_body.html#a6617aa86099eca35874bf412854f820f">sleep</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Equivalent to [<a class="el" href="interface_chipmunk_body.html" title="Rigid bodies are the basic unit of simulation in Chipmunk.">ChipmunkBody</a> sleepWithGroup:nil]. <a href="#a6617aa86099eca35874bf412854f820f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acf26b9be2a1a4ed08caf5db486cfd3b2"></a><!-- doxytag: member="ChipmunkBody::addToSpace:" ref="acf26b9be2a1a4ed08caf5db486cfd3b2" args="(ChipmunkSpace *space)" -->
(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_body.html#acf26b9be2a1a4ed08caf5db486cfd3b2">addToSpace:</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Implements the <a class="el" href="protocol_chipmunk_base_object-p.html" title="This protocol is implemented by objects that know how to add themselves to a space.">ChipmunkBaseObject</a> protocol, not particularly useful outside of the library code. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a165675f8d75ad895cd82ca6f622e2df7"></a><!-- doxytag: member="ChipmunkBody::removeFromSpace:" ref="a165675f8d75ad895cd82ca6f622e2df7" args="(ChipmunkSpace *space)" -->
(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_body.html#a165675f8d75ad895cd82ca6f622e2df7">removeFromSpace:</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Implements the <a class="el" href="protocol_chipmunk_base_object-p.html" title="This protocol is implemented by objects that know how to add themselves to a space.">ChipmunkBaseObject</a> protocol, not particularly useful outside of the library code. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab9ae81d229f310b1bc4eb40d627ee1b0"></a><!-- doxytag: member="ChipmunkBody::affineTransform" ref="ab9ae81d229f310b1bc4eb40d627ee1b0" args="()" -->
(CGAffineTransform) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_chipmunk_body.html#ab9ae81d229f310b1bc4eb40d627ee1b0">affineTransform</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get an affine transform to match this body. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(id) </td><td class="memItemRight" valign="bottom">+ <a class="el" href="interface_chipmunk_body.html#a56b07ce5f6b3cb65535f46f06dadef1d">bodyWithMass:andMoment:</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an autoreleased rigid body with the given mass and moment. <a href="#a56b07ce5f6b3cb65535f46f06dadef1d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(id) </td><td class="memItemRight" valign="bottom">+ <a class="el" href="interface_chipmunk_body.html#a0dd8482ae016a4a99a811af3bb7e8ba8">staticBody</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an autoreleased rigid body with infinite mass and moment. <a href="#a0dd8482ae016a4a99a811af3bb7e8ba8"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="properties"></a>
Properties</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a85477bd960e7cad131f09387c1e05a8e"></a><!-- doxytag: member="ChipmunkBody::mass" ref="a85477bd960e7cad131f09387c1e05a8e" args="" -->
cpFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_body.html#a85477bd960e7cad131f09387c1e05a8e">mass</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Mass of the rigid body. Mass does not have to be expressed in any particular units, but relative masses should be consistent. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a16bb669ca16ee871e9a3f77ef44e031a"></a><!-- doxytag: member="ChipmunkBody::moment" ref="a16bb669ca16ee871e9a3f77ef44e031a" args="" -->
cpFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_body.html#a16bb669ca16ee871e9a3f77ef44e031a">moment</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Moment of inertia of the body. The mass tells you how hard it is to push an object, the MoI tells you how hard it is to spin the object. Don't try to guess the MoI, use the cpMomentFor*() functions to try and estimate it. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af59d9cae39ab32b032a37cf9f58f2ddc"></a><!-- doxytag: member="ChipmunkBody::pos" ref="af59d9cae39ab32b032a37cf9f58f2ddc" args="" -->
cpVect </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_body.html#af59d9cae39ab32b032a37cf9f58f2ddc">pos</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The position of the rigid body's center of gravity. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab5822b826a6be740b679b9af5d2f834a"></a><!-- doxytag: member="ChipmunkBody::vel" ref="ab5822b826a6be740b679b9af5d2f834a" args="" -->
cpVect </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_body.html#ab5822b826a6be740b679b9af5d2f834a">vel</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The linear velocity of the rigid body. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a128612d069fac7a00478e2d5b3f0340c"></a><!-- doxytag: member="ChipmunkBody::force" ref="a128612d069fac7a00478e2d5b3f0340c" args="" -->
cpVect </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_body.html#a128612d069fac7a00478e2d5b3f0340c">force</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The linear force applied to the rigid body. Unlike in some physics engines, the force does not reset itself during each step. Make sure that you are reseting the force between frames if that is what you intended. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3fcecceecfaf4db03a5623f5f5431e50"></a><!-- doxytag: member="ChipmunkBody::angle" ref="a3fcecceecfaf4db03a5623f5f5431e50" args="" -->
cpFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_body.html#a3fcecceecfaf4db03a5623f5f5431e50">angle</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The rotation angle of the rigid body in radians. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aed63cf9aadb651ba68e6806afcc2e839"></a><!-- doxytag: member="ChipmunkBody::angVel" ref="aed63cf9aadb651ba68e6806afcc2e839" args="" -->
cpFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_body.html#aed63cf9aadb651ba68e6806afcc2e839">angVel</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The angular velocity of the rigid body in radians per second. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a59dc76a645a3afb913b074c2c2bb3acf"></a><!-- doxytag: member="ChipmunkBody::torque" ref="a59dc76a645a3afb913b074c2c2bb3acf" args="" -->
cpFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_body.html#a59dc76a645a3afb913b074c2c2bb3acf">torque</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The torque being applied to the rigid body. Like force, this property is not reset every frame. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a293a638610bf4d62a82b44008ccd66c7"></a><!-- doxytag: member="ChipmunkBody::rot" ref="a293a638610bf4d62a82b44008ccd66c7" args="" -->
cpVect </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_body.html#a293a638610bf4d62a82b44008ccd66c7">rot</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">A unit length vector vector that stores the current rotation of the body as a 2D spinor or complex number. Can be used for fast rotation. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aea438309e8fca9922e8ac0cdbd0e795a"></a><!-- doxytag: member="ChipmunkBody::body" ref="aea438309e8fca9922e8ac0cdbd0e795a" args="" -->
cpBody * </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_body.html#aea438309e8fca9922e8ac0cdbd0e795a">body</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a pointer to the underlying cpBody C struct. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">id </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_body.html#af12a082d46e8117ab95c6b5d3a6aa9a3">data</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">An object that this constraint is associated with. <a href="#af12a082d46e8117ab95c6b5d3a6aa9a3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aff377602948f0d6c9268342403ddf906"></a><!-- doxytag: member="ChipmunkBody::isSleeping" ref="aff377602948f0d6c9268342403ddf906" args="" -->
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_body.html#aff377602948f0d6c9268342403ddf906">isSleeping</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Has the body been put to sleep by the space? <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac33525ac970b930fdadc34bf205e9e2c"></a><!-- doxytag: member="ChipmunkBody::isRogue" ref="ac33525ac970b930fdadc34bf205e9e2c" args="" -->
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_body.html#ac33525ac970b930fdadc34bf205e9e2c">isRogue</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Has the body <b>not</b> been added to any spaces? <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7abb3d52679aeb3e217c1cbd5f9548bf"></a><!-- doxytag: member="ChipmunkBody::isStatic" ref="a7abb3d52679aeb3e217c1cbd5f9548bf" args="" -->
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_chipmunk_body.html#a7abb3d52679aeb3e217c1cbd5f9548bf">isStatic</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Is the body the static body associated with a space? <br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Rigid bodies are the basic unit of simulation in Chipmunk. </p>
<p>They hold the physical properties of an object (mass, position, rotation, velocity, etc.). After creating a <a class="el" href="interface_chipmunk_body.html" title="Rigid bodies are the basic unit of simulation in Chipmunk.">ChipmunkBody</a> object, you can attach collision shapes (<a class="el" href="interface_chipmunk_shape.html" title="Abstract base class for collsion shape types.">ChipmunkShape</a>) and joints (<a class="el" href="interface_chipmunk_constraint.html" title="Constraints connect two ChipmunkBody objects together.">ChipmunkConstraint</a>) to it. </p>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a31c1a30a42c382dd3b4184bb7f6ef85f"></a><!-- doxytag: member="ChipmunkBody::applyForce:offset:" ref="a31c1a30a42c382dd3b4184bb7f6ef85f" args="(cpVect force,[offset] cpVect offset)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) applyForce: </td>
<td></td>
<td class="paramtype">(cpVect) </td>
<td class="paramname"> <em>force</em></td>
</tr>
<tr>
<td class="paramkey">offset:</td>
<td></td>
<td class="paramtype">(cpVect) </td>
<td class="paramname"> <em>offset</em></td><td> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Apply a force to a rigid body. </p>
<p>An offset of cpvzero is equivalent to adding directly to the force property. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>force</em> </td><td>A force in expressed in absolute (word) coordinates. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>offset</em> </td><td>An offset expressed in world coordinates. Note that it is still an offset, meaning that it's position is relative, but the rotation is not. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ad3216b9ef1a8cca95deb25254e165242"></a><!-- doxytag: member="ChipmunkBody::applyImpulse:offset:" ref="ad3216b9ef1a8cca95deb25254e165242" args="(cpVect impulse,[offset] cpVect offset)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) applyImpulse: </td>
<td></td>
<td class="paramtype">(cpVect) </td>
<td class="paramname"> <em>impulse</em></td>
</tr>
<tr>
<td class="paramkey">offset:</td>
<td></td>
<td class="paramtype">(cpVect) </td>
<td class="paramname"> <em>offset</em></td><td> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Apply an impulse to a rigid body. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>impulse</em> </td><td>An impulse in expressed in absolute (word) coordinates. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>offset</em> </td><td>An offset expressed in world coordinates. Note that it is still an offset, meaning that it's position is relative, but the rotation is not. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a56b07ce5f6b3cb65535f46f06dadef1d"></a><!-- doxytag: member="ChipmunkBody::bodyWithMass:andMoment:" ref="a56b07ce5f6b3cb65535f46f06dadef1d" args="(cpFloat mass,[andMoment] cpFloat moment)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">+ (id) bodyWithMass: </td>
<td></td>
<td class="paramtype">(cpFloat) </td>
<td class="paramname"> <em>mass</em></td>
</tr>
<tr>
<td class="paramkey">andMoment:</td>
<td></td>
<td class="paramtype">(cpFloat) </td>
<td class="paramname"> <em>moment</em></td><td> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Create an autoreleased rigid body with the given mass and moment. </p>
<p>Guessing the moment of inertia is usually a bad idea. Use the moment estimation functions (cpMomentFor*()). </p>
</div>
</div>
<a class="anchor" id="a9349b53f033aada612e7136c76fd3288"></a><!-- doxytag: member="ChipmunkBody::initStaticBody" ref="a9349b53f033aada612e7136c76fd3288" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (id) initStaticBody </td>
<td></td>
<td class="paramname"></td>
<td> </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initialize a rigid body with infinite mass and moment. </p>
<p>This is most useful when you want to create a rogue body for controlling a moving platform or some other strictly controlled object. </p>
</div>
</div>
<a class="anchor" id="acc3839d7874e4522d71994aefbe9e3ce"></a><!-- doxytag: member="ChipmunkBody::initWithMass:andMoment:" ref="acc3839d7874e4522d71994aefbe9e3ce" args="(cpFloat mass,[andMoment] cpFloat moment)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (id) initWithMass: </td>
<td></td>
<td class="paramtype">(cpFloat) </td>
<td class="paramname"> <em>mass</em></td>
</tr>
<tr>
<td class="paramkey">andMoment:</td>
<td></td>
<td class="paramtype">(cpFloat) </td>
<td class="paramname"> <em>moment</em></td><td> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initialize a rigid body with the given mass and moment of inertia. </p>
<p>Guessing the moment of inertia is usually a bad idea. Use the moment estimation functions (cpMomentFor*()). </p>
</div>
</div>
<a class="anchor" id="a61f151546c76bf446b12ef3a0f532ac2"></a><!-- doxytag: member="ChipmunkBody::local2world:" ref="a61f151546c76bf446b12ef3a0f532ac2" args="(cpVect v)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (cpVect) local2world: </td>
<td></td>
<td class="paramtype">(cpVect) </td>
<td class="paramname"> <em>v</em></td>
<td> </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Convert from body local to world coordinates. </p>
<p>Convert a point in world (absolute) coordinates to body local coordinates affected by the position and rotation of the rigid body. </p>
</div>
</div>
<a class="anchor" id="acd2c663de51eb794250a66299274d0f6"></a><!-- doxytag: member="ChipmunkBody::resetForces" ref="acd2c663de51eb794250a66299274d0f6" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) resetForces </td>
<td></td>
<td class="paramname"></td>
<td> </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reset force and torque. </p>
<p>Set the force on this rigid body to cpvzero, and set the torque to 0.0. </p>
</div>
</div>
<a class="anchor" id="a6617aa86099eca35874bf412854f820f"></a><!-- doxytag: member="ChipmunkBody::sleep" ref="a6617aa86099eca35874bf412854f820f" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) sleep </td>
<td></td>
<td class="paramname"></td>
<td> </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Equivalent to [<a class="el" href="interface_chipmunk_body.html" title="Rigid bodies are the basic unit of simulation in Chipmunk.">ChipmunkBody</a> sleepWithGroup:nil]. </p>
<p>That is the object is forced to sleep immediately, but is not grouped with any other sleeping bodies. </p>
</div>
</div>
<a class="anchor" id="ab90684f19dade1d6ff6c20c00371f031"></a><!-- doxytag: member="ChipmunkBody::sleepWithGroup:" ref="ab90684f19dade1d6ff6c20c00371f031" args="(ChipmunkBody *group)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) sleepWithGroup: </td>
<td></td>
<td class="paramtype">(<a class="el" href="interface_chipmunk_body.html">ChipmunkBody</a> *) </td>
<td class="paramname"> <em>group</em></td>
<td> </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Force the body to sleep immediately. </p>
<p>The body will be added to the same group as . When any object in a group is woken up, all of the bodies are woken up with it. If <code>group</code> is nil, then a new group is created and the body is added to it. It is an error pass a non-sleeping body as <code>group</code>. This is useful if you want an object to be inactive until something hits it such as a pile of boxes you want the player to plow through or a stalactite hanging from a cave ceiling. Make sure the body is fully set up before you call this. Adding this body or any shapes or constraints attached to it to a space, or modifying any of their properties automatically wake a body up. </p>
</div>
</div>
<a class="anchor" id="a0dd8482ae016a4a99a811af3bb7e8ba8"></a><!-- doxytag: member="ChipmunkBody::staticBody" ref="a0dd8482ae016a4a99a811af3bb7e8ba8" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">+ (id) staticBody </td>
<td></td>
<td class="paramname"></td>
<td> </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Create an autoreleased rigid body with infinite mass and moment. </p>
<p>This is most useful when you want to create a rogue body for controlling a moving platform or some other strictly controlled object. </p>
</div>
</div>
<a class="anchor" id="aba6a0872c2934c41ba3118321be00d6c"></a><!-- doxytag: member="ChipmunkBody::world2local:" ref="aba6a0872c2934c41ba3118321be00d6c" args="(cpVect v)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (cpVect) world2local: </td>
<td></td>
<td class="paramtype">(cpVect) </td>
<td class="paramname"> <em>v</em></td>
<td> </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Convert from world to body local Coordinates. </p>
<p>Convert a point in body local coordinates coordinates to world (absolute) coordinates. </p>
</div>
</div>
<hr/><h2>Property Documentation</h2>
<a class="anchor" id="af12a082d46e8117ab95c6b5d3a6aa9a3"></a><!-- doxytag: member="ChipmunkBody::data" ref="af12a082d46e8117ab95c6b5d3a6aa9a3" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (id) data<code> [read, write, assign]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>An object that this constraint is associated with. </p>
<p>You can use this get a reference to your game object or controller object from within callbacks. </p>
<dl class="attention"><dt><b>Attention:</b></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>
<p>Reimplemented from <a class="el" href="protocol_chipmunk_base_object-p.html"><ChipmunkBaseObject></a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="_chipmunk_body_8h_source.html">ChipmunkBody.h</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>Properties</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Mon Dec 13 2010 18:43:39 for Objective Chipmunk by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>
|