Physics2DServer.xml 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Physics2DServer" inherits="Object" version="3.4">
  3. <brief_description>
  4. Server interface for low-level 2D physics access.
  5. </brief_description>
  6. <description>
  7. Physics2DServer is the server responsible for all 2D physics. It can create many kinds of physics objects, but does not insert them on the node tree.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="area_add_shape">
  13. <return type="void">
  14. </return>
  15. <argument index="0" name="area" type="RID">
  16. </argument>
  17. <argument index="1" name="shape" type="RID">
  18. </argument>
  19. <argument index="2" name="transform" type="Transform2D" default="Transform2D( 1, 0, 0, 1, 0, 0 )">
  20. </argument>
  21. <argument index="3" name="disabled" type="bool" default="false">
  22. </argument>
  23. <description>
  24. Adds a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index.
  25. </description>
  26. </method>
  27. <method name="area_attach_canvas_instance_id">
  28. <return type="void">
  29. </return>
  30. <argument index="0" name="area" type="RID">
  31. </argument>
  32. <argument index="1" name="id" type="int">
  33. </argument>
  34. <description>
  35. </description>
  36. </method>
  37. <method name="area_attach_object_instance_id">
  38. <return type="void">
  39. </return>
  40. <argument index="0" name="area" type="RID">
  41. </argument>
  42. <argument index="1" name="id" type="int">
  43. </argument>
  44. <description>
  45. Assigns the area to a descendant of [Object], so it can exist in the node tree.
  46. </description>
  47. </method>
  48. <method name="area_clear_shapes">
  49. <return type="void">
  50. </return>
  51. <argument index="0" name="area" type="RID">
  52. </argument>
  53. <description>
  54. Removes all shapes from an area. It does not delete the shapes, so they can be reassigned later.
  55. </description>
  56. </method>
  57. <method name="area_create">
  58. <return type="RID">
  59. </return>
  60. <description>
  61. Creates an [Area2D]. After creating an [Area2D] with this method, assign it to a space using [method area_set_space] to use the created [Area2D] in the physics world.
  62. </description>
  63. </method>
  64. <method name="area_get_canvas_instance_id" qualifiers="const">
  65. <return type="int">
  66. </return>
  67. <argument index="0" name="area" type="RID">
  68. </argument>
  69. <description>
  70. </description>
  71. </method>
  72. <method name="area_get_object_instance_id" qualifiers="const">
  73. <return type="int">
  74. </return>
  75. <argument index="0" name="area" type="RID">
  76. </argument>
  77. <description>
  78. Gets the instance ID of the object the area is assigned to.
  79. </description>
  80. </method>
  81. <method name="area_get_param" qualifiers="const">
  82. <return type="Variant">
  83. </return>
  84. <argument index="0" name="area" type="RID">
  85. </argument>
  86. <argument index="1" name="param" type="int" enum="Physics2DServer.AreaParameter">
  87. </argument>
  88. <description>
  89. Returns an area parameter value. See [enum AreaParameter] for a list of available parameters.
  90. </description>
  91. </method>
  92. <method name="area_get_shape" qualifiers="const">
  93. <return type="RID">
  94. </return>
  95. <argument index="0" name="area" type="RID">
  96. </argument>
  97. <argument index="1" name="shape_idx" type="int">
  98. </argument>
  99. <description>
  100. Returns the [RID] of the nth shape of an area.
  101. </description>
  102. </method>
  103. <method name="area_get_shape_count" qualifiers="const">
  104. <return type="int">
  105. </return>
  106. <argument index="0" name="area" type="RID">
  107. </argument>
  108. <description>
  109. Returns the number of shapes assigned to an area.
  110. </description>
  111. </method>
  112. <method name="area_get_shape_transform" qualifiers="const">
  113. <return type="Transform2D">
  114. </return>
  115. <argument index="0" name="area" type="RID">
  116. </argument>
  117. <argument index="1" name="shape_idx" type="int">
  118. </argument>
  119. <description>
  120. Returns the transform matrix of a shape within an area.
  121. </description>
  122. </method>
  123. <method name="area_get_space" qualifiers="const">
  124. <return type="RID">
  125. </return>
  126. <argument index="0" name="area" type="RID">
  127. </argument>
  128. <description>
  129. Returns the space assigned to the area.
  130. </description>
  131. </method>
  132. <method name="area_get_space_override_mode" qualifiers="const">
  133. <return type="int" enum="Physics2DServer.AreaSpaceOverrideMode">
  134. </return>
  135. <argument index="0" name="area" type="RID">
  136. </argument>
  137. <description>
  138. Returns the space override mode for the area.
  139. </description>
  140. </method>
  141. <method name="area_get_transform" qualifiers="const">
  142. <return type="Transform2D">
  143. </return>
  144. <argument index="0" name="area" type="RID">
  145. </argument>
  146. <description>
  147. Returns the transform matrix for an area.
  148. </description>
  149. </method>
  150. <method name="area_remove_shape">
  151. <return type="void">
  152. </return>
  153. <argument index="0" name="area" type="RID">
  154. </argument>
  155. <argument index="1" name="shape_idx" type="int">
  156. </argument>
  157. <description>
  158. Removes a shape from an area. It does not delete the shape, so it can be reassigned later.
  159. </description>
  160. </method>
  161. <method name="area_set_area_monitor_callback">
  162. <return type="void">
  163. </return>
  164. <argument index="0" name="area" type="RID">
  165. </argument>
  166. <argument index="1" name="receiver" type="Object">
  167. </argument>
  168. <argument index="2" name="method" type="String">
  169. </argument>
  170. <description>
  171. </description>
  172. </method>
  173. <method name="area_set_collision_layer">
  174. <return type="void">
  175. </return>
  176. <argument index="0" name="area" type="RID">
  177. </argument>
  178. <argument index="1" name="layer" type="int">
  179. </argument>
  180. <description>
  181. Assigns the area to one or many physics layers.
  182. </description>
  183. </method>
  184. <method name="area_set_collision_mask">
  185. <return type="void">
  186. </return>
  187. <argument index="0" name="area" type="RID">
  188. </argument>
  189. <argument index="1" name="mask" type="int">
  190. </argument>
  191. <description>
  192. Sets which physics layers the area will monitor.
  193. </description>
  194. </method>
  195. <method name="area_set_monitor_callback">
  196. <return type="void">
  197. </return>
  198. <argument index="0" name="area" type="RID">
  199. </argument>
  200. <argument index="1" name="receiver" type="Object">
  201. </argument>
  202. <argument index="2" name="method" type="String">
  203. </argument>
  204. <description>
  205. Sets the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters:
  206. 1: [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED], depending on whether the object entered or exited the area.
  207. 2: [RID] of the object that entered/exited the area.
  208. 3: Instance ID of the object that entered/exited the area.
  209. 4: The shape index of the object that entered/exited the area.
  210. 5: The shape index of the area where the object entered/exited.
  211. </description>
  212. </method>
  213. <method name="area_set_monitorable">
  214. <return type="void">
  215. </return>
  216. <argument index="0" name="area" type="RID">
  217. </argument>
  218. <argument index="1" name="monitorable" type="bool">
  219. </argument>
  220. <description>
  221. </description>
  222. </method>
  223. <method name="area_set_param">
  224. <return type="void">
  225. </return>
  226. <argument index="0" name="area" type="RID">
  227. </argument>
  228. <argument index="1" name="param" type="int" enum="Physics2DServer.AreaParameter">
  229. </argument>
  230. <argument index="2" name="value" type="Variant">
  231. </argument>
  232. <description>
  233. Sets the value for an area parameter. See [enum AreaParameter] for a list of available parameters.
  234. </description>
  235. </method>
  236. <method name="area_set_shape">
  237. <return type="void">
  238. </return>
  239. <argument index="0" name="area" type="RID">
  240. </argument>
  241. <argument index="1" name="shape_idx" type="int">
  242. </argument>
  243. <argument index="2" name="shape" type="RID">
  244. </argument>
  245. <description>
  246. Substitutes a given area shape by another. The old shape is selected by its index, the new one by its [RID].
  247. </description>
  248. </method>
  249. <method name="area_set_shape_disabled">
  250. <return type="void">
  251. </return>
  252. <argument index="0" name="area" type="RID">
  253. </argument>
  254. <argument index="1" name="shape_idx" type="int">
  255. </argument>
  256. <argument index="2" name="disabled" type="bool">
  257. </argument>
  258. <description>
  259. Disables a given shape in an area.
  260. </description>
  261. </method>
  262. <method name="area_set_shape_transform">
  263. <return type="void">
  264. </return>
  265. <argument index="0" name="area" type="RID">
  266. </argument>
  267. <argument index="1" name="shape_idx" type="int">
  268. </argument>
  269. <argument index="2" name="transform" type="Transform2D">
  270. </argument>
  271. <description>
  272. Sets the transform matrix for an area shape.
  273. </description>
  274. </method>
  275. <method name="area_set_space">
  276. <return type="void">
  277. </return>
  278. <argument index="0" name="area" type="RID">
  279. </argument>
  280. <argument index="1" name="space" type="RID">
  281. </argument>
  282. <description>
  283. Assigns a space to the area.
  284. </description>
  285. </method>
  286. <method name="area_set_space_override_mode">
  287. <return type="void">
  288. </return>
  289. <argument index="0" name="area" type="RID">
  290. </argument>
  291. <argument index="1" name="mode" type="int" enum="Physics2DServer.AreaSpaceOverrideMode">
  292. </argument>
  293. <description>
  294. Sets the space override mode for the area. See [enum AreaSpaceOverrideMode] for a list of available modes.
  295. </description>
  296. </method>
  297. <method name="area_set_transform">
  298. <return type="void">
  299. </return>
  300. <argument index="0" name="area" type="RID">
  301. </argument>
  302. <argument index="1" name="transform" type="Transform2D">
  303. </argument>
  304. <description>
  305. Sets the transform matrix for an area.
  306. </description>
  307. </method>
  308. <method name="body_add_central_force">
  309. <return type="void">
  310. </return>
  311. <argument index="0" name="body" type="RID">
  312. </argument>
  313. <argument index="1" name="force" type="Vector2">
  314. </argument>
  315. <description>
  316. </description>
  317. </method>
  318. <method name="body_add_collision_exception">
  319. <return type="void">
  320. </return>
  321. <argument index="0" name="body" type="RID">
  322. </argument>
  323. <argument index="1" name="excepted_body" type="RID">
  324. </argument>
  325. <description>
  326. Adds a body to the list of bodies exempt from collisions.
  327. </description>
  328. </method>
  329. <method name="body_add_force">
  330. <return type="void">
  331. </return>
  332. <argument index="0" name="body" type="RID">
  333. </argument>
  334. <argument index="1" name="offset" type="Vector2">
  335. </argument>
  336. <argument index="2" name="force" type="Vector2">
  337. </argument>
  338. <description>
  339. Adds a positioned force to the applied force and torque. As with [method body_apply_impulse], both the force and the offset from the body origin are in global coordinates. A force differs from an impulse in that, while the two are forces, the impulse clears itself after being applied.
  340. </description>
  341. </method>
  342. <method name="body_add_shape">
  343. <return type="void">
  344. </return>
  345. <argument index="0" name="body" type="RID">
  346. </argument>
  347. <argument index="1" name="shape" type="RID">
  348. </argument>
  349. <argument index="2" name="transform" type="Transform2D" default="Transform2D( 1, 0, 0, 1, 0, 0 )">
  350. </argument>
  351. <argument index="3" name="disabled" type="bool" default="false">
  352. </argument>
  353. <description>
  354. Adds a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index.
  355. </description>
  356. </method>
  357. <method name="body_add_torque">
  358. <return type="void">
  359. </return>
  360. <argument index="0" name="body" type="RID">
  361. </argument>
  362. <argument index="1" name="torque" type="float">
  363. </argument>
  364. <description>
  365. </description>
  366. </method>
  367. <method name="body_apply_central_impulse">
  368. <return type="void">
  369. </return>
  370. <argument index="0" name="body" type="RID">
  371. </argument>
  372. <argument index="1" name="impulse" type="Vector2">
  373. </argument>
  374. <description>
  375. </description>
  376. </method>
  377. <method name="body_apply_impulse">
  378. <return type="void">
  379. </return>
  380. <argument index="0" name="body" type="RID">
  381. </argument>
  382. <argument index="1" name="position" type="Vector2">
  383. </argument>
  384. <argument index="2" name="impulse" type="Vector2">
  385. </argument>
  386. <description>
  387. Adds a positioned impulse to the applied force and torque. Both the force and the offset from the body origin are in global coordinates.
  388. </description>
  389. </method>
  390. <method name="body_apply_torque_impulse">
  391. <return type="void">
  392. </return>
  393. <argument index="0" name="body" type="RID">
  394. </argument>
  395. <argument index="1" name="impulse" type="float">
  396. </argument>
  397. <description>
  398. </description>
  399. </method>
  400. <method name="body_attach_canvas_instance_id">
  401. <return type="void">
  402. </return>
  403. <argument index="0" name="body" type="RID">
  404. </argument>
  405. <argument index="1" name="id" type="int">
  406. </argument>
  407. <description>
  408. </description>
  409. </method>
  410. <method name="body_attach_object_instance_id">
  411. <return type="void">
  412. </return>
  413. <argument index="0" name="body" type="RID">
  414. </argument>
  415. <argument index="1" name="id" type="int">
  416. </argument>
  417. <description>
  418. Assigns the area to a descendant of [Object], so it can exist in the node tree.
  419. </description>
  420. </method>
  421. <method name="body_clear_shapes">
  422. <return type="void">
  423. </return>
  424. <argument index="0" name="body" type="RID">
  425. </argument>
  426. <description>
  427. Removes all shapes from a body.
  428. </description>
  429. </method>
  430. <method name="body_create">
  431. <return type="RID">
  432. </return>
  433. <description>
  434. Creates a physics body.
  435. </description>
  436. </method>
  437. <method name="body_get_canvas_instance_id" qualifiers="const">
  438. <return type="int">
  439. </return>
  440. <argument index="0" name="body" type="RID">
  441. </argument>
  442. <description>
  443. </description>
  444. </method>
  445. <method name="body_get_collision_layer" qualifiers="const">
  446. <return type="int">
  447. </return>
  448. <argument index="0" name="body" type="RID">
  449. </argument>
  450. <description>
  451. Returns the physics layer or layers a body belongs to.
  452. </description>
  453. </method>
  454. <method name="body_get_collision_mask" qualifiers="const">
  455. <return type="int">
  456. </return>
  457. <argument index="0" name="body" type="RID">
  458. </argument>
  459. <description>
  460. Returns the physics layer or layers a body can collide with.
  461. </description>
  462. </method>
  463. <method name="body_get_continuous_collision_detection_mode" qualifiers="const">
  464. <return type="int" enum="Physics2DServer.CCDMode">
  465. </return>
  466. <argument index="0" name="body" type="RID">
  467. </argument>
  468. <description>
  469. Returns the continuous collision detection mode.
  470. </description>
  471. </method>
  472. <method name="body_get_direct_state">
  473. <return type="Physics2DDirectBodyState">
  474. </return>
  475. <argument index="0" name="body" type="RID">
  476. </argument>
  477. <description>
  478. Returns the [Physics2DDirectBodyState] of the body.
  479. </description>
  480. </method>
  481. <method name="body_get_max_contacts_reported" qualifiers="const">
  482. <return type="int">
  483. </return>
  484. <argument index="0" name="body" type="RID">
  485. </argument>
  486. <description>
  487. Returns the maximum contacts that can be reported. See [method body_set_max_contacts_reported].
  488. </description>
  489. </method>
  490. <method name="body_get_mode" qualifiers="const">
  491. <return type="int" enum="Physics2DServer.BodyMode">
  492. </return>
  493. <argument index="0" name="body" type="RID">
  494. </argument>
  495. <description>
  496. Returns the body mode.
  497. </description>
  498. </method>
  499. <method name="body_get_object_instance_id" qualifiers="const">
  500. <return type="int">
  501. </return>
  502. <argument index="0" name="body" type="RID">
  503. </argument>
  504. <description>
  505. Gets the instance ID of the object the area is assigned to.
  506. </description>
  507. </method>
  508. <method name="body_get_param" qualifiers="const">
  509. <return type="float">
  510. </return>
  511. <argument index="0" name="body" type="RID">
  512. </argument>
  513. <argument index="1" name="param" type="int" enum="Physics2DServer.BodyParameter">
  514. </argument>
  515. <description>
  516. Returns the value of a body parameter. See [enum BodyParameter] for a list of available parameters.
  517. </description>
  518. </method>
  519. <method name="body_get_shape" qualifiers="const">
  520. <return type="RID">
  521. </return>
  522. <argument index="0" name="body" type="RID">
  523. </argument>
  524. <argument index="1" name="shape_idx" type="int">
  525. </argument>
  526. <description>
  527. Returns the [RID] of the nth shape of a body.
  528. </description>
  529. </method>
  530. <method name="body_get_shape_count" qualifiers="const">
  531. <return type="int">
  532. </return>
  533. <argument index="0" name="body" type="RID">
  534. </argument>
  535. <description>
  536. Returns the number of shapes assigned to a body.
  537. </description>
  538. </method>
  539. <method name="body_get_shape_metadata" qualifiers="const">
  540. <return type="Variant">
  541. </return>
  542. <argument index="0" name="body" type="RID">
  543. </argument>
  544. <argument index="1" name="shape_idx" type="int">
  545. </argument>
  546. <description>
  547. Returns the metadata of a shape of a body.
  548. </description>
  549. </method>
  550. <method name="body_get_shape_transform" qualifiers="const">
  551. <return type="Transform2D">
  552. </return>
  553. <argument index="0" name="body" type="RID">
  554. </argument>
  555. <argument index="1" name="shape_idx" type="int">
  556. </argument>
  557. <description>
  558. Returns the transform matrix of a body shape.
  559. </description>
  560. </method>
  561. <method name="body_get_space" qualifiers="const">
  562. <return type="RID">
  563. </return>
  564. <argument index="0" name="body" type="RID">
  565. </argument>
  566. <description>
  567. Returns the [RID] of the space assigned to a body.
  568. </description>
  569. </method>
  570. <method name="body_get_state" qualifiers="const">
  571. <return type="Variant">
  572. </return>
  573. <argument index="0" name="body" type="RID">
  574. </argument>
  575. <argument index="1" name="state" type="int" enum="Physics2DServer.BodyState">
  576. </argument>
  577. <description>
  578. Returns a body state.
  579. </description>
  580. </method>
  581. <method name="body_is_omitting_force_integration" qualifiers="const">
  582. <return type="bool">
  583. </return>
  584. <argument index="0" name="body" type="RID">
  585. </argument>
  586. <description>
  587. Returns whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]).
  588. </description>
  589. </method>
  590. <method name="body_remove_collision_exception">
  591. <return type="void">
  592. </return>
  593. <argument index="0" name="body" type="RID">
  594. </argument>
  595. <argument index="1" name="excepted_body" type="RID">
  596. </argument>
  597. <description>
  598. Removes a body from the list of bodies exempt from collisions.
  599. </description>
  600. </method>
  601. <method name="body_remove_shape">
  602. <return type="void">
  603. </return>
  604. <argument index="0" name="body" type="RID">
  605. </argument>
  606. <argument index="1" name="shape_idx" type="int">
  607. </argument>
  608. <description>
  609. Removes a shape from a body. The shape is not deleted, so it can be reused afterwards.
  610. </description>
  611. </method>
  612. <method name="body_set_axis_velocity">
  613. <return type="void">
  614. </return>
  615. <argument index="0" name="body" type="RID">
  616. </argument>
  617. <argument index="1" name="axis_velocity" type="Vector2">
  618. </argument>
  619. <description>
  620. Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior.
  621. </description>
  622. </method>
  623. <method name="body_set_collision_layer">
  624. <return type="void">
  625. </return>
  626. <argument index="0" name="body" type="RID">
  627. </argument>
  628. <argument index="1" name="layer" type="int">
  629. </argument>
  630. <description>
  631. Sets the physics layer or layers a body belongs to.
  632. </description>
  633. </method>
  634. <method name="body_set_collision_mask">
  635. <return type="void">
  636. </return>
  637. <argument index="0" name="body" type="RID">
  638. </argument>
  639. <argument index="1" name="mask" type="int">
  640. </argument>
  641. <description>
  642. Sets the physics layer or layers a body can collide with.
  643. </description>
  644. </method>
  645. <method name="body_set_continuous_collision_detection_mode">
  646. <return type="void">
  647. </return>
  648. <argument index="0" name="body" type="RID">
  649. </argument>
  650. <argument index="1" name="mode" type="int" enum="Physics2DServer.CCDMode">
  651. </argument>
  652. <description>
  653. Sets the continuous collision detection mode using one of the [enum CCDMode] constants.
  654. Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided.
  655. </description>
  656. </method>
  657. <method name="body_set_force_integration_callback">
  658. <return type="void">
  659. </return>
  660. <argument index="0" name="body" type="RID">
  661. </argument>
  662. <argument index="1" name="receiver" type="Object">
  663. </argument>
  664. <argument index="2" name="method" type="String">
  665. </argument>
  666. <argument index="3" name="userdata" type="Variant" default="null">
  667. </argument>
  668. <description>
  669. Sets the function used to calculate physics for an object, if that object allows it (see [method body_set_omit_force_integration]).
  670. </description>
  671. </method>
  672. <method name="body_set_max_contacts_reported">
  673. <return type="void">
  674. </return>
  675. <argument index="0" name="body" type="RID">
  676. </argument>
  677. <argument index="1" name="amount" type="int">
  678. </argument>
  679. <description>
  680. Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0.
  681. </description>
  682. </method>
  683. <method name="body_set_mode">
  684. <return type="void">
  685. </return>
  686. <argument index="0" name="body" type="RID">
  687. </argument>
  688. <argument index="1" name="mode" type="int" enum="Physics2DServer.BodyMode">
  689. </argument>
  690. <description>
  691. Sets the body mode using one of the [enum BodyMode] constants.
  692. </description>
  693. </method>
  694. <method name="body_set_omit_force_integration">
  695. <return type="void">
  696. </return>
  697. <argument index="0" name="body" type="RID">
  698. </argument>
  699. <argument index="1" name="enable" type="bool">
  700. </argument>
  701. <description>
  702. Sets whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]).
  703. </description>
  704. </method>
  705. <method name="body_set_param">
  706. <return type="void">
  707. </return>
  708. <argument index="0" name="body" type="RID">
  709. </argument>
  710. <argument index="1" name="param" type="int" enum="Physics2DServer.BodyParameter">
  711. </argument>
  712. <argument index="2" name="value" type="float">
  713. </argument>
  714. <description>
  715. Sets a body parameter. See [enum BodyParameter] for a list of available parameters.
  716. </description>
  717. </method>
  718. <method name="body_set_shape">
  719. <return type="void">
  720. </return>
  721. <argument index="0" name="body" type="RID">
  722. </argument>
  723. <argument index="1" name="shape_idx" type="int">
  724. </argument>
  725. <argument index="2" name="shape" type="RID">
  726. </argument>
  727. <description>
  728. Substitutes a given body shape by another. The old shape is selected by its index, the new one by its [RID].
  729. </description>
  730. </method>
  731. <method name="body_set_shape_as_one_way_collision">
  732. <return type="void">
  733. </return>
  734. <argument index="0" name="body" type="RID">
  735. </argument>
  736. <argument index="1" name="shape_idx" type="int">
  737. </argument>
  738. <argument index="2" name="enable" type="bool">
  739. </argument>
  740. <argument index="3" name="margin" type="float">
  741. </argument>
  742. <description>
  743. Enables one way collision on body if [code]enable[/code] is [code]true[/code].
  744. </description>
  745. </method>
  746. <method name="body_set_shape_disabled">
  747. <return type="void">
  748. </return>
  749. <argument index="0" name="body" type="RID">
  750. </argument>
  751. <argument index="1" name="shape_idx" type="int">
  752. </argument>
  753. <argument index="2" name="disabled" type="bool">
  754. </argument>
  755. <description>
  756. Disables shape in body if [code]disable[/code] is [code]true[/code].
  757. </description>
  758. </method>
  759. <method name="body_set_shape_metadata">
  760. <return type="void">
  761. </return>
  762. <argument index="0" name="body" type="RID">
  763. </argument>
  764. <argument index="1" name="shape_idx" type="int">
  765. </argument>
  766. <argument index="2" name="metadata" type="Variant">
  767. </argument>
  768. <description>
  769. Sets metadata of a shape within a body. This metadata is different from [method Object.set_meta], and can be retrieved on shape queries.
  770. </description>
  771. </method>
  772. <method name="body_set_shape_transform">
  773. <return type="void">
  774. </return>
  775. <argument index="0" name="body" type="RID">
  776. </argument>
  777. <argument index="1" name="shape_idx" type="int">
  778. </argument>
  779. <argument index="2" name="transform" type="Transform2D">
  780. </argument>
  781. <description>
  782. Sets the transform matrix for a body shape.
  783. </description>
  784. </method>
  785. <method name="body_set_space">
  786. <return type="void">
  787. </return>
  788. <argument index="0" name="body" type="RID">
  789. </argument>
  790. <argument index="1" name="space" type="RID">
  791. </argument>
  792. <description>
  793. Assigns a space to the body (see [method space_create]).
  794. </description>
  795. </method>
  796. <method name="body_set_state">
  797. <return type="void">
  798. </return>
  799. <argument index="0" name="body" type="RID">
  800. </argument>
  801. <argument index="1" name="state" type="int" enum="Physics2DServer.BodyState">
  802. </argument>
  803. <argument index="2" name="value" type="Variant">
  804. </argument>
  805. <description>
  806. Sets a body state using one of the [enum BodyState] constants.
  807. Note that the method doesn't take effect immediately. The state will change on the next physics frame.
  808. </description>
  809. </method>
  810. <method name="body_test_motion">
  811. <return type="bool">
  812. </return>
  813. <argument index="0" name="body" type="RID">
  814. </argument>
  815. <argument index="1" name="from" type="Transform2D">
  816. </argument>
  817. <argument index="2" name="motion" type="Vector2">
  818. </argument>
  819. <argument index="3" name="infinite_inertia" type="bool">
  820. </argument>
  821. <argument index="4" name="margin" type="float" default="0.08">
  822. </argument>
  823. <argument index="5" name="result" type="Physics2DTestMotionResult" default="null">
  824. </argument>
  825. <description>
  826. Returns [code]true[/code] if a collision would result from moving in the given direction from a given point in space. Margin increases the size of the shapes involved in the collision detection. [Physics2DTestMotionResult] can be passed to return additional information in.
  827. </description>
  828. </method>
  829. <method name="capsule_shape_create">
  830. <return type="RID">
  831. </return>
  832. <description>
  833. </description>
  834. </method>
  835. <method name="circle_shape_create">
  836. <return type="RID">
  837. </return>
  838. <description>
  839. </description>
  840. </method>
  841. <method name="concave_polygon_shape_create">
  842. <return type="RID">
  843. </return>
  844. <description>
  845. </description>
  846. </method>
  847. <method name="convex_polygon_shape_create">
  848. <return type="RID">
  849. </return>
  850. <description>
  851. </description>
  852. </method>
  853. <method name="damped_spring_joint_create">
  854. <return type="RID">
  855. </return>
  856. <argument index="0" name="anchor_a" type="Vector2">
  857. </argument>
  858. <argument index="1" name="anchor_b" type="Vector2">
  859. </argument>
  860. <argument index="2" name="body_a" type="RID">
  861. </argument>
  862. <argument index="3" name="body_b" type="RID">
  863. </argument>
  864. <description>
  865. Creates a damped spring joint between two bodies. If not specified, the second body is assumed to be the joint itself.
  866. </description>
  867. </method>
  868. <method name="damped_string_joint_get_param" qualifiers="const">
  869. <return type="float">
  870. </return>
  871. <argument index="0" name="joint" type="RID">
  872. </argument>
  873. <argument index="1" name="param" type="int" enum="Physics2DServer.DampedStringParam">
  874. </argument>
  875. <description>
  876. Returns the value of a damped spring joint parameter.
  877. </description>
  878. </method>
  879. <method name="damped_string_joint_set_param">
  880. <return type="void">
  881. </return>
  882. <argument index="0" name="joint" type="RID">
  883. </argument>
  884. <argument index="1" name="param" type="int" enum="Physics2DServer.DampedStringParam">
  885. </argument>
  886. <argument index="2" name="value" type="float">
  887. </argument>
  888. <description>
  889. Sets a damped spring joint parameter. See [enum DampedStringParam] for a list of available parameters.
  890. </description>
  891. </method>
  892. <method name="free_rid">
  893. <return type="void">
  894. </return>
  895. <argument index="0" name="rid" type="RID">
  896. </argument>
  897. <description>
  898. Destroys any of the objects created by Physics2DServer. If the [RID] passed is not one of the objects that can be created by Physics2DServer, an error will be sent to the console.
  899. </description>
  900. </method>
  901. <method name="get_process_info">
  902. <return type="int">
  903. </return>
  904. <argument index="0" name="process_info" type="int" enum="Physics2DServer.ProcessInfo">
  905. </argument>
  906. <description>
  907. Returns information about the current state of the 2D physics engine. See [enum ProcessInfo] for a list of available states.
  908. </description>
  909. </method>
  910. <method name="groove_joint_create">
  911. <return type="RID">
  912. </return>
  913. <argument index="0" name="groove1_a" type="Vector2">
  914. </argument>
  915. <argument index="1" name="groove2_a" type="Vector2">
  916. </argument>
  917. <argument index="2" name="anchor_b" type="Vector2">
  918. </argument>
  919. <argument index="3" name="body_a" type="RID">
  920. </argument>
  921. <argument index="4" name="body_b" type="RID">
  922. </argument>
  923. <description>
  924. Creates a groove joint between two bodies. If not specified, the bodies are assumed to be the joint itself.
  925. </description>
  926. </method>
  927. <method name="joint_get_param" qualifiers="const">
  928. <return type="float">
  929. </return>
  930. <argument index="0" name="joint" type="RID">
  931. </argument>
  932. <argument index="1" name="param" type="int" enum="Physics2DServer.JointParam">
  933. </argument>
  934. <description>
  935. Returns the value of a joint parameter.
  936. </description>
  937. </method>
  938. <method name="joint_get_type" qualifiers="const">
  939. <return type="int" enum="Physics2DServer.JointType">
  940. </return>
  941. <argument index="0" name="joint" type="RID">
  942. </argument>
  943. <description>
  944. Returns a joint's type (see [enum JointType]).
  945. </description>
  946. </method>
  947. <method name="joint_set_param">
  948. <return type="void">
  949. </return>
  950. <argument index="0" name="joint" type="RID">
  951. </argument>
  952. <argument index="1" name="param" type="int" enum="Physics2DServer.JointParam">
  953. </argument>
  954. <argument index="2" name="value" type="float">
  955. </argument>
  956. <description>
  957. Sets a joint parameter. See [enum JointParam] for a list of available parameters.
  958. </description>
  959. </method>
  960. <method name="line_shape_create">
  961. <return type="RID">
  962. </return>
  963. <description>
  964. </description>
  965. </method>
  966. <method name="pin_joint_create">
  967. <return type="RID">
  968. </return>
  969. <argument index="0" name="anchor" type="Vector2">
  970. </argument>
  971. <argument index="1" name="body_a" type="RID">
  972. </argument>
  973. <argument index="2" name="body_b" type="RID">
  974. </argument>
  975. <description>
  976. Creates a pin joint between two bodies. If not specified, the second body is assumed to be the joint itself.
  977. </description>
  978. </method>
  979. <method name="ray_shape_create">
  980. <return type="RID">
  981. </return>
  982. <description>
  983. </description>
  984. </method>
  985. <method name="rectangle_shape_create">
  986. <return type="RID">
  987. </return>
  988. <description>
  989. </description>
  990. </method>
  991. <method name="segment_shape_create">
  992. <return type="RID">
  993. </return>
  994. <description>
  995. </description>
  996. </method>
  997. <method name="set_active">
  998. <return type="void">
  999. </return>
  1000. <argument index="0" name="active" type="bool">
  1001. </argument>
  1002. <description>
  1003. Activates or deactivates the 2D physics engine.
  1004. </description>
  1005. </method>
  1006. <method name="set_collision_iterations">
  1007. <return type="void">
  1008. </return>
  1009. <argument index="0" name="iterations" type="int">
  1010. </argument>
  1011. <description>
  1012. Sets the amount of iterations for calculating velocities of colliding bodies. The greater the amount, the more accurate the collisions, but with a performance loss.
  1013. </description>
  1014. </method>
  1015. <method name="shape_get_data" qualifiers="const">
  1016. <return type="Variant">
  1017. </return>
  1018. <argument index="0" name="shape" type="RID">
  1019. </argument>
  1020. <description>
  1021. Returns the shape data.
  1022. </description>
  1023. </method>
  1024. <method name="shape_get_type" qualifiers="const">
  1025. <return type="int" enum="Physics2DServer.ShapeType">
  1026. </return>
  1027. <argument index="0" name="shape" type="RID">
  1028. </argument>
  1029. <description>
  1030. Returns a shape's type (see [enum ShapeType]).
  1031. </description>
  1032. </method>
  1033. <method name="shape_set_data">
  1034. <return type="void">
  1035. </return>
  1036. <argument index="0" name="shape" type="RID">
  1037. </argument>
  1038. <argument index="1" name="data" type="Variant">
  1039. </argument>
  1040. <description>
  1041. Sets the shape data that defines its shape and size. The data to be passed depends on the kind of shape created [method shape_get_type].
  1042. </description>
  1043. </method>
  1044. <method name="space_create">
  1045. <return type="RID">
  1046. </return>
  1047. <description>
  1048. Creates a space. A space is a collection of parameters for the physics engine that can be assigned to an area or a body. It can be assigned to an area with [method area_set_space], or to a body with [method body_set_space].
  1049. </description>
  1050. </method>
  1051. <method name="space_get_direct_state">
  1052. <return type="Physics2DDirectSpaceState">
  1053. </return>
  1054. <argument index="0" name="space" type="RID">
  1055. </argument>
  1056. <description>
  1057. Returns the state of a space, a [Physics2DDirectSpaceState]. This object can be used to make collision/intersection queries.
  1058. </description>
  1059. </method>
  1060. <method name="space_get_param" qualifiers="const">
  1061. <return type="float">
  1062. </return>
  1063. <argument index="0" name="space" type="RID">
  1064. </argument>
  1065. <argument index="1" name="param" type="int" enum="Physics2DServer.SpaceParameter">
  1066. </argument>
  1067. <description>
  1068. Returns the value of a space parameter.
  1069. </description>
  1070. </method>
  1071. <method name="space_is_active" qualifiers="const">
  1072. <return type="bool">
  1073. </return>
  1074. <argument index="0" name="space" type="RID">
  1075. </argument>
  1076. <description>
  1077. Returns whether the space is active.
  1078. </description>
  1079. </method>
  1080. <method name="space_set_active">
  1081. <return type="void">
  1082. </return>
  1083. <argument index="0" name="space" type="RID">
  1084. </argument>
  1085. <argument index="1" name="active" type="bool">
  1086. </argument>
  1087. <description>
  1088. Marks a space as active. It will not have an effect, unless it is assigned to an area or body.
  1089. </description>
  1090. </method>
  1091. <method name="space_set_param">
  1092. <return type="void">
  1093. </return>
  1094. <argument index="0" name="space" type="RID">
  1095. </argument>
  1096. <argument index="1" name="param" type="int" enum="Physics2DServer.SpaceParameter">
  1097. </argument>
  1098. <argument index="2" name="value" type="float">
  1099. </argument>
  1100. <description>
  1101. Sets the value for a space parameter. See [enum SpaceParameter] for a list of available parameters.
  1102. </description>
  1103. </method>
  1104. </methods>
  1105. <constants>
  1106. <constant name="SPACE_PARAM_CONTACT_RECYCLE_RADIUS" value="0" enum="SpaceParameter">
  1107. Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated.
  1108. </constant>
  1109. <constant name="SPACE_PARAM_CONTACT_MAX_SEPARATION" value="1" enum="SpaceParameter">
  1110. Constant to set/get the maximum distance a shape can be from another before they are considered separated.
  1111. </constant>
  1112. <constant name="SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION" value="2" enum="SpaceParameter">
  1113. Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision.
  1114. </constant>
  1115. <constant name="SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD" value="3" enum="SpaceParameter">
  1116. Constant to set/get the threshold linear velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given.
  1117. </constant>
  1118. <constant name="SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD" value="4" enum="SpaceParameter">
  1119. Constant to set/get the threshold angular velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given.
  1120. </constant>
  1121. <constant name="SPACE_PARAM_BODY_TIME_TO_SLEEP" value="5" enum="SpaceParameter">
  1122. Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time.
  1123. </constant>
  1124. <constant name="SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS" value="6" enum="SpaceParameter">
  1125. Constant to set/get the default solver bias for all physics constraints. A solver bias is a factor controlling how much two objects "rebound", after violating a constraint, to avoid leaving them in that state because of numerical imprecision.
  1126. </constant>
  1127. <constant name="SPACE_PARAM_TEST_MOTION_MIN_CONTACT_DEPTH" value="7" enum="SpaceParameter">
  1128. </constant>
  1129. <constant name="SHAPE_LINE" value="0" enum="ShapeType">
  1130. This is the constant for creating line shapes. A line shape is an infinite line with an origin point, and a normal. Thus, it can be used for front/behind checks.
  1131. </constant>
  1132. <constant name="SHAPE_RAY" value="1" enum="ShapeType">
  1133. </constant>
  1134. <constant name="SHAPE_SEGMENT" value="2" enum="ShapeType">
  1135. This is the constant for creating segment shapes. A segment shape is a line from a point A to a point B. It can be checked for intersections.
  1136. </constant>
  1137. <constant name="SHAPE_CIRCLE" value="3" enum="ShapeType">
  1138. This is the constant for creating circle shapes. A circle shape only has a radius. It can be used for intersections and inside/outside checks.
  1139. </constant>
  1140. <constant name="SHAPE_RECTANGLE" value="4" enum="ShapeType">
  1141. This is the constant for creating rectangle shapes. A rectangle shape is defined by a width and a height. It can be used for intersections and inside/outside checks.
  1142. </constant>
  1143. <constant name="SHAPE_CAPSULE" value="5" enum="ShapeType">
  1144. This is the constant for creating capsule shapes. A capsule shape is defined by a radius and a length. It can be used for intersections and inside/outside checks.
  1145. </constant>
  1146. <constant name="SHAPE_CONVEX_POLYGON" value="6" enum="ShapeType">
  1147. This is the constant for creating convex polygon shapes. A polygon is defined by a list of points. It can be used for intersections and inside/outside checks. Unlike the [member CollisionPolygon2D.polygon] property, polygons modified with [method shape_set_data] do not verify that the points supplied form is a convex polygon.
  1148. </constant>
  1149. <constant name="SHAPE_CONCAVE_POLYGON" value="7" enum="ShapeType">
  1150. This is the constant for creating concave polygon shapes. A polygon is defined by a list of points. It can be used for intersections checks, but not for inside/outside checks.
  1151. </constant>
  1152. <constant name="SHAPE_CUSTOM" value="8" enum="ShapeType">
  1153. This constant is used internally by the engine. Any attempt to create this kind of shape results in an error.
  1154. </constant>
  1155. <constant name="AREA_PARAM_GRAVITY" value="0" enum="AreaParameter">
  1156. Constant to set/get gravity strength in an area.
  1157. </constant>
  1158. <constant name="AREA_PARAM_GRAVITY_VECTOR" value="1" enum="AreaParameter">
  1159. Constant to set/get gravity vector/center in an area.
  1160. </constant>
  1161. <constant name="AREA_PARAM_GRAVITY_IS_POINT" value="2" enum="AreaParameter">
  1162. Constant to set/get whether the gravity vector of an area is a direction, or a center point.
  1163. </constant>
  1164. <constant name="AREA_PARAM_GRAVITY_DISTANCE_SCALE" value="3" enum="AreaParameter">
  1165. Constant to set/get the falloff factor for point gravity of an area. The greater this value is, the faster the strength of gravity decreases with the square of distance.
  1166. </constant>
  1167. <constant name="AREA_PARAM_GRAVITY_POINT_ATTENUATION" value="4" enum="AreaParameter">
  1168. This constant was used to set/get the falloff factor for point gravity. It has been superseded by [constant AREA_PARAM_GRAVITY_DISTANCE_SCALE].
  1169. </constant>
  1170. <constant name="AREA_PARAM_LINEAR_DAMP" value="5" enum="AreaParameter">
  1171. Constant to set/get the linear dampening factor of an area.
  1172. </constant>
  1173. <constant name="AREA_PARAM_ANGULAR_DAMP" value="6" enum="AreaParameter">
  1174. Constant to set/get the angular dampening factor of an area.
  1175. </constant>
  1176. <constant name="AREA_PARAM_PRIORITY" value="7" enum="AreaParameter">
  1177. Constant to set/get the priority (order of processing) of an area.
  1178. </constant>
  1179. <constant name="AREA_SPACE_OVERRIDE_DISABLED" value="0" enum="AreaSpaceOverrideMode">
  1180. This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them.
  1181. </constant>
  1182. <constant name="AREA_SPACE_OVERRIDE_COMBINE" value="1" enum="AreaSpaceOverrideMode">
  1183. This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects.
  1184. </constant>
  1185. <constant name="AREA_SPACE_OVERRIDE_COMBINE_REPLACE" value="2" enum="AreaSpaceOverrideMode">
  1186. This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one.
  1187. </constant>
  1188. <constant name="AREA_SPACE_OVERRIDE_REPLACE" value="3" enum="AreaSpaceOverrideMode">
  1189. This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas.
  1190. </constant>
  1191. <constant name="AREA_SPACE_OVERRIDE_REPLACE_COMBINE" value="4" enum="AreaSpaceOverrideMode">
  1192. This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one.
  1193. </constant>
  1194. <constant name="BODY_MODE_STATIC" value="0" enum="BodyMode">
  1195. Constant for static bodies.
  1196. </constant>
  1197. <constant name="BODY_MODE_KINEMATIC" value="1" enum="BodyMode">
  1198. Constant for kinematic bodies.
  1199. </constant>
  1200. <constant name="BODY_MODE_RIGID" value="2" enum="BodyMode">
  1201. Constant for rigid bodies.
  1202. </constant>
  1203. <constant name="BODY_MODE_CHARACTER" value="3" enum="BodyMode">
  1204. Constant for rigid bodies in character mode. In this mode, a body can not rotate, and only its linear velocity is affected by physics.
  1205. </constant>
  1206. <constant name="BODY_PARAM_BOUNCE" value="0" enum="BodyParameter">
  1207. Constant to set/get a body's bounce factor.
  1208. </constant>
  1209. <constant name="BODY_PARAM_FRICTION" value="1" enum="BodyParameter">
  1210. Constant to set/get a body's friction.
  1211. </constant>
  1212. <constant name="BODY_PARAM_MASS" value="2" enum="BodyParameter">
  1213. Constant to set/get a body's mass.
  1214. </constant>
  1215. <constant name="BODY_PARAM_INERTIA" value="3" enum="BodyParameter">
  1216. Constant to set/get a body's inertia.
  1217. </constant>
  1218. <constant name="BODY_PARAM_GRAVITY_SCALE" value="4" enum="BodyParameter">
  1219. Constant to set/get a body's gravity multiplier.
  1220. </constant>
  1221. <constant name="BODY_PARAM_LINEAR_DAMP" value="5" enum="BodyParameter">
  1222. Constant to set/get a body's linear dampening factor.
  1223. </constant>
  1224. <constant name="BODY_PARAM_ANGULAR_DAMP" value="6" enum="BodyParameter">
  1225. Constant to set/get a body's angular dampening factor.
  1226. </constant>
  1227. <constant name="BODY_PARAM_MAX" value="7" enum="BodyParameter">
  1228. Represents the size of the [enum BodyParameter] enum.
  1229. </constant>
  1230. <constant name="BODY_STATE_TRANSFORM" value="0" enum="BodyState">
  1231. Constant to set/get the current transform matrix of the body.
  1232. </constant>
  1233. <constant name="BODY_STATE_LINEAR_VELOCITY" value="1" enum="BodyState">
  1234. Constant to set/get the current linear velocity of the body.
  1235. </constant>
  1236. <constant name="BODY_STATE_ANGULAR_VELOCITY" value="2" enum="BodyState">
  1237. Constant to set/get the current angular velocity of the body.
  1238. </constant>
  1239. <constant name="BODY_STATE_SLEEPING" value="3" enum="BodyState">
  1240. Constant to sleep/wake up a body, or to get whether it is sleeping.
  1241. </constant>
  1242. <constant name="BODY_STATE_CAN_SLEEP" value="4" enum="BodyState">
  1243. Constant to set/get whether the body can sleep.
  1244. </constant>
  1245. <constant name="JOINT_PIN" value="0" enum="JointType">
  1246. Constant to create pin joints.
  1247. </constant>
  1248. <constant name="JOINT_GROOVE" value="1" enum="JointType">
  1249. Constant to create groove joints.
  1250. </constant>
  1251. <constant name="JOINT_DAMPED_SPRING" value="2" enum="JointType">
  1252. Constant to create damped spring joints.
  1253. </constant>
  1254. <constant name="JOINT_PARAM_BIAS" value="0" enum="JointParam">
  1255. </constant>
  1256. <constant name="JOINT_PARAM_MAX_BIAS" value="1" enum="JointParam">
  1257. </constant>
  1258. <constant name="JOINT_PARAM_MAX_FORCE" value="2" enum="JointParam">
  1259. </constant>
  1260. <constant name="DAMPED_STRING_REST_LENGTH" value="0" enum="DampedStringParam">
  1261. Sets the resting length of the spring joint. The joint will always try to go to back this length when pulled apart.
  1262. </constant>
  1263. <constant name="DAMPED_STRING_STIFFNESS" value="1" enum="DampedStringParam">
  1264. Sets the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length.
  1265. </constant>
  1266. <constant name="DAMPED_STRING_DAMPING" value="2" enum="DampedStringParam">
  1267. Sets the damping ratio of the spring joint. A value of 0 indicates an undamped spring, while 1 causes the system to reach equilibrium as fast as possible (critical damping).
  1268. </constant>
  1269. <constant name="CCD_MODE_DISABLED" value="0" enum="CCDMode">
  1270. Disables continuous collision detection. This is the fastest way to detect body collisions, but can miss small, fast-moving objects.
  1271. </constant>
  1272. <constant name="CCD_MODE_CAST_RAY" value="1" enum="CCDMode">
  1273. Enables continuous collision detection by raycasting. It is faster than shapecasting, but less precise.
  1274. </constant>
  1275. <constant name="CCD_MODE_CAST_SHAPE" value="2" enum="CCDMode">
  1276. Enables continuous collision detection by shapecasting. It is the slowest CCD method, and the most precise.
  1277. </constant>
  1278. <constant name="AREA_BODY_ADDED" value="0" enum="AreaBodyStatus">
  1279. The value of the first parameter and area callback function receives, when an object enters one of its shapes.
  1280. </constant>
  1281. <constant name="AREA_BODY_REMOVED" value="1" enum="AreaBodyStatus">
  1282. The value of the first parameter and area callback function receives, when an object exits one of its shapes.
  1283. </constant>
  1284. <constant name="INFO_ACTIVE_OBJECTS" value="0" enum="ProcessInfo">
  1285. Constant to get the number of objects that are not sleeping.
  1286. </constant>
  1287. <constant name="INFO_COLLISION_PAIRS" value="1" enum="ProcessInfo">
  1288. Constant to get the number of possible collisions.
  1289. </constant>
  1290. <constant name="INFO_ISLAND_COUNT" value="2" enum="ProcessInfo">
  1291. Constant to get the number of space regions where a collision could occur.
  1292. </constant>
  1293. </constants>
  1294. </class>