.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_Physics2DServer: Physics2DServer =============== **Inherits:** :ref:`Object` **Inherited By:** :ref:`Physics2DServerSW` **Category:** Core Brief Description ----------------- Physics 2D Server. Member Functions ---------------- +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`shape_create` **(** :ref:`int` type **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`shape_set_data` **(** :ref:`RID` shape, var data **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`shape_get_type` **(** :ref:`RID` shape **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`shape_get_data` **(** :ref:`RID` shape **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`space_create` **(** **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`space_set_active` **(** :ref:`RID` space, :ref:`bool` active **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`space_is_active` **(** :ref:`RID` space **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`space_set_param` **(** :ref:`RID` space, :ref:`int` param, :ref:`float` value **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`space_get_param` **(** :ref:`RID` space, :ref:`int` param **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Physics2DDirectSpaceState` | :ref:`space_get_direct_state` **(** :ref:`RID` space **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`area_create` **(** **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`area_set_space` **(** :ref:`RID` area, :ref:`RID` space **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`area_get_space` **(** :ref:`RID` area **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`area_set_space_override_mode` **(** :ref:`RID` area, :ref:`int` mode **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`area_get_space_override_mode` **(** :ref:`RID` area **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`area_add_shape` **(** :ref:`RID` area, :ref:`RID` shape, :ref:`Matrix32` transform=1,0, 0,1, 0,0 **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`area_set_shape` **(** :ref:`RID` area, :ref:`int` shape_idx, :ref:`RID` shape **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`area_set_shape_transform` **(** :ref:`RID` area, :ref:`int` shape_idx, :ref:`Matrix32` transform **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`area_get_shape_count` **(** :ref:`RID` area **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`area_get_shape` **(** :ref:`RID` area, :ref:`int` shape_idx **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Matrix32` | :ref:`area_get_shape_transform` **(** :ref:`RID` area, :ref:`int` shape_idx **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`area_remove_shape` **(** :ref:`RID` area, :ref:`int` shape_idx **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`area_clear_shapes` **(** :ref:`RID` area **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`area_set_layer_mask` **(** :ref:`RID` area, :ref:`int` mask **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`area_set_collision_mask` **(** :ref:`RID` area, :ref:`int` mask **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`area_set_param` **(** :ref:`RID` area, :ref:`int` param, var value **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`area_set_transform` **(** :ref:`RID` area, :ref:`Matrix32` transform **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`area_get_param` **(** :ref:`RID` area, :ref:`int` param **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Matrix32` | :ref:`area_get_transform` **(** :ref:`RID` area **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`area_attach_object_instance_ID` **(** :ref:`RID` area, :ref:`int` id **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`area_get_object_instance_ID` **(** :ref:`RID` area **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`area_set_monitor_callback` **(** :ref:`RID` area, :ref:`Object` receiver, :ref:`String` method **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`body_create` **(** :ref:`int` mode=2, :ref:`bool` init_sleeping=false **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_space` **(** :ref:`RID` body, :ref:`RID` space **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`body_get_space` **(** :ref:`RID` body **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_mode` **(** :ref:`RID` body, :ref:`int` mode **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`body_get_mode` **(** :ref:`RID` body **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_add_shape` **(** :ref:`RID` body, :ref:`RID` shape, :ref:`Matrix32` transform=1,0, 0,1, 0,0 **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_shape` **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`RID` shape **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_shape_transform` **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`Matrix32` transform **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_shape_metadata` **(** :ref:`RID` body, :ref:`int` shape_idx, var metadata **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`body_get_shape_count` **(** :ref:`RID` body **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`body_get_shape` **(** :ref:`RID` body, :ref:`int` shape_idx **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Matrix32` | :ref:`body_get_shape_transform` **(** :ref:`RID` body, :ref:`int` shape_idx **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_get_shape_metadata` **(** :ref:`RID` body, :ref:`int` shape_idx **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_remove_shape` **(** :ref:`RID` body, :ref:`int` shape_idx **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_clear_shapes` **(** :ref:`RID` body **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_shape_as_trigger` **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`bool` enable **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`body_is_shape_set_as_trigger` **(** :ref:`RID` body, :ref:`int` shape_idx **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_attach_object_instance_ID` **(** :ref:`RID` body, :ref:`int` id **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`body_get_object_instance_ID` **(** :ref:`RID` body **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_continuous_collision_detection_mode` **(** :ref:`RID` body, :ref:`int` mode **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`body_get_continuous_collision_detection_mode` **(** :ref:`RID` body **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_layer_mask` **(** :ref:`RID` body, :ref:`int` mask **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`body_get_layer_mask` **(** :ref:`RID` body **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_collision_mask` **(** :ref:`RID` body, :ref:`int` mask **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`body_get_collision_mask` **(** :ref:`RID` body **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_param` **(** :ref:`RID` body, :ref:`int` param, :ref:`float` value **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`body_get_param` **(** :ref:`RID` body, :ref:`int` param **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_state` **(** :ref:`RID` body, :ref:`int` state, var value **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_get_state` **(** :ref:`RID` body, :ref:`int` state **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_apply_impulse` **(** :ref:`RID` body, :ref:`Vector2` pos, :ref:`Vector2` impulse **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_axis_velocity` **(** :ref:`RID` body, :ref:`Vector2` axis_velocity **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_add_collision_exception` **(** :ref:`RID` body, :ref:`RID` excepted_body **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_remove_collision_exception` **(** :ref:`RID` body, :ref:`RID` excepted_body **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_max_contacts_reported` **(** :ref:`RID` body, :ref:`int` amount **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`body_get_max_contacts_reported` **(** :ref:`RID` body **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_one_way_collision_direction` **(** :ref:`RID` body, :ref:`Vector2` normal **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`body_get_one_way_collision_direction` **(** :ref:`RID` body **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_one_way_collision_max_depth` **(** :ref:`RID` body, :ref:`float` depth **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`body_get_one_way_collision_max_depth` **(** :ref:`RID` body **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_omit_force_integration` **(** :ref:`RID` body, :ref:`bool` enable **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`body_is_omitting_force_integration` **(** :ref:`RID` body **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`body_set_force_integration_callback` **(** :ref:`RID` body, :ref:`Object` receiver, :ref:`String` method, var userdata=NULL **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`body_test_motion` **(** :ref:`RID` body, :ref:`Vector2` motion, :ref:`float` margin=0.08, :ref:`Physics2DTestMotionResult` result=NULL **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`joint_set_param` **(** :ref:`RID` joint, :ref:`int` param, :ref:`float` value **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`joint_get_param` **(** :ref:`RID` joint, :ref:`int` param **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`pin_joint_create` **(** :ref:`Vector2` anchor, :ref:`RID` body_a, :ref:`RID` body_b=RID() **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`groove_joint_create` **(** :ref:`Vector2` groove1_a, :ref:`Vector2` groove2_a, :ref:`Vector2` anchor_b, :ref:`RID` body_a=RID(), :ref:`RID` body_b=RID() **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`damped_spring_joint_create` **(** :ref:`Vector2` anchor_a, :ref:`Vector2` anchor_b, :ref:`RID` body_a, :ref:`RID` body_b=RID() **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`damped_string_joint_set_param` **(** :ref:`RID` joint, :ref:`int` param, :ref:`float` value **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`damped_string_joint_get_param` **(** :ref:`RID` joint, :ref:`int` param **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`joint_get_type` **(** :ref:`RID` joint **)** const | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`free_rid` **(** :ref:`RID` rid **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_active` **(** :ref:`bool` active **)** | +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_process_info` **(** :ref:`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` **shape_create** **(** :ref:`int` type **)** .. _class_Physics2DServer_shape_set_data: - void **shape_set_data** **(** :ref:`RID` shape, var data **)** .. _class_Physics2DServer_shape_get_type: - :ref:`int` **shape_get_type** **(** :ref:`RID` shape **)** const .. _class_Physics2DServer_shape_get_data: - void **shape_get_data** **(** :ref:`RID` shape **)** const .. _class_Physics2DServer_space_create: - :ref:`RID` **space_create** **(** **)** .. _class_Physics2DServer_space_set_active: - void **space_set_active** **(** :ref:`RID` space, :ref:`bool` active **)** .. _class_Physics2DServer_space_is_active: - :ref:`bool` **space_is_active** **(** :ref:`RID` space **)** const .. _class_Physics2DServer_space_set_param: - void **space_set_param** **(** :ref:`RID` space, :ref:`int` param, :ref:`float` value **)** .. _class_Physics2DServer_space_get_param: - :ref:`float` **space_get_param** **(** :ref:`RID` space, :ref:`int` param **)** const .. _class_Physics2DServer_space_get_direct_state: - :ref:`Physics2DDirectSpaceState` **space_get_direct_state** **(** :ref:`RID` space **)** .. _class_Physics2DServer_area_create: - :ref:`RID` **area_create** **(** **)** .. _class_Physics2DServer_area_set_space: - void **area_set_space** **(** :ref:`RID` area, :ref:`RID` space **)** .. _class_Physics2DServer_area_get_space: - :ref:`RID` **area_get_space** **(** :ref:`RID` area **)** const .. _class_Physics2DServer_area_set_space_override_mode: - void **area_set_space_override_mode** **(** :ref:`RID` area, :ref:`int` mode **)** .. _class_Physics2DServer_area_get_space_override_mode: - :ref:`int` **area_get_space_override_mode** **(** :ref:`RID` area **)** const .. _class_Physics2DServer_area_add_shape: - void **area_add_shape** **(** :ref:`RID` area, :ref:`RID` shape, :ref:`Matrix32` transform=1,0, 0,1, 0,0 **)** .. _class_Physics2DServer_area_set_shape: - void **area_set_shape** **(** :ref:`RID` area, :ref:`int` shape_idx, :ref:`RID` shape **)** .. _class_Physics2DServer_area_set_shape_transform: - void **area_set_shape_transform** **(** :ref:`RID` area, :ref:`int` shape_idx, :ref:`Matrix32` transform **)** .. _class_Physics2DServer_area_get_shape_count: - :ref:`int` **area_get_shape_count** **(** :ref:`RID` area **)** const .. _class_Physics2DServer_area_get_shape: - :ref:`RID` **area_get_shape** **(** :ref:`RID` area, :ref:`int` shape_idx **)** const .. _class_Physics2DServer_area_get_shape_transform: - :ref:`Matrix32` **area_get_shape_transform** **(** :ref:`RID` area, :ref:`int` shape_idx **)** const .. _class_Physics2DServer_area_remove_shape: - void **area_remove_shape** **(** :ref:`RID` area, :ref:`int` shape_idx **)** .. _class_Physics2DServer_area_clear_shapes: - void **area_clear_shapes** **(** :ref:`RID` area **)** .. _class_Physics2DServer_area_set_layer_mask: - void **area_set_layer_mask** **(** :ref:`RID` area, :ref:`int` mask **)** .. _class_Physics2DServer_area_set_collision_mask: - void **area_set_collision_mask** **(** :ref:`RID` area, :ref:`int` mask **)** .. _class_Physics2DServer_area_set_param: - void **area_set_param** **(** :ref:`RID` area, :ref:`int` param, var value **)** .. _class_Physics2DServer_area_set_transform: - void **area_set_transform** **(** :ref:`RID` area, :ref:`Matrix32` transform **)** .. _class_Physics2DServer_area_get_param: - void **area_get_param** **(** :ref:`RID` area, :ref:`int` param **)** const .. _class_Physics2DServer_area_get_transform: - :ref:`Matrix32` **area_get_transform** **(** :ref:`RID` area **)** const .. _class_Physics2DServer_area_attach_object_instance_ID: - void **area_attach_object_instance_ID** **(** :ref:`RID` area, :ref:`int` id **)** .. _class_Physics2DServer_area_get_object_instance_ID: - :ref:`int` **area_get_object_instance_ID** **(** :ref:`RID` area **)** const .. _class_Physics2DServer_area_set_monitor_callback: - void **area_set_monitor_callback** **(** :ref:`RID` area, :ref:`Object` receiver, :ref:`String` method **)** .. _class_Physics2DServer_body_create: - :ref:`RID` **body_create** **(** :ref:`int` mode=2, :ref:`bool` init_sleeping=false **)** .. _class_Physics2DServer_body_set_space: - void **body_set_space** **(** :ref:`RID` body, :ref:`RID` space **)** .. _class_Physics2DServer_body_get_space: - :ref:`RID` **body_get_space** **(** :ref:`RID` body **)** const .. _class_Physics2DServer_body_set_mode: - void **body_set_mode** **(** :ref:`RID` body, :ref:`int` mode **)** .. _class_Physics2DServer_body_get_mode: - :ref:`int` **body_get_mode** **(** :ref:`RID` body **)** const .. _class_Physics2DServer_body_add_shape: - void **body_add_shape** **(** :ref:`RID` body, :ref:`RID` shape, :ref:`Matrix32` transform=1,0, 0,1, 0,0 **)** .. _class_Physics2DServer_body_set_shape: - void **body_set_shape** **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`RID` shape **)** .. _class_Physics2DServer_body_set_shape_transform: - void **body_set_shape_transform** **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`Matrix32` transform **)** .. _class_Physics2DServer_body_set_shape_metadata: - void **body_set_shape_metadata** **(** :ref:`RID` body, :ref:`int` shape_idx, var metadata **)** .. _class_Physics2DServer_body_get_shape_count: - :ref:`int` **body_get_shape_count** **(** :ref:`RID` body **)** const .. _class_Physics2DServer_body_get_shape: - :ref:`RID` **body_get_shape** **(** :ref:`RID` body, :ref:`int` shape_idx **)** const .. _class_Physics2DServer_body_get_shape_transform: - :ref:`Matrix32` **body_get_shape_transform** **(** :ref:`RID` body, :ref:`int` shape_idx **)** const .. _class_Physics2DServer_body_get_shape_metadata: - void **body_get_shape_metadata** **(** :ref:`RID` body, :ref:`int` shape_idx **)** const .. _class_Physics2DServer_body_remove_shape: - void **body_remove_shape** **(** :ref:`RID` body, :ref:`int` shape_idx **)** .. _class_Physics2DServer_body_clear_shapes: - void **body_clear_shapes** **(** :ref:`RID` body **)** .. _class_Physics2DServer_body_set_shape_as_trigger: - void **body_set_shape_as_trigger** **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`bool` enable **)** .. _class_Physics2DServer_body_is_shape_set_as_trigger: - :ref:`bool` **body_is_shape_set_as_trigger** **(** :ref:`RID` body, :ref:`int` shape_idx **)** const .. _class_Physics2DServer_body_attach_object_instance_ID: - void **body_attach_object_instance_ID** **(** :ref:`RID` body, :ref:`int` id **)** .. _class_Physics2DServer_body_get_object_instance_ID: - :ref:`int` **body_get_object_instance_ID** **(** :ref:`RID` body **)** const .. _class_Physics2DServer_body_set_continuous_collision_detection_mode: - void **body_set_continuous_collision_detection_mode** **(** :ref:`RID` body, :ref:`int` mode **)** .. _class_Physics2DServer_body_get_continuous_collision_detection_mode: - :ref:`int` **body_get_continuous_collision_detection_mode** **(** :ref:`RID` body **)** const .. _class_Physics2DServer_body_set_layer_mask: - void **body_set_layer_mask** **(** :ref:`RID` body, :ref:`int` mask **)** .. _class_Physics2DServer_body_get_layer_mask: - :ref:`int` **body_get_layer_mask** **(** :ref:`RID` body **)** const .. _class_Physics2DServer_body_set_collision_mask: - void **body_set_collision_mask** **(** :ref:`RID` body, :ref:`int` mask **)** .. _class_Physics2DServer_body_get_collision_mask: - :ref:`int` **body_get_collision_mask** **(** :ref:`RID` body **)** const .. _class_Physics2DServer_body_set_param: - void **body_set_param** **(** :ref:`RID` body, :ref:`int` param, :ref:`float` value **)** .. _class_Physics2DServer_body_get_param: - :ref:`float` **body_get_param** **(** :ref:`RID` body, :ref:`int` param **)** const .. _class_Physics2DServer_body_set_state: - void **body_set_state** **(** :ref:`RID` body, :ref:`int` state, var value **)** .. _class_Physics2DServer_body_get_state: - void **body_get_state** **(** :ref:`RID` body, :ref:`int` state **)** const .. _class_Physics2DServer_body_apply_impulse: - void **body_apply_impulse** **(** :ref:`RID` body, :ref:`Vector2` pos, :ref:`Vector2` impulse **)** .. _class_Physics2DServer_body_set_axis_velocity: - void **body_set_axis_velocity** **(** :ref:`RID` body, :ref:`Vector2` axis_velocity **)** .. _class_Physics2DServer_body_add_collision_exception: - void **body_add_collision_exception** **(** :ref:`RID` body, :ref:`RID` excepted_body **)** .. _class_Physics2DServer_body_remove_collision_exception: - void **body_remove_collision_exception** **(** :ref:`RID` body, :ref:`RID` excepted_body **)** .. _class_Physics2DServer_body_set_max_contacts_reported: - void **body_set_max_contacts_reported** **(** :ref:`RID` body, :ref:`int` amount **)** .. _class_Physics2DServer_body_get_max_contacts_reported: - :ref:`int` **body_get_max_contacts_reported** **(** :ref:`RID` body **)** const .. _class_Physics2DServer_body_set_one_way_collision_direction: - void **body_set_one_way_collision_direction** **(** :ref:`RID` body, :ref:`Vector2` normal **)** .. _class_Physics2DServer_body_get_one_way_collision_direction: - :ref:`Vector2` **body_get_one_way_collision_direction** **(** :ref:`RID` body **)** const .. _class_Physics2DServer_body_set_one_way_collision_max_depth: - void **body_set_one_way_collision_max_depth** **(** :ref:`RID` body, :ref:`float` depth **)** .. _class_Physics2DServer_body_get_one_way_collision_max_depth: - :ref:`float` **body_get_one_way_collision_max_depth** **(** :ref:`RID` body **)** const .. _class_Physics2DServer_body_set_omit_force_integration: - void **body_set_omit_force_integration** **(** :ref:`RID` body, :ref:`bool` enable **)** .. _class_Physics2DServer_body_is_omitting_force_integration: - :ref:`bool` **body_is_omitting_force_integration** **(** :ref:`RID` body **)** const .. _class_Physics2DServer_body_set_force_integration_callback: - void **body_set_force_integration_callback** **(** :ref:`RID` body, :ref:`Object` receiver, :ref:`String` method, var userdata=NULL **)** .. _class_Physics2DServer_body_test_motion: - :ref:`bool` **body_test_motion** **(** :ref:`RID` body, :ref:`Vector2` motion, :ref:`float` margin=0.08, :ref:`Physics2DTestMotionResult` result=NULL **)** .. _class_Physics2DServer_joint_set_param: - void **joint_set_param** **(** :ref:`RID` joint, :ref:`int` param, :ref:`float` value **)** .. _class_Physics2DServer_joint_get_param: - :ref:`float` **joint_get_param** **(** :ref:`RID` joint, :ref:`int` param **)** const .. _class_Physics2DServer_pin_joint_create: - :ref:`RID` **pin_joint_create** **(** :ref:`Vector2` anchor, :ref:`RID` body_a, :ref:`RID` body_b=RID() **)** .. _class_Physics2DServer_groove_joint_create: - :ref:`RID` **groove_joint_create** **(** :ref:`Vector2` groove1_a, :ref:`Vector2` groove2_a, :ref:`Vector2` anchor_b, :ref:`RID` body_a=RID(), :ref:`RID` body_b=RID() **)** .. _class_Physics2DServer_damped_spring_joint_create: - :ref:`RID` **damped_spring_joint_create** **(** :ref:`Vector2` anchor_a, :ref:`Vector2` anchor_b, :ref:`RID` body_a, :ref:`RID` body_b=RID() **)** .. _class_Physics2DServer_damped_string_joint_set_param: - void **damped_string_joint_set_param** **(** :ref:`RID` joint, :ref:`int` param, :ref:`float` value **)** .. _class_Physics2DServer_damped_string_joint_get_param: - :ref:`float` **damped_string_joint_get_param** **(** :ref:`RID` joint, :ref:`int` param **)** const .. _class_Physics2DServer_joint_get_type: - :ref:`int` **joint_get_type** **(** :ref:`RID` joint **)** const .. _class_Physics2DServer_free_rid: - void **free_rid** **(** :ref:`RID` rid **)** .. _class_Physics2DServer_set_active: - void **set_active** **(** :ref:`bool` active **)** .. _class_Physics2DServer_get_process_info: - :ref:`int` **get_process_info** **(** :ref:`int` process_info **)**