Physics2DServer.xml 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Physics2DServer" inherits="Object" category="Core" version="3.1.2">
  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. <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. <description>
  22. 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.
  23. </description>
  24. </method>
  25. <method name="area_attach_canvas_instance_id">
  26. <return type="void">
  27. </return>
  28. <argument index="0" name="area" type="RID">
  29. </argument>
  30. <argument index="1" name="id" type="int">
  31. </argument>
  32. <description>
  33. </description>
  34. </method>
  35. <method name="area_attach_object_instance_id">
  36. <return type="void">
  37. </return>
  38. <argument index="0" name="area" type="RID">
  39. </argument>
  40. <argument index="1" name="id" type="int">
  41. </argument>
  42. <description>
  43. Assigns the area to a descendant of [Object], so it can exist in the node tree.
  44. </description>
  45. </method>
  46. <method name="area_clear_shapes">
  47. <return type="void">
  48. </return>
  49. <argument index="0" name="area" type="RID">
  50. </argument>
  51. <description>
  52. Removes all shapes from an area. It does not delete the shapes, so they can be reassigned later.
  53. </description>
  54. </method>
  55. <method name="area_create">
  56. <return type="RID">
  57. </return>
  58. <description>
  59. Creates an [Area2D].
  60. </description>
  61. </method>
  62. <method name="area_get_canvas_instance_id" qualifiers="const">
  63. <return type="int">
  64. </return>
  65. <argument index="0" name="area" type="RID">
  66. </argument>
  67. <description>
  68. </description>
  69. </method>
  70. <method name="area_get_object_instance_id" qualifiers="const">
  71. <return type="int">
  72. </return>
  73. <argument index="0" name="area" type="RID">
  74. </argument>
  75. <description>
  76. Gets the instance ID of the object the area is assigned to.
  77. </description>
  78. </method>
  79. <method name="area_get_param" qualifiers="const">
  80. <return type="Variant">
  81. </return>
  82. <argument index="0" name="area" type="RID">
  83. </argument>
  84. <argument index="1" name="param" type="int" enum="Physics2DServer.AreaParameter">
  85. </argument>
  86. <description>
  87. Returns an area parameter value. See [enum AreaParameter] for a list of available parameters.
  88. </description>
  89. </method>
  90. <method name="area_get_shape" qualifiers="const">
  91. <return type="RID">
  92. </return>
  93. <argument index="0" name="area" type="RID">
  94. </argument>
  95. <argument index="1" name="shape_idx" type="int">
  96. </argument>
  97. <description>
  98. Returns the [RID] of the nth shape of an area.
  99. </description>
  100. </method>
  101. <method name="area_get_shape_count" qualifiers="const">
  102. <return type="int">
  103. </return>
  104. <argument index="0" name="area" type="RID">
  105. </argument>
  106. <description>
  107. Returns the number of shapes assigned to an area.
  108. </description>
  109. </method>
  110. <method name="area_get_shape_transform" qualifiers="const">
  111. <return type="Transform2D">
  112. </return>
  113. <argument index="0" name="area" type="RID">
  114. </argument>
  115. <argument index="1" name="shape_idx" type="int">
  116. </argument>
  117. <description>
  118. Returns the transform matrix of a shape within an area.
  119. </description>
  120. </method>
  121. <method name="area_get_space" qualifiers="const">
  122. <return type="RID">
  123. </return>
  124. <argument index="0" name="area" type="RID">
  125. </argument>
  126. <description>
  127. Returns the space assigned to the area.
  128. </description>
  129. </method>
  130. <method name="area_get_space_override_mode" qualifiers="const">
  131. <return type="int" enum="Physics2DServer.AreaSpaceOverrideMode">
  132. </return>
  133. <argument index="0" name="area" type="RID">
  134. </argument>
  135. <description>
  136. Returns the space override mode for the area.
  137. </description>
  138. </method>
  139. <method name="area_get_transform" qualifiers="const">
  140. <return type="Transform2D">
  141. </return>
  142. <argument index="0" name="area" type="RID">
  143. </argument>
  144. <description>
  145. Returns the transform matrix for an area.
  146. </description>
  147. </method>
  148. <method name="area_remove_shape">
  149. <return type="void">
  150. </return>
  151. <argument index="0" name="area" type="RID">
  152. </argument>
  153. <argument index="1" name="shape_idx" type="int">
  154. </argument>
  155. <description>
  156. Removes a shape from an area. It does not delete the shape, so it can be reassigned later.
  157. </description>
  158. </method>
  159. <method name="area_set_area_monitor_callback">
  160. <return type="void">
  161. </return>
  162. <argument index="0" name="area" type="RID">
  163. </argument>
  164. <argument index="1" name="receiver" type="Object">
  165. </argument>
  166. <argument index="2" name="method" type="String">
  167. </argument>
  168. <description>
  169. </description>
  170. </method>
  171. <method name="area_set_collision_layer">
  172. <return type="void">
  173. </return>
  174. <argument index="0" name="area" type="RID">
  175. </argument>
  176. <argument index="1" name="layer" type="int">
  177. </argument>
  178. <description>
  179. Assigns the area to one or many physics layers.
  180. </description>
  181. </method>
  182. <method name="area_set_collision_mask">
  183. <return type="void">
  184. </return>
  185. <argument index="0" name="area" type="RID">
  186. </argument>
  187. <argument index="1" name="mask" type="int">
  188. </argument>
  189. <description>
  190. Sets which physics layers the area will monitor.
  191. </description>
  192. </method>
  193. <method name="area_set_monitor_callback">
  194. <return type="void">
  195. </return>
  196. <argument index="0" name="area" type="RID">
  197. </argument>
  198. <argument index="1" name="receiver" type="Object">
  199. </argument>
  200. <argument index="2" name="method" type="String">
  201. </argument>
  202. <description>
  203. 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:
  204. 1: AREA_BODY_ADDED or AREA_BODY_REMOVED, depending on whether the object entered or exited the area.
  205. 2: [RID] of the object that entered/exited the area.
  206. 3: Instance ID of the object that entered/exited the area.
  207. 4: The shape index of the object that entered/exited the area.
  208. 5: The shape index of the area where the object entered/exited.
  209. </description>
  210. </method>
  211. <method name="area_set_monitorable">
  212. <return type="void">
  213. </return>
  214. <argument index="0" name="area" type="RID">
  215. </argument>
  216. <argument index="1" name="monitorable" type="bool">
  217. </argument>
  218. <description>
  219. </description>
  220. </method>
  221. <method name="area_set_param">
  222. <return type="void">
  223. </return>
  224. <argument index="0" name="area" type="RID">
  225. </argument>
  226. <argument index="1" name="param" type="int" enum="Physics2DServer.AreaParameter">
  227. </argument>
  228. <argument index="2" name="value" type="Variant">
  229. </argument>
  230. <description>
  231. Sets the value for an area parameter. See [enum AreaParameter] for a list of available parameters.
  232. </description>
  233. </method>
  234. <method name="area_set_shape">
  235. <return type="void">
  236. </return>
  237. <argument index="0" name="area" type="RID">
  238. </argument>
  239. <argument index="1" name="shape_idx" type="int">
  240. </argument>
  241. <argument index="2" name="shape" type="RID">
  242. </argument>
  243. <description>
  244. Substitutes a given area shape by another. The old shape is selected by its index, the new one by its [RID].
  245. </description>
  246. </method>
  247. <method name="area_set_shape_disabled">
  248. <return type="void">
  249. </return>
  250. <argument index="0" name="area" type="RID">
  251. </argument>
  252. <argument index="1" name="shape_idx" type="int">
  253. </argument>
  254. <argument index="2" name="disable" type="bool">
  255. </argument>
  256. <description>
  257. Disables a given shape in an area.
  258. </description>
  259. </method>
  260. <method name="area_set_shape_transform">
  261. <return type="void">
  262. </return>
  263. <argument index="0" name="area" type="RID">
  264. </argument>
  265. <argument index="1" name="shape_idx" type="int">
  266. </argument>
  267. <argument index="2" name="transform" type="Transform2D">
  268. </argument>
  269. <description>
  270. Sets the transform matrix for an area shape.
  271. </description>
  272. </method>
  273. <method name="area_set_space">
  274. <return type="void">
  275. </return>
  276. <argument index="0" name="area" type="RID">
  277. </argument>
  278. <argument index="1" name="space" type="RID">
  279. </argument>
  280. <description>
  281. Assigns a space to the area.
  282. </description>
  283. </method>
  284. <method name="area_set_space_override_mode">
  285. <return type="void">
  286. </return>
  287. <argument index="0" name="area" type="RID">
  288. </argument>
  289. <argument index="1" name="mode" type="int" enum="Physics2DServer.AreaSpaceOverrideMode">
  290. </argument>
  291. <description>
  292. Sets the space override mode for the area. See [enum AreaSpaceOverrideMode] for a list of available modes.
  293. </description>
  294. </method>
  295. <method name="area_set_transform">
  296. <return type="void">
  297. </return>
  298. <argument index="0" name="area" type="RID">
  299. </argument>
  300. <argument index="1" name="transform" type="Transform2D">
  301. </argument>
  302. <description>
  303. Sets the transform matrix for an area.
  304. </description>
  305. </method>
  306. <method name="body_add_central_force">
  307. <return type="void">
  308. </return>
  309. <argument index="0" name="body" type="RID">
  310. </argument>
  311. <argument index="1" name="force" type="Vector2">
  312. </argument>
  313. <description>
  314. </description>
  315. </method>
  316. <method name="body_add_collision_exception">
  317. <return type="void">
  318. </return>
  319. <argument index="0" name="body" type="RID">
  320. </argument>
  321. <argument index="1" name="excepted_body" type="RID">
  322. </argument>
  323. <description>
  324. Adds a body to the list of bodies exempt from collisions.
  325. </description>
  326. </method>
  327. <method name="body_add_force">
  328. <return type="void">
  329. </return>
  330. <argument index="0" name="body" type="RID">
  331. </argument>
  332. <argument index="1" name="offset" type="Vector2">
  333. </argument>
  334. <argument index="2" name="force" type="Vector2">
  335. </argument>
  336. <description>
  337. 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.
  338. </description>
  339. </method>
  340. <method name="body_add_shape">
  341. <return type="void">
  342. </return>
  343. <argument index="0" name="body" type="RID">
  344. </argument>
  345. <argument index="1" name="shape" type="RID">
  346. </argument>
  347. <argument index="2" name="transform" type="Transform2D" default="Transform2D( 1, 0, 0, 1, 0, 0 )">
  348. </argument>
  349. <description>
  350. 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.
  351. </description>
  352. </method>
  353. <method name="body_add_torque">
  354. <return type="void">
  355. </return>
  356. <argument index="0" name="body" type="RID">
  357. </argument>
  358. <argument index="1" name="torque" type="float">
  359. </argument>
  360. <description>
  361. </description>
  362. </method>
  363. <method name="body_apply_central_impulse">
  364. <return type="void">
  365. </return>
  366. <argument index="0" name="body" type="RID">
  367. </argument>
  368. <argument index="1" name="impulse" type="Vector2">
  369. </argument>
  370. <description>
  371. </description>
  372. </method>
  373. <method name="body_apply_impulse">
  374. <return type="void">
  375. </return>
  376. <argument index="0" name="body" type="RID">
  377. </argument>
  378. <argument index="1" name="position" type="Vector2">
  379. </argument>
  380. <argument index="2" name="impulse" type="Vector2">
  381. </argument>
  382. <description>
  383. Adds a positioned impulse to the applied force and torque. Both the force and the offset from the body origin are in global coordinates.
  384. </description>
  385. </method>
  386. <method name="body_apply_torque_impulse">
  387. <return type="void">
  388. </return>
  389. <argument index="0" name="body" type="RID">
  390. </argument>
  391. <argument index="1" name="impulse" type="float">
  392. </argument>
  393. <description>
  394. </description>
  395. </method>
  396. <method name="body_attach_canvas_instance_id">
  397. <return type="void">
  398. </return>
  399. <argument index="0" name="body" type="RID">
  400. </argument>
  401. <argument index="1" name="id" type="int">
  402. </argument>
  403. <description>
  404. </description>
  405. </method>
  406. <method name="body_attach_object_instance_id">
  407. <return type="void">
  408. </return>
  409. <argument index="0" name="body" type="RID">
  410. </argument>
  411. <argument index="1" name="id" type="int">
  412. </argument>
  413. <description>
  414. Assigns the area to a descendant of [Object], so it can exist in the node tree.
  415. </description>
  416. </method>
  417. <method name="body_clear_shapes">
  418. <return type="void">
  419. </return>
  420. <argument index="0" name="body" type="RID">
  421. </argument>
  422. <description>
  423. Removes all shapes from a body.
  424. </description>
  425. </method>
  426. <method name="body_create">
  427. <return type="RID">
  428. </return>
  429. <description>
  430. Creates a physics body.
  431. </description>
  432. </method>
  433. <method name="body_get_canvas_instance_id" qualifiers="const">
  434. <return type="int">
  435. </return>
  436. <argument index="0" name="body" type="RID">
  437. </argument>
  438. <description>
  439. </description>
  440. </method>
  441. <method name="body_get_collision_layer" qualifiers="const">
  442. <return type="int">
  443. </return>
  444. <argument index="0" name="body" type="RID">
  445. </argument>
  446. <description>
  447. Returns the physics layer or layers a body belongs to.
  448. </description>
  449. </method>
  450. <method name="body_get_collision_mask" qualifiers="const">
  451. <return type="int">
  452. </return>
  453. <argument index="0" name="body" type="RID">
  454. </argument>
  455. <description>
  456. Returns the physics layer or layers a body can collide with.
  457. </description>
  458. </method>
  459. <method name="body_get_continuous_collision_detection_mode" qualifiers="const">
  460. <return type="int" enum="Physics2DServer.CCDMode">
  461. </return>
  462. <argument index="0" name="body" type="RID">
  463. </argument>
  464. <description>
  465. Returns the continuous collision detection mode.
  466. </description>
  467. </method>
  468. <method name="body_get_direct_state">
  469. <return type="Physics2DDirectBodyState">
  470. </return>
  471. <argument index="0" name="body" type="RID">
  472. </argument>
  473. <description>
  474. Returns the [Physics2DDirectBodyState] of the body.
  475. </description>
  476. </method>
  477. <method name="body_get_max_contacts_reported" qualifiers="const">
  478. <return type="int">
  479. </return>
  480. <argument index="0" name="body" type="RID">
  481. </argument>
  482. <description>
  483. Returns the maximum contacts that can be reported. See [method body_set_max_contacts_reported].
  484. </description>
  485. </method>
  486. <method name="body_get_mode" qualifiers="const">
  487. <return type="int" enum="Physics2DServer.BodyMode">
  488. </return>
  489. <argument index="0" name="body" type="RID">
  490. </argument>
  491. <description>
  492. Returns the body mode.
  493. </description>
  494. </method>
  495. <method name="body_get_object_instance_id" qualifiers="const">
  496. <return type="int">
  497. </return>
  498. <argument index="0" name="body" type="RID">
  499. </argument>
  500. <description>
  501. Gets the instance ID of the object the area is assigned to.
  502. </description>
  503. </method>
  504. <method name="body_get_param" qualifiers="const">
  505. <return type="float">
  506. </return>
  507. <argument index="0" name="body" type="RID">
  508. </argument>
  509. <argument index="1" name="param" type="int" enum="Physics2DServer.BodyParameter">
  510. </argument>
  511. <description>
  512. Returns the value of a body parameter. See [enum BodyParameter] for a list of available parameters.
  513. </description>
  514. </method>
  515. <method name="body_get_shape" qualifiers="const">
  516. <return type="RID">
  517. </return>
  518. <argument index="0" name="body" type="RID">
  519. </argument>
  520. <argument index="1" name="shape_idx" type="int">
  521. </argument>
  522. <description>
  523. Returns the [RID] of the nth shape of a body.
  524. </description>
  525. </method>
  526. <method name="body_get_shape_count" qualifiers="const">
  527. <return type="int">
  528. </return>
  529. <argument index="0" name="body" type="RID">
  530. </argument>
  531. <description>
  532. Returns the number of shapes assigned to a body.
  533. </description>
  534. </method>
  535. <method name="body_get_shape_metadata" qualifiers="const">
  536. <return type="Variant">
  537. </return>
  538. <argument index="0" name="body" type="RID">
  539. </argument>
  540. <argument index="1" name="shape_idx" type="int">
  541. </argument>
  542. <description>
  543. Returns the metadata of a shape of a body.
  544. </description>
  545. </method>
  546. <method name="body_get_shape_transform" qualifiers="const">
  547. <return type="Transform2D">
  548. </return>
  549. <argument index="0" name="body" type="RID">
  550. </argument>
  551. <argument index="1" name="shape_idx" type="int">
  552. </argument>
  553. <description>
  554. Returns the transform matrix of a body shape.
  555. </description>
  556. </method>
  557. <method name="body_get_space" qualifiers="const">
  558. <return type="RID">
  559. </return>
  560. <argument index="0" name="body" type="RID">
  561. </argument>
  562. <description>
  563. Returns the [RID] of the space assigned to a body.
  564. </description>
  565. </method>
  566. <method name="body_get_state" qualifiers="const">
  567. <return type="Variant">
  568. </return>
  569. <argument index="0" name="body" type="RID">
  570. </argument>
  571. <argument index="1" name="state" type="int" enum="Physics2DServer.BodyState">
  572. </argument>
  573. <description>
  574. Returns a body state.
  575. </description>
  576. </method>
  577. <method name="body_is_omitting_force_integration" qualifiers="const">
  578. <return type="bool">
  579. </return>
  580. <argument index="0" name="body" type="RID">
  581. </argument>
  582. <description>
  583. Returns whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]).
  584. </description>
  585. </method>
  586. <method name="body_remove_collision_exception">
  587. <return type="void">
  588. </return>
  589. <argument index="0" name="body" type="RID">
  590. </argument>
  591. <argument index="1" name="excepted_body" type="RID">
  592. </argument>
  593. <description>
  594. Removes a body from the list of bodies exempt from collisions.
  595. </description>
  596. </method>
  597. <method name="body_remove_shape">
  598. <return type="void">
  599. </return>
  600. <argument index="0" name="body" type="RID">
  601. </argument>
  602. <argument index="1" name="shape_idx" type="int">
  603. </argument>
  604. <description>
  605. Removes a shape from a body. The shape is not deleted, so it can be reused afterwards.
  606. </description>
  607. </method>
  608. <method name="body_set_axis_velocity">
  609. <return type="void">
  610. </return>
  611. <argument index="0" name="body" type="RID">
  612. </argument>
  613. <argument index="1" name="axis_velocity" type="Vector2">
  614. </argument>
  615. <description>
  616. 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.
  617. </description>
  618. </method>
  619. <method name="body_set_collision_layer">
  620. <return type="void">
  621. </return>
  622. <argument index="0" name="body" type="RID">
  623. </argument>
  624. <argument index="1" name="layer" type="int">
  625. </argument>
  626. <description>
  627. Sets the physics layer or layers a body belongs to.
  628. </description>
  629. </method>
  630. <method name="body_set_collision_mask">
  631. <return type="void">
  632. </return>
  633. <argument index="0" name="body" type="RID">
  634. </argument>
  635. <argument index="1" name="mask" type="int">
  636. </argument>
  637. <description>
  638. Sets the physics layer or layers a body can collide with.
  639. </description>
  640. </method>
  641. <method name="body_set_continuous_collision_detection_mode">
  642. <return type="void">
  643. </return>
  644. <argument index="0" name="body" type="RID">
  645. </argument>
  646. <argument index="1" name="mode" type="int" enum="Physics2DServer.CCDMode">
  647. </argument>
  648. <description>
  649. Sets the continuous collision detection mode using one of the [enum CCDMode] constants.
  650. Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided.
  651. </description>
  652. </method>
  653. <method name="body_set_force_integration_callback">
  654. <return type="void">
  655. </return>
  656. <argument index="0" name="body" type="RID">
  657. </argument>
  658. <argument index="1" name="receiver" type="Object">
  659. </argument>
  660. <argument index="2" name="method" type="String">
  661. </argument>
  662. <argument index="3" name="userdata" type="Variant" default="null">
  663. </argument>
  664. <description>
  665. Sets the function used to calculate physics for an object, if that object allows it (see [method body_set_omit_force_integration]).
  666. </description>
  667. </method>
  668. <method name="body_set_max_contacts_reported">
  669. <return type="void">
  670. </return>
  671. <argument index="0" name="body" type="RID">
  672. </argument>
  673. <argument index="1" name="amount" type="int">
  674. </argument>
  675. <description>
  676. 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.
  677. </description>
  678. </method>
  679. <method name="body_set_mode">
  680. <return type="void">
  681. </return>
  682. <argument index="0" name="body" type="RID">
  683. </argument>
  684. <argument index="1" name="mode" type="int" enum="Physics2DServer.BodyMode">
  685. </argument>
  686. <description>
  687. Sets the body mode using one of the [enum BodyMode] constants.
  688. </description>
  689. </method>
  690. <method name="body_set_omit_force_integration">
  691. <return type="void">
  692. </return>
  693. <argument index="0" name="body" type="RID">
  694. </argument>
  695. <argument index="1" name="enable" type="bool">
  696. </argument>
  697. <description>
  698. Sets whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]).
  699. </description>
  700. </method>
  701. <method name="body_set_param">
  702. <return type="void">
  703. </return>
  704. <argument index="0" name="body" type="RID">
  705. </argument>
  706. <argument index="1" name="param" type="int" enum="Physics2DServer.BodyParameter">
  707. </argument>
  708. <argument index="2" name="value" type="float">
  709. </argument>
  710. <description>
  711. Sets a body parameter. See [enum BodyParameter] for a list of available parameters.
  712. </description>
  713. </method>
  714. <method name="body_set_shape">
  715. <return type="void">
  716. </return>
  717. <argument index="0" name="body" type="RID">
  718. </argument>
  719. <argument index="1" name="shape_idx" type="int">
  720. </argument>
  721. <argument index="2" name="shape" type="RID">
  722. </argument>
  723. <description>
  724. Substitutes a given body shape by another. The old shape is selected by its index, the new one by its [RID].
  725. </description>
  726. </method>
  727. <method name="body_set_shape_as_one_way_collision">
  728. <return type="void">
  729. </return>
  730. <argument index="0" name="body" type="RID">
  731. </argument>
  732. <argument index="1" name="shape_idx" type="int">
  733. </argument>
  734. <argument index="2" name="enable" type="bool">
  735. </argument>
  736. <argument index="3" name="margin" type="float">
  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 using one of the [enum BodyState] 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. See [enum DampedStringParam] for a list of available parameters.
  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. See [enum ProcessInfo] for a list of available states.
  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 bodies 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 [enum JointType]).
  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. See [enum JointParam] for a list of available parameters.
  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 [enum ShapeType]).
  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. See [enum SpaceParameter] for a list of available parameters.
  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="SPACE_PARAM_TEST_MOTION_MIN_CONTACT_DEPTH" value="7" enum="SpaceParameter">
  1114. </constant>
  1115. <constant name="SHAPE_LINE" value="0" enum="ShapeType">
  1116. 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.
  1117. </constant>
  1118. <constant name="SHAPE_RAY" value="1" enum="ShapeType">
  1119. </constant>
  1120. <constant name="SHAPE_SEGMENT" value="2" enum="ShapeType">
  1121. 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.
  1122. </constant>
  1123. <constant name="SHAPE_CIRCLE" value="3" enum="ShapeType">
  1124. 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.
  1125. </constant>
  1126. <constant name="SHAPE_RECTANGLE" value="4" enum="ShapeType">
  1127. 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.
  1128. </constant>
  1129. <constant name="SHAPE_CAPSULE" value="5" enum="ShapeType">
  1130. 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.
  1131. </constant>
  1132. <constant name="SHAPE_CONVEX_POLYGON" value="6" enum="ShapeType">
  1133. 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.
  1134. </constant>
  1135. <constant name="SHAPE_CONCAVE_POLYGON" value="7" enum="ShapeType">
  1136. 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.
  1137. </constant>
  1138. <constant name="SHAPE_CUSTOM" value="8" enum="ShapeType">
  1139. This constant is used internally by the engine. Any attempt to create this kind of shape results in an error.
  1140. </constant>
  1141. <constant name="AREA_PARAM_GRAVITY" value="0" enum="AreaParameter">
  1142. Constant to set/get gravity strength in an area.
  1143. </constant>
  1144. <constant name="AREA_PARAM_GRAVITY_VECTOR" value="1" enum="AreaParameter">
  1145. Constant to set/get gravity vector/center in an area.
  1146. </constant>
  1147. <constant name="AREA_PARAM_GRAVITY_IS_POINT" value="2" enum="AreaParameter">
  1148. Constant to set/get whether the gravity vector of an area is a direction, or a center point.
  1149. </constant>
  1150. <constant name="AREA_PARAM_GRAVITY_DISTANCE_SCALE" value="3" enum="AreaParameter">
  1151. 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.
  1152. </constant>
  1153. <constant name="AREA_PARAM_GRAVITY_POINT_ATTENUATION" value="4" enum="AreaParameter">
  1154. This constant was used to set/get the falloff factor for point gravity. It has been superseded by AREA_PARAM_GRAVITY_DISTANCE_SCALE.
  1155. </constant>
  1156. <constant name="AREA_PARAM_LINEAR_DAMP" value="5" enum="AreaParameter">
  1157. Constant to set/get the linear dampening factor of an area.
  1158. </constant>
  1159. <constant name="AREA_PARAM_ANGULAR_DAMP" value="6" enum="AreaParameter">
  1160. Constant to set/get the angular dampening factor of an area.
  1161. </constant>
  1162. <constant name="AREA_PARAM_PRIORITY" value="7" enum="AreaParameter">
  1163. Constant to set/get the priority (order of processing) of an area.
  1164. </constant>
  1165. <constant name="AREA_SPACE_OVERRIDE_DISABLED" value="0" enum="AreaSpaceOverrideMode">
  1166. This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them.
  1167. </constant>
  1168. <constant name="AREA_SPACE_OVERRIDE_COMBINE" value="1" enum="AreaSpaceOverrideMode">
  1169. 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.
  1170. </constant>
  1171. <constant name="AREA_SPACE_OVERRIDE_COMBINE_REPLACE" value="2" enum="AreaSpaceOverrideMode">
  1172. 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.
  1173. </constant>
  1174. <constant name="AREA_SPACE_OVERRIDE_REPLACE" value="3" enum="AreaSpaceOverrideMode">
  1175. This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas.
  1176. </constant>
  1177. <constant name="AREA_SPACE_OVERRIDE_REPLACE_COMBINE" value="4" enum="AreaSpaceOverrideMode">
  1178. This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one.
  1179. </constant>
  1180. <constant name="BODY_MODE_STATIC" value="0" enum="BodyMode">
  1181. Constant for static bodies.
  1182. </constant>
  1183. <constant name="BODY_MODE_KINEMATIC" value="1" enum="BodyMode">
  1184. Constant for kinematic bodies.
  1185. </constant>
  1186. <constant name="BODY_MODE_RIGID" value="2" enum="BodyMode">
  1187. Constant for rigid bodies.
  1188. </constant>
  1189. <constant name="BODY_MODE_CHARACTER" value="3" enum="BodyMode">
  1190. Constant for rigid bodies in character mode. In this mode, a body can not rotate, and only its linear velocity is affected by physics.
  1191. </constant>
  1192. <constant name="BODY_PARAM_BOUNCE" value="0" enum="BodyParameter">
  1193. Constant to set/get a body's bounce factor.
  1194. </constant>
  1195. <constant name="BODY_PARAM_FRICTION" value="1" enum="BodyParameter">
  1196. Constant to set/get a body's friction.
  1197. </constant>
  1198. <constant name="BODY_PARAM_MASS" value="2" enum="BodyParameter">
  1199. Constant to set/get a body's mass.
  1200. </constant>
  1201. <constant name="BODY_PARAM_INERTIA" value="3" enum="BodyParameter">
  1202. Constant to set/get a body's inertia.
  1203. </constant>
  1204. <constant name="BODY_PARAM_GRAVITY_SCALE" value="4" enum="BodyParameter">
  1205. Constant to set/get a body's gravity multiplier.
  1206. </constant>
  1207. <constant name="BODY_PARAM_LINEAR_DAMP" value="5" enum="BodyParameter">
  1208. Constant to set/get a body's linear dampening factor.
  1209. </constant>
  1210. <constant name="BODY_PARAM_ANGULAR_DAMP" value="6" enum="BodyParameter">
  1211. Constant to set/get a body's angular dampening factor.
  1212. </constant>
  1213. <constant name="BODY_PARAM_MAX" value="7" enum="BodyParameter">
  1214. Represents the size of the [enum BodyParameter] enum.
  1215. </constant>
  1216. <constant name="BODY_STATE_TRANSFORM" value="0" enum="BodyState">
  1217. Constant to set/get the current transform matrix of the body.
  1218. </constant>
  1219. <constant name="BODY_STATE_LINEAR_VELOCITY" value="1" enum="BodyState">
  1220. Constant to set/get the current linear velocity of the body.
  1221. </constant>
  1222. <constant name="BODY_STATE_ANGULAR_VELOCITY" value="2" enum="BodyState">
  1223. Constant to set/get the current angular velocity of the body.
  1224. </constant>
  1225. <constant name="BODY_STATE_SLEEPING" value="3" enum="BodyState">
  1226. Constant to sleep/wake up a body, or to get whether it is sleeping.
  1227. </constant>
  1228. <constant name="BODY_STATE_CAN_SLEEP" value="4" enum="BodyState">
  1229. Constant to set/get whether the body can sleep.
  1230. </constant>
  1231. <constant name="JOINT_PIN" value="0" enum="JointType">
  1232. Constant to create pin joints.
  1233. </constant>
  1234. <constant name="JOINT_GROOVE" value="1" enum="JointType">
  1235. Constant to create groove joints.
  1236. </constant>
  1237. <constant name="JOINT_DAMPED_SPRING" value="2" enum="JointType">
  1238. Constant to create damped spring joints.
  1239. </constant>
  1240. <constant name="JOINT_PARAM_BIAS" value="0" enum="JointParam">
  1241. </constant>
  1242. <constant name="JOINT_PARAM_MAX_BIAS" value="1" enum="JointParam">
  1243. </constant>
  1244. <constant name="JOINT_PARAM_MAX_FORCE" value="2" enum="JointParam">
  1245. </constant>
  1246. <constant name="DAMPED_STRING_REST_LENGTH" value="0" enum="DampedStringParam">
  1247. Set the resting length of the spring joint. The joint will always try to go to back this length when pulled apart.
  1248. </constant>
  1249. <constant name="DAMPED_STRING_STIFFNESS" value="1" enum="DampedStringParam">
  1250. Set the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length.
  1251. </constant>
  1252. <constant name="DAMPED_STRING_DAMPING" value="2" enum="DampedStringParam">
  1253. 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).
  1254. </constant>
  1255. <constant name="CCD_MODE_DISABLED" value="0" enum="CCDMode">
  1256. Disables continuous collision detection. This is the fastest way to detect body collisions, but can miss small, fast-moving objects.
  1257. </constant>
  1258. <constant name="CCD_MODE_CAST_RAY" value="1" enum="CCDMode">
  1259. Enables continuous collision detection by raycasting. It is faster than shapecasting, but less precise.
  1260. </constant>
  1261. <constant name="CCD_MODE_CAST_SHAPE" value="2" enum="CCDMode">
  1262. Enables continuous collision detection by shapecasting. It is the slowest CCD method, and the most precise.
  1263. </constant>
  1264. <constant name="AREA_BODY_ADDED" value="0" enum="AreaBodyStatus">
  1265. The value of the first parameter and area callback function receives, when an object enters one of its shapes.
  1266. </constant>
  1267. <constant name="AREA_BODY_REMOVED" value="1" enum="AreaBodyStatus">
  1268. The value of the first parameter and area callback function receives, when an object exits one of its shapes.
  1269. </constant>
  1270. <constant name="INFO_ACTIVE_OBJECTS" value="0" enum="ProcessInfo">
  1271. Constant to get the number of objects that are not sleeping.
  1272. </constant>
  1273. <constant name="INFO_COLLISION_PAIRS" value="1" enum="ProcessInfo">
  1274. Constant to get the number of possible collisions.
  1275. </constant>
  1276. <constant name="INFO_ISLAND_COUNT" value="2" enum="ProcessInfo">
  1277. Constant to get the number of space regions where a collision could occur.
  1278. </constant>
  1279. </constants>
  1280. </class>