Physics2DServer.xml 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Physics2DServer" inherits="Object" category="Core" version="3.1">
  3. <brief_description>
  4. Physics 2D Server.
  5. </brief_description>
  6. <description>
  7. Physics 2D Server 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. <demos>
  12. </demos>
  13. <methods>
  14. <method name="area_add_shape">
  15. <return type="void">
  16. </return>
  17. <argument index="0" name="area" type="RID">
  18. </argument>
  19. <argument index="1" name="shape" type="RID">
  20. </argument>
  21. <argument index="2" name="transform" type="Transform2D" default="Transform2D( 1, 0, 0, 1, 0, 0 )">
  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].
  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. A list of available parameters is on the AREA_PARAM_* constants.
  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: AREA_BODY_ADDED or 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. A list of available parameters is on the AREA_PARAM_* constants.
  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="disable" 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. The modes are described in the constants AREA_SPACE_OVERRIDE_*.
  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. <description>
  352. 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.
  353. </description>
  354. </method>
  355. <method name="body_add_torque">
  356. <return type="void">
  357. </return>
  358. <argument index="0" name="body" type="RID">
  359. </argument>
  360. <argument index="1" name="torque" type="float">
  361. </argument>
  362. <description>
  363. </description>
  364. </method>
  365. <method name="body_apply_central_impulse">
  366. <return type="void">
  367. </return>
  368. <argument index="0" name="body" type="RID">
  369. </argument>
  370. <argument index="1" name="impulse" type="Vector2">
  371. </argument>
  372. <description>
  373. </description>
  374. </method>
  375. <method name="body_apply_impulse">
  376. <return type="void">
  377. </return>
  378. <argument index="0" name="body" type="RID">
  379. </argument>
  380. <argument index="1" name="position" type="Vector2">
  381. </argument>
  382. <argument index="2" name="impulse" type="Vector2">
  383. </argument>
  384. <description>
  385. Adds a positioned impulse to the applied force and torque. Both the force and the offset from the body origin are in global coordinates.
  386. </description>
  387. </method>
  388. <method name="body_apply_torque_impulse">
  389. <return type="void">
  390. </return>
  391. <argument index="0" name="body" type="RID">
  392. </argument>
  393. <argument index="1" name="impulse" type="float">
  394. </argument>
  395. <description>
  396. </description>
  397. </method>
  398. <method name="body_attach_canvas_instance_id">
  399. <return type="void">
  400. </return>
  401. <argument index="0" name="body" type="RID">
  402. </argument>
  403. <argument index="1" name="id" type="int">
  404. </argument>
  405. <description>
  406. </description>
  407. </method>
  408. <method name="body_attach_object_instance_id">
  409. <return type="void">
  410. </return>
  411. <argument index="0" name="body" type="RID">
  412. </argument>
  413. <argument index="1" name="id" type="int">
  414. </argument>
  415. <description>
  416. Assigns the area to a descendant of [Object], so it can exist in the node tree.
  417. </description>
  418. </method>
  419. <method name="body_clear_shapes">
  420. <return type="void">
  421. </return>
  422. <argument index="0" name="body" type="RID">
  423. </argument>
  424. <description>
  425. Removes all shapes from a body.
  426. </description>
  427. </method>
  428. <method name="body_create">
  429. <return type="RID">
  430. </return>
  431. <description>
  432. Creates a physics body. The first parameter can be any value from constants BODY_MODE*, for the type of body created. Additionally, the body can be created in sleeping state to save processing time.
  433. </description>
  434. </method>
  435. <method name="body_get_canvas_instance_id" qualifiers="const">
  436. <return type="int">
  437. </return>
  438. <argument index="0" name="body" type="RID">
  439. </argument>
  440. <description>
  441. </description>
  442. </method>
  443. <method name="body_get_collision_layer" qualifiers="const">
  444. <return type="int">
  445. </return>
  446. <argument index="0" name="body" type="RID">
  447. </argument>
  448. <description>
  449. Returns the physics layer or layers a body belongs to.
  450. </description>
  451. </method>
  452. <method name="body_get_collision_mask" qualifiers="const">
  453. <return type="int">
  454. </return>
  455. <argument index="0" name="body" type="RID">
  456. </argument>
  457. <description>
  458. Returns the physics layer or layers a body can collide with.
  459. </description>
  460. </method>
  461. <method name="body_get_continuous_collision_detection_mode" qualifiers="const">
  462. <return type="int" enum="Physics2DServer.CCDMode">
  463. </return>
  464. <argument index="0" name="body" type="RID">
  465. </argument>
  466. <description>
  467. Returns the continuous collision detection mode.
  468. </description>
  469. </method>
  470. <method name="body_get_direct_state">
  471. <return type="Physics2DDirectBodyState">
  472. </return>
  473. <argument index="0" name="body" type="RID">
  474. </argument>
  475. <description>
  476. Returns the [Physics2DDirectBodyState] of the body.
  477. </description>
  478. </method>
  479. <method name="body_get_max_contacts_reported" qualifiers="const">
  480. <return type="int">
  481. </return>
  482. <argument index="0" name="body" type="RID">
  483. </argument>
  484. <description>
  485. Returns the maximum contacts that can be reported. See [method body_set_max_contacts_reported].
  486. </description>
  487. </method>
  488. <method name="body_get_mode" qualifiers="const">
  489. <return type="int" enum="Physics2DServer.BodyMode">
  490. </return>
  491. <argument index="0" name="body" type="RID">
  492. </argument>
  493. <description>
  494. Returns the body mode.
  495. </description>
  496. </method>
  497. <method name="body_get_object_instance_id" qualifiers="const">
  498. <return type="int">
  499. </return>
  500. <argument index="0" name="body" type="RID">
  501. </argument>
  502. <description>
  503. Gets the instance ID of the object the area is assigned to.
  504. </description>
  505. </method>
  506. <method name="body_get_param" qualifiers="const">
  507. <return type="float">
  508. </return>
  509. <argument index="0" name="body" type="RID">
  510. </argument>
  511. <argument index="1" name="param" type="int" enum="Physics2DServer.BodyParameter">
  512. </argument>
  513. <description>
  514. Returns the value of a body parameter. A list of available parameters is on the BODY_PARAM_* constants.
  515. </description>
  516. </method>
  517. <method name="body_get_shape" qualifiers="const">
  518. <return type="RID">
  519. </return>
  520. <argument index="0" name="body" type="RID">
  521. </argument>
  522. <argument index="1" name="shape_idx" type="int">
  523. </argument>
  524. <description>
  525. Returns the [RID] of the nth shape of a body.
  526. </description>
  527. </method>
  528. <method name="body_get_shape_count" qualifiers="const">
  529. <return type="int">
  530. </return>
  531. <argument index="0" name="body" type="RID">
  532. </argument>
  533. <description>
  534. Returns the number of shapes assigned to a body.
  535. </description>
  536. </method>
  537. <method name="body_get_shape_metadata" qualifiers="const">
  538. <return type="Variant">
  539. </return>
  540. <argument index="0" name="body" type="RID">
  541. </argument>
  542. <argument index="1" name="shape_idx" type="int">
  543. </argument>
  544. <description>
  545. Returns the metadata of a shape of a body.
  546. </description>
  547. </method>
  548. <method name="body_get_shape_transform" qualifiers="const">
  549. <return type="Transform2D">
  550. </return>
  551. <argument index="0" name="body" type="RID">
  552. </argument>
  553. <argument index="1" name="shape_idx" type="int">
  554. </argument>
  555. <description>
  556. Returns the transform matrix of a body shape.
  557. </description>
  558. </method>
  559. <method name="body_get_space" qualifiers="const">
  560. <return type="RID">
  561. </return>
  562. <argument index="0" name="body" type="RID">
  563. </argument>
  564. <description>
  565. Returns the [RID] of the space assigned to a body.
  566. </description>
  567. </method>
  568. <method name="body_get_state" qualifiers="const">
  569. <return type="Variant">
  570. </return>
  571. <argument index="0" name="body" type="RID">
  572. </argument>
  573. <argument index="1" name="state" type="int" enum="Physics2DServer.BodyState">
  574. </argument>
  575. <description>
  576. Returns a body state.
  577. </description>
  578. </method>
  579. <method name="body_is_omitting_force_integration" qualifiers="const">
  580. <return type="bool">
  581. </return>
  582. <argument index="0" name="body" type="RID">
  583. </argument>
  584. <description>
  585. Returns whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]).
  586. </description>
  587. </method>
  588. <method name="body_remove_collision_exception">
  589. <return type="void">
  590. </return>
  591. <argument index="0" name="body" type="RID">
  592. </argument>
  593. <argument index="1" name="excepted_body" type="RID">
  594. </argument>
  595. <description>
  596. Removes a body from the list of bodies exempt from collisions.
  597. </description>
  598. </method>
  599. <method name="body_remove_shape">
  600. <return type="void">
  601. </return>
  602. <argument index="0" name="body" type="RID">
  603. </argument>
  604. <argument index="1" name="shape_idx" type="int">
  605. </argument>
  606. <description>
  607. Removes a shape from a body. The shape is not deleted, so it can be reused afterwards.
  608. </description>
  609. </method>
  610. <method name="body_set_axis_velocity">
  611. <return type="void">
  612. </return>
  613. <argument index="0" name="body" type="RID">
  614. </argument>
  615. <argument index="1" name="axis_velocity" type="Vector2">
  616. </argument>
  617. <description>
  618. 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.
  619. </description>
  620. </method>
  621. <method name="body_set_collision_layer">
  622. <return type="void">
  623. </return>
  624. <argument index="0" name="body" type="RID">
  625. </argument>
  626. <argument index="1" name="layer" type="int">
  627. </argument>
  628. <description>
  629. Sets the physics layer or layers a body belongs to.
  630. </description>
  631. </method>
  632. <method name="body_set_collision_mask">
  633. <return type="void">
  634. </return>
  635. <argument index="0" name="body" type="RID">
  636. </argument>
  637. <argument index="1" name="mask" type="int">
  638. </argument>
  639. <description>
  640. Sets the physics layer or layers a body can collide with.
  641. </description>
  642. </method>
  643. <method name="body_set_continuous_collision_detection_mode">
  644. <return type="void">
  645. </return>
  646. <argument index="0" name="body" type="RID">
  647. </argument>
  648. <argument index="1" name="mode" type="int" enum="Physics2DServer.CCDMode">
  649. </argument>
  650. <description>
  651. Sets the continuous collision detection mode from any of the CCD_MODE_* constants.
  652. Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided.
  653. </description>
  654. </method>
  655. <method name="body_set_force_integration_callback">
  656. <return type="void">
  657. </return>
  658. <argument index="0" name="body" type="RID">
  659. </argument>
  660. <argument index="1" name="receiver" type="Object">
  661. </argument>
  662. <argument index="2" name="method" type="String">
  663. </argument>
  664. <argument index="3" name="userdata" type="Variant" default="null">
  665. </argument>
  666. <description>
  667. Sets the function used to calculate physics for an object, if that object allows it (see [method body_set_omit_force_integration]).
  668. </description>
  669. </method>
  670. <method name="body_set_max_contacts_reported">
  671. <return type="void">
  672. </return>
  673. <argument index="0" name="body" type="RID">
  674. </argument>
  675. <argument index="1" name="amount" type="int">
  676. </argument>
  677. <description>
  678. 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.
  679. </description>
  680. </method>
  681. <method name="body_set_mode">
  682. <return type="void">
  683. </return>
  684. <argument index="0" name="body" type="RID">
  685. </argument>
  686. <argument index="1" name="mode" type="int" enum="Physics2DServer.BodyMode">
  687. </argument>
  688. <description>
  689. Sets the body mode, from one of the constants BODY_MODE*.
  690. </description>
  691. </method>
  692. <method name="body_set_omit_force_integration">
  693. <return type="void">
  694. </return>
  695. <argument index="0" name="body" type="RID">
  696. </argument>
  697. <argument index="1" name="enable" type="bool">
  698. </argument>
  699. <description>
  700. Sets whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]).
  701. </description>
  702. </method>
  703. <method name="body_set_param">
  704. <return type="void">
  705. </return>
  706. <argument index="0" name="body" type="RID">
  707. </argument>
  708. <argument index="1" name="param" type="int" enum="Physics2DServer.BodyParameter">
  709. </argument>
  710. <argument index="2" name="value" type="float">
  711. </argument>
  712. <description>
  713. Sets a body parameter. A list of available parameters is on the BODY_PARAM_* constants.
  714. </description>
  715. </method>
  716. <method name="body_set_shape">
  717. <return type="void">
  718. </return>
  719. <argument index="0" name="body" type="RID">
  720. </argument>
  721. <argument index="1" name="shape_idx" type="int">
  722. </argument>
  723. <argument index="2" name="shape" type="RID">
  724. </argument>
  725. <description>
  726. Substitutes a given body shape by another. The old shape is selected by its index, the new one by its [RID].
  727. </description>
  728. </method>
  729. <method name="body_set_shape_as_one_way_collision">
  730. <return type="void">
  731. </return>
  732. <argument index="0" name="body" type="RID">
  733. </argument>
  734. <argument index="1" name="shape_idx" type="int">
  735. </argument>
  736. <argument index="2" name="enable" type="bool">
  737. </argument>
  738. <description>
  739. Enables one way collision on body if [code]enable[/code] is [code]true[/code].
  740. </description>
  741. </method>
  742. <method name="body_set_shape_disabled">
  743. <return type="void">
  744. </return>
  745. <argument index="0" name="body" type="RID">
  746. </argument>
  747. <argument index="1" name="shape_idx" type="int">
  748. </argument>
  749. <argument index="2" name="disable" type="bool">
  750. </argument>
  751. <description>
  752. Disables shape in body if [code]disable[/code] is [code]true[/code].
  753. </description>
  754. </method>
  755. <method name="body_set_shape_metadata">
  756. <return type="void">
  757. </return>
  758. <argument index="0" name="body" type="RID">
  759. </argument>
  760. <argument index="1" name="shape_idx" type="int">
  761. </argument>
  762. <argument index="2" name="metadata" type="Variant">
  763. </argument>
  764. <description>
  765. Sets metadata of a shape within a body. This metadata is different from [method Object.set_meta], and can be retrieved on shape queries.
  766. </description>
  767. </method>
  768. <method name="body_set_shape_transform">
  769. <return type="void">
  770. </return>
  771. <argument index="0" name="body" type="RID">
  772. </argument>
  773. <argument index="1" name="shape_idx" type="int">
  774. </argument>
  775. <argument index="2" name="transform" type="Transform2D">
  776. </argument>
  777. <description>
  778. Sets the transform matrix for a body shape.
  779. </description>
  780. </method>
  781. <method name="body_set_space">
  782. <return type="void">
  783. </return>
  784. <argument index="0" name="body" type="RID">
  785. </argument>
  786. <argument index="1" name="space" type="RID">
  787. </argument>
  788. <description>
  789. Assigns a space to the body (see [method space_create]).
  790. </description>
  791. </method>
  792. <method name="body_set_state">
  793. <return type="void">
  794. </return>
  795. <argument index="0" name="body" type="RID">
  796. </argument>
  797. <argument index="1" name="state" type="int" enum="Physics2DServer.BodyState">
  798. </argument>
  799. <argument index="2" name="value" type="Variant">
  800. </argument>
  801. <description>
  802. Sets a body state (see BODY_STATE* constants).
  803. </description>
  804. </method>
  805. <method name="body_test_motion">
  806. <return type="bool">
  807. </return>
  808. <argument index="0" name="body" type="RID">
  809. </argument>
  810. <argument index="1" name="from" type="Transform2D">
  811. </argument>
  812. <argument index="2" name="motion" type="Vector2">
  813. </argument>
  814. <argument index="3" name="infinite_inertia" type="bool">
  815. </argument>
  816. <argument index="4" name="margin" type="float" default="0.08">
  817. </argument>
  818. <argument index="5" name="result" type="Physics2DTestMotionResult" default="null">
  819. </argument>
  820. <description>
  821. Returns whether a body can move from a given point in a given direction. Apart from the boolean return value, a [Physics2DTestMotionResult] can be passed to return additional information in.
  822. </description>
  823. </method>
  824. <method name="capsule_shape_create">
  825. <return type="RID">
  826. </return>
  827. <description>
  828. </description>
  829. </method>
  830. <method name="circle_shape_create">
  831. <return type="RID">
  832. </return>
  833. <description>
  834. </description>
  835. </method>
  836. <method name="concave_polygon_shape_create">
  837. <return type="RID">
  838. </return>
  839. <description>
  840. </description>
  841. </method>
  842. <method name="convex_polygon_shape_create">
  843. <return type="RID">
  844. </return>
  845. <description>
  846. </description>
  847. </method>
  848. <method name="damped_spring_joint_create">
  849. <return type="RID">
  850. </return>
  851. <argument index="0" name="anchor_a" type="Vector2">
  852. </argument>
  853. <argument index="1" name="anchor_b" type="Vector2">
  854. </argument>
  855. <argument index="2" name="body_a" type="RID">
  856. </argument>
  857. <argument index="3" name="body_b" type="RID">
  858. </argument>
  859. <description>
  860. Creates a damped spring joint between two bodies. If not specified, the second body is assumed to be the joint itself.
  861. </description>
  862. </method>
  863. <method name="damped_string_joint_get_param" qualifiers="const">
  864. <return type="float">
  865. </return>
  866. <argument index="0" name="joint" type="RID">
  867. </argument>
  868. <argument index="1" name="param" type="int" enum="Physics2DServer.DampedStringParam">
  869. </argument>
  870. <description>
  871. Returns the value of a damped spring joint parameter.
  872. </description>
  873. </method>
  874. <method name="damped_string_joint_set_param">
  875. <return type="void">
  876. </return>
  877. <argument index="0" name="joint" type="RID">
  878. </argument>
  879. <argument index="1" name="param" type="int" enum="Physics2DServer.DampedStringParam">
  880. </argument>
  881. <argument index="2" name="value" type="float">
  882. </argument>
  883. <description>
  884. Sets a damped spring joint parameter. Parameters are explained in the DAMPED_STRING* constants.
  885. </description>
  886. </method>
  887. <method name="free_rid">
  888. <return type="void">
  889. </return>
  890. <argument index="0" name="rid" type="RID">
  891. </argument>
  892. <description>
  893. 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.
  894. </description>
  895. </method>
  896. <method name="get_process_info">
  897. <return type="int">
  898. </return>
  899. <argument index="0" name="process_info" type="int" enum="Physics2DServer.ProcessInfo">
  900. </argument>
  901. <description>
  902. Returns information about the current state of the 2D physics engine. The states are listed under the INFO_* constants.
  903. </description>
  904. </method>
  905. <method name="groove_joint_create">
  906. <return type="RID">
  907. </return>
  908. <argument index="0" name="groove1_a" type="Vector2">
  909. </argument>
  910. <argument index="1" name="groove2_a" type="Vector2">
  911. </argument>
  912. <argument index="2" name="anchor_b" type="Vector2">
  913. </argument>
  914. <argument index="3" name="body_a" type="RID">
  915. </argument>
  916. <argument index="4" name="body_b" type="RID">
  917. </argument>
  918. <description>
  919. Creates a groove joint between two bodies. If not specified, the bodyies are assumed to be the joint itself.
  920. </description>
  921. </method>
  922. <method name="joint_get_param" qualifiers="const">
  923. <return type="float">
  924. </return>
  925. <argument index="0" name="joint" type="RID">
  926. </argument>
  927. <argument index="1" name="param" type="int" enum="Physics2DServer.JointParam">
  928. </argument>
  929. <description>
  930. Returns the value of a joint parameter.
  931. </description>
  932. </method>
  933. <method name="joint_get_type" qualifiers="const">
  934. <return type="int" enum="Physics2DServer.JointType">
  935. </return>
  936. <argument index="0" name="joint" type="RID">
  937. </argument>
  938. <description>
  939. Returns the type of a joint (see JOINT_* constants).
  940. </description>
  941. </method>
  942. <method name="joint_set_param">
  943. <return type="void">
  944. </return>
  945. <argument index="0" name="joint" type="RID">
  946. </argument>
  947. <argument index="1" name="param" type="int" enum="Physics2DServer.JointParam">
  948. </argument>
  949. <argument index="2" name="value" type="float">
  950. </argument>
  951. <description>
  952. Sets a joint parameter. Parameters are explained in the JOINT_PARAM* constants.
  953. </description>
  954. </method>
  955. <method name="line_shape_create">
  956. <return type="RID">
  957. </return>
  958. <description>
  959. </description>
  960. </method>
  961. <method name="pin_joint_create">
  962. <return type="RID">
  963. </return>
  964. <argument index="0" name="anchor" type="Vector2">
  965. </argument>
  966. <argument index="1" name="body_a" type="RID">
  967. </argument>
  968. <argument index="2" name="body_b" type="RID">
  969. </argument>
  970. <description>
  971. Creates a pin joint between two bodies. If not specified, the second body is assumed to be the joint itself.
  972. </description>
  973. </method>
  974. <method name="ray_shape_create">
  975. <return type="RID">
  976. </return>
  977. <description>
  978. </description>
  979. </method>
  980. <method name="rectangle_shape_create">
  981. <return type="RID">
  982. </return>
  983. <description>
  984. </description>
  985. </method>
  986. <method name="segment_shape_create">
  987. <return type="RID">
  988. </return>
  989. <description>
  990. </description>
  991. </method>
  992. <method name="set_active">
  993. <return type="void">
  994. </return>
  995. <argument index="0" name="active" type="bool">
  996. </argument>
  997. <description>
  998. Activates or deactivates the 2D physics engine.
  999. </description>
  1000. </method>
  1001. <method name="shape_get_data" qualifiers="const">
  1002. <return type="Variant">
  1003. </return>
  1004. <argument index="0" name="shape" type="RID">
  1005. </argument>
  1006. <description>
  1007. Returns the shape data.
  1008. </description>
  1009. </method>
  1010. <method name="shape_get_type" qualifiers="const">
  1011. <return type="int" enum="Physics2DServer.ShapeType">
  1012. </return>
  1013. <argument index="0" name="shape" type="RID">
  1014. </argument>
  1015. <description>
  1016. Returns the type of shape (see SHAPE_* constants).
  1017. </description>
  1018. </method>
  1019. <method name="shape_set_data">
  1020. <return type="void">
  1021. </return>
  1022. <argument index="0" name="shape" type="RID">
  1023. </argument>
  1024. <argument index="1" name="data" type="Variant">
  1025. </argument>
  1026. <description>
  1027. 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].
  1028. </description>
  1029. </method>
  1030. <method name="space_create">
  1031. <return type="RID">
  1032. </return>
  1033. <description>
  1034. 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].
  1035. </description>
  1036. </method>
  1037. <method name="space_get_direct_state">
  1038. <return type="Physics2DDirectSpaceState">
  1039. </return>
  1040. <argument index="0" name="space" type="RID">
  1041. </argument>
  1042. <description>
  1043. Returns the state of a space, a [Physics2DDirectSpaceState]. This object can be used to make collision/intersection queries.
  1044. </description>
  1045. </method>
  1046. <method name="space_get_param" qualifiers="const">
  1047. <return type="float">
  1048. </return>
  1049. <argument index="0" name="space" type="RID">
  1050. </argument>
  1051. <argument index="1" name="param" type="int" enum="Physics2DServer.SpaceParameter">
  1052. </argument>
  1053. <description>
  1054. Returns the value of a space parameter.
  1055. </description>
  1056. </method>
  1057. <method name="space_is_active" qualifiers="const">
  1058. <return type="bool">
  1059. </return>
  1060. <argument index="0" name="space" type="RID">
  1061. </argument>
  1062. <description>
  1063. Returns whether the space is active.
  1064. </description>
  1065. </method>
  1066. <method name="space_set_active">
  1067. <return type="void">
  1068. </return>
  1069. <argument index="0" name="space" type="RID">
  1070. </argument>
  1071. <argument index="1" name="active" type="bool">
  1072. </argument>
  1073. <description>
  1074. Marks a space as active. It will not have an effect, unless it is assigned to an area or body.
  1075. </description>
  1076. </method>
  1077. <method name="space_set_param">
  1078. <return type="void">
  1079. </return>
  1080. <argument index="0" name="space" type="RID">
  1081. </argument>
  1082. <argument index="1" name="param" type="int" enum="Physics2DServer.SpaceParameter">
  1083. </argument>
  1084. <argument index="2" name="value" type="float">
  1085. </argument>
  1086. <description>
  1087. Sets the value for a space parameter. A list of available parameters is on the SPACE_PARAM_* constants.
  1088. </description>
  1089. </method>
  1090. </methods>
  1091. <constants>
  1092. <constant name="SPACE_PARAM_CONTACT_RECYCLE_RADIUS" value="0" enum="SpaceParameter">
  1093. Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated.
  1094. </constant>
  1095. <constant name="SPACE_PARAM_CONTACT_MAX_SEPARATION" value="1" enum="SpaceParameter">
  1096. Constant to set/get the maximum distance a shape can be from another before they are considered separated.
  1097. </constant>
  1098. <constant name="SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION" value="2" enum="SpaceParameter">
  1099. Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision.
  1100. </constant>
  1101. <constant name="SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD" value="3" enum="SpaceParameter">
  1102. 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.
  1103. </constant>
  1104. <constant name="SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD" value="4" enum="SpaceParameter">
  1105. 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.
  1106. </constant>
  1107. <constant name="SPACE_PARAM_BODY_TIME_TO_SLEEP" value="5" enum="SpaceParameter">
  1108. 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.
  1109. </constant>
  1110. <constant name="SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS" value="6" enum="SpaceParameter">
  1111. 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.
  1112. </constant>
  1113. <constant name="SHAPE_LINE" value="0" enum="ShapeType">
  1114. 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.
  1115. </constant>
  1116. <constant name="SHAPE_RAY" value="1" enum="ShapeType">
  1117. </constant>
  1118. <constant name="SHAPE_SEGMENT" value="2" enum="ShapeType">
  1119. 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.
  1120. </constant>
  1121. <constant name="SHAPE_CIRCLE" value="3" enum="ShapeType">
  1122. 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.
  1123. </constant>
  1124. <constant name="SHAPE_RECTANGLE" value="4" enum="ShapeType">
  1125. 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.
  1126. </constant>
  1127. <constant name="SHAPE_CAPSULE" value="5" enum="ShapeType">
  1128. 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.
  1129. </constant>
  1130. <constant name="SHAPE_CONVEX_POLYGON" value="6" enum="ShapeType">
  1131. 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 method [method CollisionPolygon2D.set_polygon], polygons modified with [method shape_set_data] do not verify that the points supplied form is a convex polygon.
  1132. </constant>
  1133. <constant name="SHAPE_CONCAVE_POLYGON" value="7" enum="ShapeType">
  1134. 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.
  1135. </constant>
  1136. <constant name="SHAPE_CUSTOM" value="8" enum="ShapeType">
  1137. This constant is used internally by the engine. Any attempt to create this kind of shape results in an error.
  1138. </constant>
  1139. <constant name="AREA_PARAM_GRAVITY" value="0" enum="AreaParameter">
  1140. Constant to set/get gravity strength in an area.
  1141. </constant>
  1142. <constant name="AREA_PARAM_GRAVITY_VECTOR" value="1" enum="AreaParameter">
  1143. Constant to set/get gravity vector/center in an area.
  1144. </constant>
  1145. <constant name="AREA_PARAM_GRAVITY_IS_POINT" value="2" enum="AreaParameter">
  1146. Constant to set/get whether the gravity vector of an area is a direction, or a center point.
  1147. </constant>
  1148. <constant name="AREA_PARAM_GRAVITY_DISTANCE_SCALE" value="3" enum="AreaParameter">
  1149. 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.
  1150. </constant>
  1151. <constant name="AREA_PARAM_GRAVITY_POINT_ATTENUATION" value="4" enum="AreaParameter">
  1152. This constant was used to set/get the falloff factor for point gravity. It has been superseded by AREA_PARAM_GRAVITY_DISTANCE_SCALE.
  1153. </constant>
  1154. <constant name="AREA_PARAM_LINEAR_DAMP" value="5" enum="AreaParameter">
  1155. Constant to set/get the linear dampening factor of an area.
  1156. </constant>
  1157. <constant name="AREA_PARAM_ANGULAR_DAMP" value="6" enum="AreaParameter">
  1158. Constant to set/get the angular dampening factor of an area.
  1159. </constant>
  1160. <constant name="AREA_PARAM_PRIORITY" value="7" enum="AreaParameter">
  1161. Constant to set/get the priority (order of processing) of an area.
  1162. </constant>
  1163. <constant name="AREA_SPACE_OVERRIDE_DISABLED" value="0" enum="AreaSpaceOverrideMode">
  1164. This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them.
  1165. </constant>
  1166. <constant name="AREA_SPACE_OVERRIDE_COMBINE" value="1" enum="AreaSpaceOverrideMode">
  1167. 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.
  1168. </constant>
  1169. <constant name="AREA_SPACE_OVERRIDE_COMBINE_REPLACE" value="2" enum="AreaSpaceOverrideMode">
  1170. 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.
  1171. </constant>
  1172. <constant name="AREA_SPACE_OVERRIDE_REPLACE" value="3" enum="AreaSpaceOverrideMode">
  1173. This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas.
  1174. </constant>
  1175. <constant name="AREA_SPACE_OVERRIDE_REPLACE_COMBINE" value="4" enum="AreaSpaceOverrideMode">
  1176. This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one.
  1177. </constant>
  1178. <constant name="BODY_MODE_STATIC" value="0" enum="BodyMode">
  1179. Constant for static bodies.
  1180. </constant>
  1181. <constant name="BODY_MODE_KINEMATIC" value="1" enum="BodyMode">
  1182. Constant for kinematic bodies.
  1183. </constant>
  1184. <constant name="BODY_MODE_RIGID" value="2" enum="BodyMode">
  1185. Constant for rigid bodies.
  1186. </constant>
  1187. <constant name="BODY_MODE_CHARACTER" value="3" enum="BodyMode">
  1188. Constant for rigid bodies in character mode. In this mode, a body can not rotate, and only its linear velocity is affected by physics.
  1189. </constant>
  1190. <constant name="BODY_PARAM_BOUNCE" value="0" enum="BodyParameter">
  1191. Constant to set/get a body's bounce factor.
  1192. </constant>
  1193. <constant name="BODY_PARAM_FRICTION" value="1" enum="BodyParameter">
  1194. Constant to set/get a body's friction.
  1195. </constant>
  1196. <constant name="BODY_PARAM_MASS" value="2" enum="BodyParameter">
  1197. Constant to set/get a body's mass.
  1198. </constant>
  1199. <constant name="BODY_PARAM_INERTIA" value="3" enum="BodyParameter">
  1200. Constant to set/get a body's inertia.
  1201. </constant>
  1202. <constant name="BODY_PARAM_GRAVITY_SCALE" value="4" enum="BodyParameter">
  1203. Constant to set/get a body's gravity multiplier.
  1204. </constant>
  1205. <constant name="BODY_PARAM_LINEAR_DAMP" value="5" enum="BodyParameter">
  1206. Constant to set/get a body's linear dampening factor.
  1207. </constant>
  1208. <constant name="BODY_PARAM_ANGULAR_DAMP" value="6" enum="BodyParameter">
  1209. Constant to set/get a body's angular dampening factor.
  1210. </constant>
  1211. <constant name="BODY_PARAM_MAX" value="7" enum="BodyParameter">
  1212. This is the last ID for body parameters. Any attempt to set this property is ignored. Any attempt to get it returns 0.
  1213. </constant>
  1214. <constant name="BODY_STATE_TRANSFORM" value="0" enum="BodyState">
  1215. Constant to set/get the current transform matrix of the body.
  1216. </constant>
  1217. <constant name="BODY_STATE_LINEAR_VELOCITY" value="1" enum="BodyState">
  1218. Constant to set/get the current linear velocity of the body.
  1219. </constant>
  1220. <constant name="BODY_STATE_ANGULAR_VELOCITY" value="2" enum="BodyState">
  1221. Constant to set/get the current angular velocity of the body.
  1222. </constant>
  1223. <constant name="BODY_STATE_SLEEPING" value="3" enum="BodyState">
  1224. Constant to sleep/wake up a body, or to get whether it is sleeping.
  1225. </constant>
  1226. <constant name="BODY_STATE_CAN_SLEEP" value="4" enum="BodyState">
  1227. Constant to set/get whether the body can sleep.
  1228. </constant>
  1229. <constant name="JOINT_PIN" value="0" enum="JointType">
  1230. Constant to create pin joints.
  1231. </constant>
  1232. <constant name="JOINT_GROOVE" value="1" enum="JointType">
  1233. Constant to create groove joints.
  1234. </constant>
  1235. <constant name="JOINT_DAMPED_SPRING" value="2" enum="JointType">
  1236. Constant to create damped spring joints.
  1237. </constant>
  1238. <constant name="JOINT_PARAM_BIAS" value="0" enum="JointParam">
  1239. </constant>
  1240. <constant name="JOINT_PARAM_MAX_BIAS" value="1" enum="JointParam">
  1241. </constant>
  1242. <constant name="JOINT_PARAM_MAX_FORCE" value="2" enum="JointParam">
  1243. </constant>
  1244. <constant name="DAMPED_STRING_REST_LENGTH" value="0" enum="DampedStringParam">
  1245. Set the resting length of the spring joint. The joint will always try to go to back this length when pulled apart.
  1246. </constant>
  1247. <constant name="DAMPED_STRING_STIFFNESS" value="1" enum="DampedStringParam">
  1248. Set the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length.
  1249. </constant>
  1250. <constant name="DAMPED_STRING_DAMPING" value="2" enum="DampedStringParam">
  1251. Set 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).
  1252. </constant>
  1253. <constant name="CCD_MODE_DISABLED" value="0" enum="CCDMode">
  1254. Disables continuous collision detection. This is the fastest way to detect body collisions, but can miss small, fast-moving objects.
  1255. </constant>
  1256. <constant name="CCD_MODE_CAST_RAY" value="1" enum="CCDMode">
  1257. Enables continuous collision detection by raycasting. It is faster than shapecasting, but less precise.
  1258. </constant>
  1259. <constant name="CCD_MODE_CAST_SHAPE" value="2" enum="CCDMode">
  1260. Enables continuous collision detection by shapecasting. It is the slowest CCD method, and the most precise.
  1261. </constant>
  1262. <constant name="AREA_BODY_ADDED" value="0" enum="AreaBodyStatus">
  1263. The value of the first parameter and area callback function receives, when an object enters one of its shapes.
  1264. </constant>
  1265. <constant name="AREA_BODY_REMOVED" value="1" enum="AreaBodyStatus">
  1266. The value of the first parameter and area callback function receives, when an object exits one of its shapes.
  1267. </constant>
  1268. <constant name="INFO_ACTIVE_OBJECTS" value="0" enum="ProcessInfo">
  1269. Constant to get the number of objects that are not sleeping.
  1270. </constant>
  1271. <constant name="INFO_COLLISION_PAIRS" value="1" enum="ProcessInfo">
  1272. Constant to get the number of possible collisions.
  1273. </constant>
  1274. <constant name="INFO_ISLAND_COUNT" value="2" enum="ProcessInfo">
  1275. Constant to get the number of space regions where a collision could occur.
  1276. </constant>
  1277. </constants>
  1278. </class>