mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
602 lines
76 KiB
ReStructuredText
602 lines
76 KiB
ReStructuredText
.. _class_Physics2DServer:
|
|
|
|
Physics2DServer
|
|
===============
|
|
|
|
**Inherits:** :ref:`Object<class_object>`
|
|
|
|
**Inherited By:** :ref:`Physics2DServerSW<class_physics2dserversw>`
|
|
|
|
**Category:** Core
|
|
|
|
Brief Description
|
|
-----------------
|
|
|
|
Physics 2D Server.
|
|
|
|
Member Functions
|
|
----------------
|
|
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_rid>` | :ref:`shape_create<class_Physics2DServer_shape_create>` **(** :ref:`int<class_int>` type **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`shape_set_data<class_Physics2DServer_shape_set_data>` **(** :ref:`RID<class_rid>` shape, var data **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`shape_get_type<class_Physics2DServer_shape_get_type>` **(** :ref:`RID<class_rid>` shape **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`shape_get_data<class_Physics2DServer_shape_get_data>` **(** :ref:`RID<class_rid>` shape **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_rid>` | :ref:`space_create<class_Physics2DServer_space_create>` **(** **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`space_set_active<class_Physics2DServer_space_set_active>` **(** :ref:`RID<class_rid>` space, :ref:`bool<class_bool>` active **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`space_is_active<class_Physics2DServer_space_is_active>` **(** :ref:`RID<class_rid>` space **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`space_set_param<class_Physics2DServer_space_set_param>` **(** :ref:`RID<class_rid>` space, :ref:`int<class_int>` param, :ref:`float<class_float>` value **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`space_get_param<class_Physics2DServer_space_get_param>` **(** :ref:`RID<class_rid>` space, :ref:`int<class_int>` param **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Physics2DDirectSpaceState<class_physics2ddirectspacestate>` | :ref:`space_get_direct_state<class_Physics2DServer_space_get_direct_state>` **(** :ref:`RID<class_rid>` space **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_rid>` | :ref:`area_create<class_Physics2DServer_area_create>` **(** **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`area_set_space<class_Physics2DServer_area_set_space>` **(** :ref:`RID<class_rid>` area, :ref:`RID<class_rid>` space **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_rid>` | :ref:`area_get_space<class_Physics2DServer_area_get_space>` **(** :ref:`RID<class_rid>` area **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`area_set_space_override_mode<class_Physics2DServer_area_set_space_override_mode>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` mode **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`area_get_space_override_mode<class_Physics2DServer_area_get_space_override_mode>` **(** :ref:`RID<class_rid>` area **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`area_add_shape<class_Physics2DServer_area_add_shape>` **(** :ref:`RID<class_rid>` area, :ref:`RID<class_rid>` shape, :ref:`Matrix32<class_matrix32>` transform=1,0, 0,1, 0,0 **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`area_set_shape<class_Physics2DServer_area_set_shape>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx, :ref:`RID<class_rid>` shape **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`area_set_shape_transform<class_Physics2DServer_area_set_shape_transform>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx, :ref:`Matrix32<class_matrix32>` transform **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`area_get_shape_count<class_Physics2DServer_area_get_shape_count>` **(** :ref:`RID<class_rid>` area **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_rid>` | :ref:`area_get_shape<class_Physics2DServer_area_get_shape>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Matrix32<class_matrix32>` | :ref:`area_get_shape_transform<class_Physics2DServer_area_get_shape_transform>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`area_remove_shape<class_Physics2DServer_area_remove_shape>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`area_clear_shapes<class_Physics2DServer_area_clear_shapes>` **(** :ref:`RID<class_rid>` area **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`area_set_layer_mask<class_Physics2DServer_area_set_layer_mask>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` mask **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`area_set_collision_mask<class_Physics2DServer_area_set_collision_mask>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` mask **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`area_set_param<class_Physics2DServer_area_set_param>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` param, var value **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`area_set_transform<class_Physics2DServer_area_set_transform>` **(** :ref:`RID<class_rid>` area, :ref:`Matrix32<class_matrix32>` transform **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`area_get_param<class_Physics2DServer_area_get_param>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` param **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Matrix32<class_matrix32>` | :ref:`area_get_transform<class_Physics2DServer_area_get_transform>` **(** :ref:`RID<class_rid>` area **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`area_attach_object_instance_ID<class_Physics2DServer_area_attach_object_instance_ID>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` id **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`area_get_object_instance_ID<class_Physics2DServer_area_get_object_instance_ID>` **(** :ref:`RID<class_rid>` area **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`area_set_monitor_callback<class_Physics2DServer_area_set_monitor_callback>` **(** :ref:`RID<class_rid>` area, :ref:`Object<class_object>` receiver, :ref:`String<class_string>` method **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_rid>` | :ref:`body_create<class_Physics2DServer_body_create>` **(** :ref:`int<class_int>` mode=2, :ref:`bool<class_bool>` init_sleeping=false **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_space<class_Physics2DServer_body_set_space>` **(** :ref:`RID<class_rid>` body, :ref:`RID<class_rid>` space **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_rid>` | :ref:`body_get_space<class_Physics2DServer_body_get_space>` **(** :ref:`RID<class_rid>` body **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_mode<class_Physics2DServer_body_set_mode>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` mode **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`body_get_mode<class_Physics2DServer_body_get_mode>` **(** :ref:`RID<class_rid>` body **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_add_shape<class_Physics2DServer_body_add_shape>` **(** :ref:`RID<class_rid>` body, :ref:`RID<class_rid>` shape, :ref:`Matrix32<class_matrix32>` transform=1,0, 0,1, 0,0 **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_shape<class_Physics2DServer_body_set_shape>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx, :ref:`RID<class_rid>` shape **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_shape_transform<class_Physics2DServer_body_set_shape_transform>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx, :ref:`Matrix32<class_matrix32>` transform **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_shape_metadata<class_Physics2DServer_body_set_shape_metadata>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx, var metadata **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`body_get_shape_count<class_Physics2DServer_body_get_shape_count>` **(** :ref:`RID<class_rid>` body **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_rid>` | :ref:`body_get_shape<class_Physics2DServer_body_get_shape>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Matrix32<class_matrix32>` | :ref:`body_get_shape_transform<class_Physics2DServer_body_get_shape_transform>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_get_shape_metadata<class_Physics2DServer_body_get_shape_metadata>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_remove_shape<class_Physics2DServer_body_remove_shape>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_clear_shapes<class_Physics2DServer_body_clear_shapes>` **(** :ref:`RID<class_rid>` body **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_shape_as_trigger<class_Physics2DServer_body_set_shape_as_trigger>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx, :ref:`bool<class_bool>` enable **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`body_is_shape_set_as_trigger<class_Physics2DServer_body_is_shape_set_as_trigger>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_attach_object_instance_ID<class_Physics2DServer_body_attach_object_instance_ID>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` id **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`body_get_object_instance_ID<class_Physics2DServer_body_get_object_instance_ID>` **(** :ref:`RID<class_rid>` body **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_continuous_collision_detection_mode<class_Physics2DServer_body_set_continuous_collision_detection_mode>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` mode **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`body_get_continuous_collision_detection_mode<class_Physics2DServer_body_get_continuous_collision_detection_mode>` **(** :ref:`RID<class_rid>` body **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_layer_mask<class_Physics2DServer_body_set_layer_mask>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` mask **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`body_get_layer_mask<class_Physics2DServer_body_get_layer_mask>` **(** :ref:`RID<class_rid>` body **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_collision_mask<class_Physics2DServer_body_set_collision_mask>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` mask **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`body_get_collision_mask<class_Physics2DServer_body_get_collision_mask>` **(** :ref:`RID<class_rid>` body **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_param<class_Physics2DServer_body_set_param>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` param, :ref:`float<class_float>` value **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`body_get_param<class_Physics2DServer_body_get_param>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` param **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_state<class_Physics2DServer_body_set_state>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` state, var value **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_get_state<class_Physics2DServer_body_get_state>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` state **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_apply_impulse<class_Physics2DServer_body_apply_impulse>` **(** :ref:`RID<class_rid>` body, :ref:`Vector2<class_vector2>` pos, :ref:`Vector2<class_vector2>` impulse **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_axis_velocity<class_Physics2DServer_body_set_axis_velocity>` **(** :ref:`RID<class_rid>` body, :ref:`Vector2<class_vector2>` axis_velocity **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_add_collision_exception<class_Physics2DServer_body_add_collision_exception>` **(** :ref:`RID<class_rid>` body, :ref:`RID<class_rid>` excepted_body **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_remove_collision_exception<class_Physics2DServer_body_remove_collision_exception>` **(** :ref:`RID<class_rid>` body, :ref:`RID<class_rid>` excepted_body **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_max_contacts_reported<class_Physics2DServer_body_set_max_contacts_reported>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` amount **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`body_get_max_contacts_reported<class_Physics2DServer_body_get_max_contacts_reported>` **(** :ref:`RID<class_rid>` body **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_one_way_collision_direction<class_Physics2DServer_body_set_one_way_collision_direction>` **(** :ref:`RID<class_rid>` body, :ref:`Vector2<class_vector2>` normal **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_vector2>` | :ref:`body_get_one_way_collision_direction<class_Physics2DServer_body_get_one_way_collision_direction>` **(** :ref:`RID<class_rid>` body **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_one_way_collision_max_depth<class_Physics2DServer_body_set_one_way_collision_max_depth>` **(** :ref:`RID<class_rid>` body, :ref:`float<class_float>` depth **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`body_get_one_way_collision_max_depth<class_Physics2DServer_body_get_one_way_collision_max_depth>` **(** :ref:`RID<class_rid>` body **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_omit_force_integration<class_Physics2DServer_body_set_omit_force_integration>` **(** :ref:`RID<class_rid>` body, :ref:`bool<class_bool>` enable **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`body_is_omitting_force_integration<class_Physics2DServer_body_is_omitting_force_integration>` **(** :ref:`RID<class_rid>` body **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`body_set_force_integration_callback<class_Physics2DServer_body_set_force_integration_callback>` **(** :ref:`RID<class_rid>` body, :ref:`Object<class_object>` receiver, :ref:`String<class_string>` method, var userdata=NULL **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`body_test_motion<class_Physics2DServer_body_test_motion>` **(** :ref:`RID<class_rid>` body, :ref:`Vector2<class_vector2>` motion, :ref:`float<class_float>` margin=0.08, :ref:`Physics2DTestMotionResult<class_physics2dtestmotionresult>` result=NULL **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`joint_set_param<class_Physics2DServer_joint_set_param>` **(** :ref:`RID<class_rid>` joint, :ref:`int<class_int>` param, :ref:`float<class_float>` value **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`joint_get_param<class_Physics2DServer_joint_get_param>` **(** :ref:`RID<class_rid>` joint, :ref:`int<class_int>` param **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_rid>` | :ref:`pin_joint_create<class_Physics2DServer_pin_joint_create>` **(** :ref:`Vector2<class_vector2>` anchor, :ref:`RID<class_rid>` body_a, :ref:`RID<class_rid>` body_b=RID() **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_rid>` | :ref:`groove_joint_create<class_Physics2DServer_groove_joint_create>` **(** :ref:`Vector2<class_vector2>` groove1_a, :ref:`Vector2<class_vector2>` groove2_a, :ref:`Vector2<class_vector2>` anchor_b, :ref:`RID<class_rid>` body_a=RID(), :ref:`RID<class_rid>` body_b=RID() **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_rid>` | :ref:`damped_spring_joint_create<class_Physics2DServer_damped_spring_joint_create>` **(** :ref:`Vector2<class_vector2>` anchor_a, :ref:`Vector2<class_vector2>` anchor_b, :ref:`RID<class_rid>` body_a, :ref:`RID<class_rid>` body_b=RID() **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`damped_string_joint_set_param<class_Physics2DServer_damped_string_joint_set_param>` **(** :ref:`RID<class_rid>` joint, :ref:`int<class_int>` param, :ref:`float<class_float>` value=RID() **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`damped_string_joint_get_param<class_Physics2DServer_damped_string_joint_get_param>` **(** :ref:`RID<class_rid>` joint, :ref:`int<class_int>` param **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`joint_get_type<class_Physics2DServer_joint_get_type>` **(** :ref:`RID<class_rid>` joint **)** const |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`free_rid<class_Physics2DServer_free_rid>` **(** :ref:`RID<class_rid>` rid **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_active<class_Physics2DServer_set_active>` **(** :ref:`bool<class_bool>` active **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_process_info<class_Physics2DServer_get_process_info>` **(** :ref:`int<class_int>` process_info **)** |
|
|
+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Numeric Constants
|
|
-----------------
|
|
|
|
- **SHAPE_LINE** = **0**
|
|
- **SHAPE_SEGMENT** = **2**
|
|
- **SHAPE_CIRCLE** = **3**
|
|
- **SHAPE_RECTANGLE** = **4**
|
|
- **SHAPE_CAPSULE** = **5**
|
|
- **SHAPE_CONVEX_POLYGON** = **6**
|
|
- **SHAPE_CONCAVE_POLYGON** = **7**
|
|
- **SHAPE_CUSTOM** = **8**
|
|
- **AREA_PARAM_GRAVITY** = **0**
|
|
- **AREA_PARAM_GRAVITY_VECTOR** = **1**
|
|
- **AREA_PARAM_GRAVITY_IS_POINT** = **2**
|
|
- **AREA_PARAM_GRAVITY_DISTANCE_SCALE** = **3**
|
|
- **AREA_PARAM_GRAVITY_POINT_ATTENUATION** = **4**
|
|
- **AREA_PARAM_LINEAR_DAMP** = **5**
|
|
- **AREA_PARAM_ANGULAR_DAMP** = **6**
|
|
- **AREA_PARAM_PRIORITY** = **7**
|
|
- **AREA_SPACE_OVERRIDE_DISABLED** = **0** --- This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them.
|
|
- **AREA_SPACE_OVERRIDE_COMBINE** = **1** --- 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.
|
|
- **AREA_SPACE_OVERRIDE_COMBINE_REPLACE** = **2** --- 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.
|
|
- **AREA_SPACE_OVERRIDE_REPLACE** = **3** --- This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas.
|
|
- **AREA_SPACE_OVERRIDE_REPLACE_COMBINE** = **4** --- This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one.
|
|
- **BODY_MODE_STATIC** = **0**
|
|
- **BODY_MODE_KINEMATIC** = **1**
|
|
- **BODY_MODE_RIGID** = **2**
|
|
- **BODY_MODE_CHARACTER** = **3**
|
|
- **BODY_PARAM_BOUNCE** = **0**
|
|
- **BODY_PARAM_FRICTION** = **1**
|
|
- **BODY_PARAM_MASS** = **2**
|
|
- **BODY_PARAM_GRAVITY_SCALE** = **3**
|
|
- **BODY_PARAM_LINEAR_DAMP** = **4**
|
|
- **BODY_PARAM_ANGULAR_DAMP** = **5**
|
|
- **BODY_PARAM_MAX** = **6**
|
|
- **BODY_STATE_TRANSFORM** = **0**
|
|
- **BODY_STATE_LINEAR_VELOCITY** = **1**
|
|
- **BODY_STATE_ANGULAR_VELOCITY** = **2**
|
|
- **BODY_STATE_SLEEPING** = **3**
|
|
- **BODY_STATE_CAN_SLEEP** = **4**
|
|
- **JOINT_PIN** = **0**
|
|
- **JOINT_GROOVE** = **1**
|
|
- **JOINT_DAMPED_SPRING** = **2**
|
|
- **DAMPED_STRING_REST_LENGTH** = **0**
|
|
- **DAMPED_STRING_STIFFNESS** = **1**
|
|
- **DAMPED_STRING_DAMPING** = **2**
|
|
- **CCD_MODE_DISABLED** = **0**
|
|
- **CCD_MODE_CAST_RAY** = **1**
|
|
- **CCD_MODE_CAST_SHAPE** = **2**
|
|
- **AREA_BODY_ADDED** = **0**
|
|
- **AREA_BODY_REMOVED** = **1**
|
|
- **INFO_ACTIVE_OBJECTS** = **0**
|
|
- **INFO_COLLISION_PAIRS** = **1**
|
|
- **INFO_ISLAND_COUNT** = **2**
|
|
|
|
Description
|
|
-----------
|
|
|
|
Physics 2D Server is the server responsible for all 2D physics.
|
|
|
|
Member Function Description
|
|
---------------------------
|
|
|
|
.. _class_Physics2DServer_shape_create:
|
|
|
|
- :ref:`RID<class_rid>` **shape_create** **(** :ref:`int<class_int>` type **)**
|
|
|
|
.. _class_Physics2DServer_shape_set_data:
|
|
|
|
- void **shape_set_data** **(** :ref:`RID<class_rid>` shape, var data **)**
|
|
|
|
.. _class_Physics2DServer_shape_get_type:
|
|
|
|
- :ref:`int<class_int>` **shape_get_type** **(** :ref:`RID<class_rid>` shape **)** const
|
|
|
|
.. _class_Physics2DServer_shape_get_data:
|
|
|
|
- void **shape_get_data** **(** :ref:`RID<class_rid>` shape **)** const
|
|
|
|
.. _class_Physics2DServer_space_create:
|
|
|
|
- :ref:`RID<class_rid>` **space_create** **(** **)**
|
|
|
|
.. _class_Physics2DServer_space_set_active:
|
|
|
|
- void **space_set_active** **(** :ref:`RID<class_rid>` space, :ref:`bool<class_bool>` active **)**
|
|
|
|
.. _class_Physics2DServer_space_is_active:
|
|
|
|
- :ref:`bool<class_bool>` **space_is_active** **(** :ref:`RID<class_rid>` space **)** const
|
|
|
|
.. _class_Physics2DServer_space_set_param:
|
|
|
|
- void **space_set_param** **(** :ref:`RID<class_rid>` space, :ref:`int<class_int>` param, :ref:`float<class_float>` value **)**
|
|
|
|
.. _class_Physics2DServer_space_get_param:
|
|
|
|
- :ref:`float<class_float>` **space_get_param** **(** :ref:`RID<class_rid>` space, :ref:`int<class_int>` param **)** const
|
|
|
|
.. _class_Physics2DServer_space_get_direct_state:
|
|
|
|
- :ref:`Physics2DDirectSpaceState<class_physics2ddirectspacestate>` **space_get_direct_state** **(** :ref:`RID<class_rid>` space **)**
|
|
|
|
.. _class_Physics2DServer_area_create:
|
|
|
|
- :ref:`RID<class_rid>` **area_create** **(** **)**
|
|
|
|
.. _class_Physics2DServer_area_set_space:
|
|
|
|
- void **area_set_space** **(** :ref:`RID<class_rid>` area, :ref:`RID<class_rid>` space **)**
|
|
|
|
.. _class_Physics2DServer_area_get_space:
|
|
|
|
- :ref:`RID<class_rid>` **area_get_space** **(** :ref:`RID<class_rid>` area **)** const
|
|
|
|
.. _class_Physics2DServer_area_set_space_override_mode:
|
|
|
|
- void **area_set_space_override_mode** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` mode **)**
|
|
|
|
.. _class_Physics2DServer_area_get_space_override_mode:
|
|
|
|
- :ref:`int<class_int>` **area_get_space_override_mode** **(** :ref:`RID<class_rid>` area **)** const
|
|
|
|
.. _class_Physics2DServer_area_add_shape:
|
|
|
|
- void **area_add_shape** **(** :ref:`RID<class_rid>` area, :ref:`RID<class_rid>` shape, :ref:`Matrix32<class_matrix32>` transform=1,0, 0,1, 0,0 **)**
|
|
|
|
.. _class_Physics2DServer_area_set_shape:
|
|
|
|
- void **area_set_shape** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx, :ref:`RID<class_rid>` shape **)**
|
|
|
|
.. _class_Physics2DServer_area_set_shape_transform:
|
|
|
|
- void **area_set_shape_transform** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx, :ref:`Matrix32<class_matrix32>` transform **)**
|
|
|
|
.. _class_Physics2DServer_area_get_shape_count:
|
|
|
|
- :ref:`int<class_int>` **area_get_shape_count** **(** :ref:`RID<class_rid>` area **)** const
|
|
|
|
.. _class_Physics2DServer_area_get_shape:
|
|
|
|
- :ref:`RID<class_rid>` **area_get_shape** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx **)** const
|
|
|
|
.. _class_Physics2DServer_area_get_shape_transform:
|
|
|
|
- :ref:`Matrix32<class_matrix32>` **area_get_shape_transform** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx **)** const
|
|
|
|
.. _class_Physics2DServer_area_remove_shape:
|
|
|
|
- void **area_remove_shape** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx **)**
|
|
|
|
.. _class_Physics2DServer_area_clear_shapes:
|
|
|
|
- void **area_clear_shapes** **(** :ref:`RID<class_rid>` area **)**
|
|
|
|
.. _class_Physics2DServer_area_set_layer_mask:
|
|
|
|
- void **area_set_layer_mask** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` mask **)**
|
|
|
|
.. _class_Physics2DServer_area_set_collision_mask:
|
|
|
|
- void **area_set_collision_mask** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` mask **)**
|
|
|
|
.. _class_Physics2DServer_area_set_param:
|
|
|
|
- void **area_set_param** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` param, var value **)**
|
|
|
|
.. _class_Physics2DServer_area_set_transform:
|
|
|
|
- void **area_set_transform** **(** :ref:`RID<class_rid>` area, :ref:`Matrix32<class_matrix32>` transform **)**
|
|
|
|
.. _class_Physics2DServer_area_get_param:
|
|
|
|
- void **area_get_param** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` param **)** const
|
|
|
|
.. _class_Physics2DServer_area_get_transform:
|
|
|
|
- :ref:`Matrix32<class_matrix32>` **area_get_transform** **(** :ref:`RID<class_rid>` area **)** const
|
|
|
|
.. _class_Physics2DServer_area_attach_object_instance_ID:
|
|
|
|
- void **area_attach_object_instance_ID** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` id **)**
|
|
|
|
.. _class_Physics2DServer_area_get_object_instance_ID:
|
|
|
|
- :ref:`int<class_int>` **area_get_object_instance_ID** **(** :ref:`RID<class_rid>` area **)** const
|
|
|
|
.. _class_Physics2DServer_area_set_monitor_callback:
|
|
|
|
- void **area_set_monitor_callback** **(** :ref:`RID<class_rid>` area, :ref:`Object<class_object>` receiver, :ref:`String<class_string>` method **)**
|
|
|
|
.. _class_Physics2DServer_body_create:
|
|
|
|
- :ref:`RID<class_rid>` **body_create** **(** :ref:`int<class_int>` mode=2, :ref:`bool<class_bool>` init_sleeping=false **)**
|
|
|
|
.. _class_Physics2DServer_body_set_space:
|
|
|
|
- void **body_set_space** **(** :ref:`RID<class_rid>` body, :ref:`RID<class_rid>` space **)**
|
|
|
|
.. _class_Physics2DServer_body_get_space:
|
|
|
|
- :ref:`RID<class_rid>` **body_get_space** **(** :ref:`RID<class_rid>` body **)** const
|
|
|
|
.. _class_Physics2DServer_body_set_mode:
|
|
|
|
- void **body_set_mode** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` mode **)**
|
|
|
|
.. _class_Physics2DServer_body_get_mode:
|
|
|
|
- :ref:`int<class_int>` **body_get_mode** **(** :ref:`RID<class_rid>` body **)** const
|
|
|
|
.. _class_Physics2DServer_body_add_shape:
|
|
|
|
- void **body_add_shape** **(** :ref:`RID<class_rid>` body, :ref:`RID<class_rid>` shape, :ref:`Matrix32<class_matrix32>` transform=1,0, 0,1, 0,0 **)**
|
|
|
|
.. _class_Physics2DServer_body_set_shape:
|
|
|
|
- void **body_set_shape** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx, :ref:`RID<class_rid>` shape **)**
|
|
|
|
.. _class_Physics2DServer_body_set_shape_transform:
|
|
|
|
- void **body_set_shape_transform** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx, :ref:`Matrix32<class_matrix32>` transform **)**
|
|
|
|
.. _class_Physics2DServer_body_set_shape_metadata:
|
|
|
|
- void **body_set_shape_metadata** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx, var metadata **)**
|
|
|
|
.. _class_Physics2DServer_body_get_shape_count:
|
|
|
|
- :ref:`int<class_int>` **body_get_shape_count** **(** :ref:`RID<class_rid>` body **)** const
|
|
|
|
.. _class_Physics2DServer_body_get_shape:
|
|
|
|
- :ref:`RID<class_rid>` **body_get_shape** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** const
|
|
|
|
.. _class_Physics2DServer_body_get_shape_transform:
|
|
|
|
- :ref:`Matrix32<class_matrix32>` **body_get_shape_transform** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** const
|
|
|
|
.. _class_Physics2DServer_body_get_shape_metadata:
|
|
|
|
- void **body_get_shape_metadata** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** const
|
|
|
|
.. _class_Physics2DServer_body_remove_shape:
|
|
|
|
- void **body_remove_shape** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)**
|
|
|
|
.. _class_Physics2DServer_body_clear_shapes:
|
|
|
|
- void **body_clear_shapes** **(** :ref:`RID<class_rid>` body **)**
|
|
|
|
.. _class_Physics2DServer_body_set_shape_as_trigger:
|
|
|
|
- void **body_set_shape_as_trigger** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx, :ref:`bool<class_bool>` enable **)**
|
|
|
|
.. _class_Physics2DServer_body_is_shape_set_as_trigger:
|
|
|
|
- :ref:`bool<class_bool>` **body_is_shape_set_as_trigger** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** const
|
|
|
|
.. _class_Physics2DServer_body_attach_object_instance_ID:
|
|
|
|
- void **body_attach_object_instance_ID** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` id **)**
|
|
|
|
.. _class_Physics2DServer_body_get_object_instance_ID:
|
|
|
|
- :ref:`int<class_int>` **body_get_object_instance_ID** **(** :ref:`RID<class_rid>` body **)** const
|
|
|
|
.. _class_Physics2DServer_body_set_continuous_collision_detection_mode:
|
|
|
|
- void **body_set_continuous_collision_detection_mode** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` mode **)**
|
|
|
|
.. _class_Physics2DServer_body_get_continuous_collision_detection_mode:
|
|
|
|
- :ref:`int<class_int>` **body_get_continuous_collision_detection_mode** **(** :ref:`RID<class_rid>` body **)** const
|
|
|
|
.. _class_Physics2DServer_body_set_layer_mask:
|
|
|
|
- void **body_set_layer_mask** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` mask **)**
|
|
|
|
.. _class_Physics2DServer_body_get_layer_mask:
|
|
|
|
- :ref:`int<class_int>` **body_get_layer_mask** **(** :ref:`RID<class_rid>` body **)** const
|
|
|
|
.. _class_Physics2DServer_body_set_collision_mask:
|
|
|
|
- void **body_set_collision_mask** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` mask **)**
|
|
|
|
.. _class_Physics2DServer_body_get_collision_mask:
|
|
|
|
- :ref:`int<class_int>` **body_get_collision_mask** **(** :ref:`RID<class_rid>` body **)** const
|
|
|
|
.. _class_Physics2DServer_body_set_param:
|
|
|
|
- void **body_set_param** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` param, :ref:`float<class_float>` value **)**
|
|
|
|
.. _class_Physics2DServer_body_get_param:
|
|
|
|
- :ref:`float<class_float>` **body_get_param** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` param **)** const
|
|
|
|
.. _class_Physics2DServer_body_set_state:
|
|
|
|
- void **body_set_state** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` state, var value **)**
|
|
|
|
.. _class_Physics2DServer_body_get_state:
|
|
|
|
- void **body_get_state** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` state **)** const
|
|
|
|
.. _class_Physics2DServer_body_apply_impulse:
|
|
|
|
- void **body_apply_impulse** **(** :ref:`RID<class_rid>` body, :ref:`Vector2<class_vector2>` pos, :ref:`Vector2<class_vector2>` impulse **)**
|
|
|
|
.. _class_Physics2DServer_body_set_axis_velocity:
|
|
|
|
- void **body_set_axis_velocity** **(** :ref:`RID<class_rid>` body, :ref:`Vector2<class_vector2>` axis_velocity **)**
|
|
|
|
.. _class_Physics2DServer_body_add_collision_exception:
|
|
|
|
- void **body_add_collision_exception** **(** :ref:`RID<class_rid>` body, :ref:`RID<class_rid>` excepted_body **)**
|
|
|
|
.. _class_Physics2DServer_body_remove_collision_exception:
|
|
|
|
- void **body_remove_collision_exception** **(** :ref:`RID<class_rid>` body, :ref:`RID<class_rid>` excepted_body **)**
|
|
|
|
.. _class_Physics2DServer_body_set_max_contacts_reported:
|
|
|
|
- void **body_set_max_contacts_reported** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` amount **)**
|
|
|
|
.. _class_Physics2DServer_body_get_max_contacts_reported:
|
|
|
|
- :ref:`int<class_int>` **body_get_max_contacts_reported** **(** :ref:`RID<class_rid>` body **)** const
|
|
|
|
.. _class_Physics2DServer_body_set_one_way_collision_direction:
|
|
|
|
- void **body_set_one_way_collision_direction** **(** :ref:`RID<class_rid>` body, :ref:`Vector2<class_vector2>` normal **)**
|
|
|
|
.. _class_Physics2DServer_body_get_one_way_collision_direction:
|
|
|
|
- :ref:`Vector2<class_vector2>` **body_get_one_way_collision_direction** **(** :ref:`RID<class_rid>` body **)** const
|
|
|
|
.. _class_Physics2DServer_body_set_one_way_collision_max_depth:
|
|
|
|
- void **body_set_one_way_collision_max_depth** **(** :ref:`RID<class_rid>` body, :ref:`float<class_float>` depth **)**
|
|
|
|
.. _class_Physics2DServer_body_get_one_way_collision_max_depth:
|
|
|
|
- :ref:`float<class_float>` **body_get_one_way_collision_max_depth** **(** :ref:`RID<class_rid>` body **)** const
|
|
|
|
.. _class_Physics2DServer_body_set_omit_force_integration:
|
|
|
|
- void **body_set_omit_force_integration** **(** :ref:`RID<class_rid>` body, :ref:`bool<class_bool>` enable **)**
|
|
|
|
.. _class_Physics2DServer_body_is_omitting_force_integration:
|
|
|
|
- :ref:`bool<class_bool>` **body_is_omitting_force_integration** **(** :ref:`RID<class_rid>` body **)** const
|
|
|
|
.. _class_Physics2DServer_body_set_force_integration_callback:
|
|
|
|
- void **body_set_force_integration_callback** **(** :ref:`RID<class_rid>` body, :ref:`Object<class_object>` receiver, :ref:`String<class_string>` method, var userdata=NULL **)**
|
|
|
|
.. _class_Physics2DServer_body_test_motion:
|
|
|
|
- :ref:`bool<class_bool>` **body_test_motion** **(** :ref:`RID<class_rid>` body, :ref:`Vector2<class_vector2>` motion, :ref:`float<class_float>` margin=0.08, :ref:`Physics2DTestMotionResult<class_physics2dtestmotionresult>` result=NULL **)**
|
|
|
|
.. _class_Physics2DServer_joint_set_param:
|
|
|
|
- void **joint_set_param** **(** :ref:`RID<class_rid>` joint, :ref:`int<class_int>` param, :ref:`float<class_float>` value **)**
|
|
|
|
.. _class_Physics2DServer_joint_get_param:
|
|
|
|
- :ref:`float<class_float>` **joint_get_param** **(** :ref:`RID<class_rid>` joint, :ref:`int<class_int>` param **)** const
|
|
|
|
.. _class_Physics2DServer_pin_joint_create:
|
|
|
|
- :ref:`RID<class_rid>` **pin_joint_create** **(** :ref:`Vector2<class_vector2>` anchor, :ref:`RID<class_rid>` body_a, :ref:`RID<class_rid>` body_b=RID() **)**
|
|
|
|
.. _class_Physics2DServer_groove_joint_create:
|
|
|
|
- :ref:`RID<class_rid>` **groove_joint_create** **(** :ref:`Vector2<class_vector2>` groove1_a, :ref:`Vector2<class_vector2>` groove2_a, :ref:`Vector2<class_vector2>` anchor_b, :ref:`RID<class_rid>` body_a=RID(), :ref:`RID<class_rid>` body_b=RID() **)**
|
|
|
|
.. _class_Physics2DServer_damped_spring_joint_create:
|
|
|
|
- :ref:`RID<class_rid>` **damped_spring_joint_create** **(** :ref:`Vector2<class_vector2>` anchor_a, :ref:`Vector2<class_vector2>` anchor_b, :ref:`RID<class_rid>` body_a, :ref:`RID<class_rid>` body_b=RID() **)**
|
|
|
|
.. _class_Physics2DServer_damped_string_joint_set_param:
|
|
|
|
- void **damped_string_joint_set_param** **(** :ref:`RID<class_rid>` joint, :ref:`int<class_int>` param, :ref:`float<class_float>` value=RID() **)**
|
|
|
|
.. _class_Physics2DServer_damped_string_joint_get_param:
|
|
|
|
- :ref:`float<class_float>` **damped_string_joint_get_param** **(** :ref:`RID<class_rid>` joint, :ref:`int<class_int>` param **)** const
|
|
|
|
.. _class_Physics2DServer_joint_get_type:
|
|
|
|
- :ref:`int<class_int>` **joint_get_type** **(** :ref:`RID<class_rid>` joint **)** const
|
|
|
|
.. _class_Physics2DServer_free_rid:
|
|
|
|
- void **free_rid** **(** :ref:`RID<class_rid>` rid **)**
|
|
|
|
.. _class_Physics2DServer_set_active:
|
|
|
|
- void **set_active** **(** :ref:`bool<class_bool>` active **)**
|
|
|
|
.. _class_Physics2DServer_get_process_info:
|
|
|
|
- :ref:`int<class_int>` **get_process_info** **(** :ref:`int<class_int>` process_info **)**
|
|
|
|
|