Up to date
This page is up to date for Godot 4.2
.
If you still find outdated information, please open an issue.
PhysicsServer2DExtension¶
Inherits: PhysicsServer2D < Object
Provides virtual methods that can be overridden to create custom PhysicsServer2D implementations.
Description¶
This class extends PhysicsServer2D by providing additional virtual methods that can be overridden. When these methods are overridden, they will be called instead of the internal methods of the physics server.
Intended for use with GDExtension to create custom implementations of PhysicsServer2D.
Methods¶
void |
_area_add_shape ( RID area, RID shape, Transform2D transform, bool disabled ) virtual |
void |
_area_attach_canvas_instance_id ( RID area, int id ) virtual |
void |
_area_attach_object_instance_id ( RID area, int id ) virtual |
void |
_area_clear_shapes ( RID area ) virtual |
_area_create ( ) virtual |
|
_area_get_canvas_instance_id ( RID area ) virtual const |
|
_area_get_collision_layer ( RID area ) virtual const |
|
_area_get_collision_mask ( RID area ) virtual const |
|
_area_get_object_instance_id ( RID area ) virtual const |
|
_area_get_param ( RID area, AreaParameter param ) virtual const |
|
_area_get_shape ( RID area, int shape_idx ) virtual const |
|
_area_get_shape_count ( RID area ) virtual const |
|
_area_get_shape_transform ( RID area, int shape_idx ) virtual const |
|
_area_get_space ( RID area ) virtual const |
|
_area_get_transform ( RID area ) virtual const |
|
void |
_area_remove_shape ( RID area, int shape_idx ) virtual |
void |
_area_set_area_monitor_callback ( RID area, Callable callback ) virtual |
void |
_area_set_collision_layer ( RID area, int layer ) virtual |
void |
_area_set_collision_mask ( RID area, int mask ) virtual |
void |
_area_set_monitor_callback ( RID area, Callable callback ) virtual |
void |
_area_set_monitorable ( RID area, bool monitorable ) virtual |
void |
_area_set_param ( RID area, AreaParameter param, Variant value ) virtual |
void |
_area_set_pickable ( RID area, bool pickable ) virtual |
void |
_area_set_shape ( RID area, int shape_idx, RID shape ) virtual |
void |
_area_set_shape_disabled ( RID area, int shape_idx, bool disabled ) virtual |
void |
_area_set_shape_transform ( RID area, int shape_idx, Transform2D transform ) virtual |
void |
_area_set_space ( RID area, RID space ) virtual |
void |
_area_set_transform ( RID area, Transform2D transform ) virtual |
void |
_body_add_collision_exception ( RID body, RID excepted_body ) virtual |
void |
_body_add_constant_central_force ( RID body, Vector2 force ) virtual |
void |
_body_add_constant_force ( RID body, Vector2 force, Vector2 position ) virtual |
void |
_body_add_constant_torque ( RID body, float torque ) virtual |
void |
_body_add_shape ( RID body, RID shape, Transform2D transform, bool disabled ) virtual |
void |
_body_apply_central_force ( RID body, Vector2 force ) virtual |
void |
_body_apply_central_impulse ( RID body, Vector2 impulse ) virtual |
void |
_body_apply_force ( RID body, Vector2 force, Vector2 position ) virtual |
void |
_body_apply_impulse ( RID body, Vector2 impulse, Vector2 position ) virtual |
void |
_body_apply_torque ( RID body, float torque ) virtual |
void |
_body_apply_torque_impulse ( RID body, float impulse ) virtual |
void |
_body_attach_canvas_instance_id ( RID body, int id ) virtual |
void |
_body_attach_object_instance_id ( RID body, int id ) virtual |
void |
_body_clear_shapes ( RID body ) virtual |
_body_collide_shape ( RID body, int body_shape, RID shape, Transform2D shape_xform, Vector2 motion, void* results, int result_max, int32_t* result_count ) virtual |
|
_body_create ( ) virtual |
|
_body_get_canvas_instance_id ( RID body ) virtual const |
|
_body_get_collision_exceptions ( RID body ) virtual const |
|
_body_get_collision_layer ( RID body ) virtual const |
|
_body_get_collision_mask ( RID body ) virtual const |
|
_body_get_collision_priority ( RID body ) virtual const |
|
_body_get_constant_force ( RID body ) virtual const |
|
_body_get_constant_torque ( RID body ) virtual const |
|
_body_get_contacts_reported_depth_threshold ( RID body ) virtual const |
|
_body_get_continuous_collision_detection_mode ( RID body ) virtual const |
|
_body_get_direct_state ( RID body ) virtual |
|
_body_get_max_contacts_reported ( RID body ) virtual const |
|
_body_get_mode ( RID body ) virtual const |
|
_body_get_object_instance_id ( RID body ) virtual const |
|
_body_get_param ( RID body, BodyParameter param ) virtual const |
|
_body_get_shape ( RID body, int shape_idx ) virtual const |
|
_body_get_shape_count ( RID body ) virtual const |
|
_body_get_shape_transform ( RID body, int shape_idx ) virtual const |
|
_body_get_space ( RID body ) virtual const |
|
_body_get_state ( RID body, BodyState state ) virtual const |
|
_body_is_omitting_force_integration ( RID body ) virtual const |
|
void |
_body_remove_collision_exception ( RID body, RID excepted_body ) virtual |
void |
_body_remove_shape ( RID body, int shape_idx ) virtual |
void |
_body_reset_mass_properties ( RID body ) virtual |
void |
_body_set_axis_velocity ( RID body, Vector2 axis_velocity ) virtual |
void |
_body_set_collision_layer ( RID body, int layer ) virtual |
void |
_body_set_collision_mask ( RID body, int mask ) virtual |
void |
_body_set_collision_priority ( RID body, float priority ) virtual |
void |
_body_set_constant_force ( RID body, Vector2 force ) virtual |
void |
_body_set_constant_torque ( RID body, float torque ) virtual |
void |
_body_set_contacts_reported_depth_threshold ( RID body, float threshold ) virtual |
void |
_body_set_continuous_collision_detection_mode ( RID body, CCDMode mode ) virtual |
void |
_body_set_force_integration_callback ( RID body, Callable callable, Variant userdata ) virtual |
void |
_body_set_max_contacts_reported ( RID body, int amount ) virtual |
void |
_body_set_mode ( RID body, BodyMode mode ) virtual |
void |
_body_set_omit_force_integration ( RID body, bool enable ) virtual |
void |
_body_set_param ( RID body, BodyParameter param, Variant value ) virtual |
void |
_body_set_pickable ( RID body, bool pickable ) virtual |
void |
_body_set_shape ( RID body, int shape_idx, RID shape ) virtual |
void |
_body_set_shape_as_one_way_collision ( RID body, int shape_idx, bool enable, float margin ) virtual |
void |
_body_set_shape_disabled ( RID body, int shape_idx, bool disabled ) virtual |
void |
_body_set_shape_transform ( RID body, int shape_idx, Transform2D transform ) virtual |
void |
_body_set_space ( RID body, RID space ) virtual |
void |
_body_set_state ( RID body, BodyState state, Variant value ) virtual |
void |
_body_set_state_sync_callback ( RID body, Callable callable ) virtual |
_body_test_motion ( RID body, Transform2D from, Vector2 motion, float margin, bool collide_separation_ray, bool recovery_as_collision, PhysicsServer2DExtensionMotionResult* result ) virtual const |
|
_capsule_shape_create ( ) virtual |
|
_circle_shape_create ( ) virtual |
|
_concave_polygon_shape_create ( ) virtual |
|
_convex_polygon_shape_create ( ) virtual |
|
_damped_spring_joint_get_param ( RID joint, DampedSpringParam param ) virtual const |
|
void |
_damped_spring_joint_set_param ( RID joint, DampedSpringParam param, float value ) virtual |
void |
_end_sync ( ) virtual |
void |
_finish ( ) virtual |
void |
_flush_queries ( ) virtual |
void |
|
_get_process_info ( ProcessInfo process_info ) virtual |
|
void |
_init ( ) virtual |
_is_flushing_queries ( ) virtual const |
|
void |
_joint_clear ( RID joint ) virtual |
_joint_create ( ) virtual |
|
void |
_joint_disable_collisions_between_bodies ( RID joint, bool disable ) virtual |
_joint_get_param ( RID joint, JointParam param ) virtual const |
|
_joint_get_type ( RID joint ) virtual const |
|
_joint_is_disabled_collisions_between_bodies ( RID joint ) virtual const |
|
void |
_joint_make_damped_spring ( RID joint, Vector2 anchor_a, Vector2 anchor_b, RID body_a, RID body_b ) virtual |
void |
_joint_make_groove ( RID joint, Vector2 a_groove1, Vector2 a_groove2, Vector2 b_anchor, RID body_a, RID body_b ) virtual |
void |
_joint_make_pin ( RID joint, Vector2 anchor, RID body_a, RID body_b ) virtual |
void |
_joint_set_param ( RID joint, JointParam param, float value ) virtual |
_pin_joint_get_flag ( RID joint, PinJointFlag flag ) virtual const |
|
_pin_joint_get_param ( RID joint, PinJointParam param ) virtual const |
|
void |
_pin_joint_set_flag ( RID joint, PinJointFlag flag, bool enabled ) virtual |
void |
_pin_joint_set_param ( RID joint, PinJointParam param, float value ) virtual |
_rectangle_shape_create ( ) virtual |
|
_segment_shape_create ( ) virtual |
|
_separation_ray_shape_create ( ) virtual |
|
void |
_set_active ( bool active ) virtual |
_shape_collide ( RID shape_A, Transform2D xform_A, Vector2 motion_A, RID shape_B, Transform2D xform_B, Vector2 motion_B, void* results, int result_max, int32_t* result_count ) virtual |
|
_shape_get_custom_solver_bias ( RID shape ) virtual const |
|
_shape_get_data ( RID shape ) virtual const |
|
_shape_get_type ( RID shape ) virtual const |
|
void |
_shape_set_custom_solver_bias ( RID shape, float bias ) virtual |
void |
_shape_set_data ( RID shape, Variant data ) virtual |
_space_create ( ) virtual |
|
_space_get_contact_count ( RID space ) virtual const |
|
_space_get_contacts ( RID space ) virtual const |
|
_space_get_direct_state ( RID space ) virtual |
|
_space_get_param ( RID space, SpaceParameter param ) virtual const |
|
_space_is_active ( RID space ) virtual const |
|
void |
_space_set_active ( RID space, bool active ) virtual |
void |
_space_set_debug_contacts ( RID space, int max_contacts ) virtual |
void |
_space_set_param ( RID space, SpaceParameter param, float value ) virtual |
void |
|
void |
_sync ( ) virtual |
_world_boundary_shape_create ( ) virtual |
|
body_test_motion_is_excluding_body ( RID body ) const |
|
body_test_motion_is_excluding_object ( int object ) const |
Method Descriptions¶
void _area_add_shape ( RID area, RID shape, Transform2D transform, bool disabled ) virtual
Overridable version of PhysicsServer2D.area_add_shape.
void _area_attach_canvas_instance_id ( RID area, int id ) virtual
Overridable version of PhysicsServer2D.area_attach_canvas_instance_id.
void _area_attach_object_instance_id ( RID area, int id ) virtual
Overridable version of PhysicsServer2D.area_attach_object_instance_id.
void _area_clear_shapes ( RID area ) virtual
Overridable version of PhysicsServer2D.area_clear_shapes.
RID _area_create ( ) virtual
Overridable version of PhysicsServer2D.area_create.
int _area_get_canvas_instance_id ( RID area ) virtual const
Overridable version of PhysicsServer2D.area_get_canvas_instance_id.
int _area_get_collision_layer ( RID area ) virtual const
Overridable version of PhysicsServer2D.area_get_collision_layer.
int _area_get_collision_mask ( RID area ) virtual const
Overridable version of PhysicsServer2D.area_get_collision_mask.
int _area_get_object_instance_id ( RID area ) virtual const
Overridable version of PhysicsServer2D.area_get_object_instance_id.
Variant _area_get_param ( RID area, AreaParameter param ) virtual const
Overridable version of PhysicsServer2D.area_get_param.
RID _area_get_shape ( RID area, int shape_idx ) virtual const
Overridable version of PhysicsServer2D.area_get_shape.
int _area_get_shape_count ( RID area ) virtual const
Overridable version of PhysicsServer2D.area_get_shape_count.
Transform2D _area_get_shape_transform ( RID area, int shape_idx ) virtual const
Overridable version of PhysicsServer2D.area_get_shape_transform.
RID _area_get_space ( RID area ) virtual const
Overridable version of PhysicsServer2D.area_get_space.
Transform2D _area_get_transform ( RID area ) virtual const
Overridable version of PhysicsServer2D.area_get_transform.
void _area_remove_shape ( RID area, int shape_idx ) virtual
Overridable version of PhysicsServer2D.area_remove_shape.
void _area_set_area_monitor_callback ( RID area, Callable callback ) virtual
Overridable version of PhysicsServer2D.area_set_area_monitor_callback.
void _area_set_collision_layer ( RID area, int layer ) virtual
Overridable version of PhysicsServer2D.area_set_collision_layer.
void _area_set_collision_mask ( RID area, int mask ) virtual
Overridable version of PhysicsServer2D.area_set_collision_mask.
void _area_set_monitor_callback ( RID area, Callable callback ) virtual
Overridable version of PhysicsServer2D.area_set_monitor_callback.
void _area_set_monitorable ( RID area, bool monitorable ) virtual
Overridable version of PhysicsServer2D.area_set_monitorable.
void _area_set_param ( RID area, AreaParameter param, Variant value ) virtual
Overridable version of PhysicsServer2D.area_set_param.
void _area_set_pickable ( RID area, bool pickable ) virtual
If set to true
, allows the area with the given RID to detect mouse inputs when the mouse cursor is hovering on it.
Overridable version of PhysicsServer2D's internal area_set_pickable
method. Corresponds to CollisionObject2D.input_pickable.
void _area_set_shape ( RID area, int shape_idx, RID shape ) virtual
Overridable version of PhysicsServer2D.area_set_shape.
void _area_set_shape_disabled ( RID area, int shape_idx, bool disabled ) virtual
Overridable version of PhysicsServer2D.area_set_shape_disabled.
void _area_set_shape_transform ( RID area, int shape_idx, Transform2D transform ) virtual
Overridable version of PhysicsServer2D.area_set_shape_transform.
void _area_set_space ( RID area, RID space ) virtual
Overridable version of PhysicsServer2D.area_set_space.
void _area_set_transform ( RID area, Transform2D transform ) virtual
Overridable version of PhysicsServer2D.area_set_transform.
void _body_add_collision_exception ( RID body, RID excepted_body ) virtual
Overridable version of PhysicsServer2D.body_add_collision_exception.
void _body_add_constant_central_force ( RID body, Vector2 force ) virtual
Overridable version of PhysicsServer2D.body_add_constant_central_force.
void _body_add_constant_force ( RID body, Vector2 force, Vector2 position ) virtual
Overridable version of PhysicsServer2D.body_add_constant_force.
void _body_add_constant_torque ( RID body, float torque ) virtual
Overridable version of PhysicsServer2D.body_add_constant_torque.
void _body_add_shape ( RID body, RID shape, Transform2D transform, bool disabled ) virtual
Overridable version of PhysicsServer2D.body_add_shape.
void _body_apply_central_force ( RID body, Vector2 force ) virtual
Overridable version of PhysicsServer2D.body_apply_central_force.
void _body_apply_central_impulse ( RID body, Vector2 impulse ) virtual
Overridable version of PhysicsServer2D.body_apply_central_impulse.
void _body_apply_force ( RID body, Vector2 force, Vector2 position ) virtual
Overridable version of PhysicsServer2D.body_apply_force.
void _body_apply_impulse ( RID body, Vector2 impulse, Vector2 position ) virtual
Overridable version of PhysicsServer2D.body_apply_impulse.
void _body_apply_torque ( RID body, float torque ) virtual
Overridable version of PhysicsServer2D.body_apply_torque.
void _body_apply_torque_impulse ( RID body, float impulse ) virtual
Overridable version of PhysicsServer2D.body_apply_torque_impulse.
void _body_attach_canvas_instance_id ( RID body, int id ) virtual
Overridable version of PhysicsServer2D.body_attach_canvas_instance_id.
void _body_attach_object_instance_id ( RID body, int id ) virtual
Overridable version of PhysicsServer2D.body_attach_object_instance_id.
void _body_clear_shapes ( RID body ) virtual
Overridable version of PhysicsServer2D.body_clear_shapes.
bool _body_collide_shape ( RID body, int body_shape, RID shape, Transform2D shape_xform, Vector2 motion, void* results, int result_max, int32_t* result_count ) virtual
Given a body
, a shape
, and their respective parameters, this method should return true
if a collision between the two would occur, with additional details passed in results
.
Overridable version of PhysicsServer2D's internal shape_collide
method. Corresponds to PhysicsDirectSpaceState2D.collide_shape.
RID _body_create ( ) virtual
Overridable version of PhysicsServer2D.body_create.
int _body_get_canvas_instance_id ( RID body ) virtual const
Overridable version of PhysicsServer2D.body_get_canvas_instance_id.
RID[] _body_get_collision_exceptions ( RID body ) virtual const
Returns the RIDs of all bodies added as collision exceptions for the given body
. See also _body_add_collision_exception and _body_remove_collision_exception.
Overridable version of PhysicsServer2D's internal body_get_collision_exceptions
method. Corresponds to PhysicsBody2D.get_collision_exceptions.
int _body_get_collision_layer ( RID body ) virtual const
Overridable version of PhysicsServer2D.body_get_collision_layer.
int _body_get_collision_mask ( RID body ) virtual const
Overridable version of PhysicsServer2D.body_get_collision_mask.
float _body_get_collision_priority ( RID body ) virtual const
Overridable version of PhysicsServer2D.body_get_collision_priority.
Vector2 _body_get_constant_force ( RID body ) virtual const
Overridable version of PhysicsServer2D.body_get_constant_force.
float _body_get_constant_torque ( RID body ) virtual const
Overridable version of PhysicsServer2D.body_get_constant_torque.
float _body_get_contacts_reported_depth_threshold ( RID body ) virtual const
Overridable version of PhysicsServer2D's internal body_get_contacts_reported_depth_threshold
method.
Note: This method is currently unused by Godot's default physics implementation.
CCDMode _body_get_continuous_collision_detection_mode ( RID body ) virtual const
Overridable version of PhysicsServer2D.body_get_continuous_collision_detection_mode.
PhysicsDirectBodyState2D _body_get_direct_state ( RID body ) virtual
Overridable version of PhysicsServer2D.body_get_direct_state.
int _body_get_max_contacts_reported ( RID body ) virtual const
Overridable version of PhysicsServer2D.body_get_max_contacts_reported.
BodyMode _body_get_mode ( RID body ) virtual const
Overridable version of PhysicsServer2D.body_get_mode.
int _body_get_object_instance_id ( RID body ) virtual const
Overridable version of PhysicsServer2D.body_get_object_instance_id.
Variant _body_get_param ( RID body, BodyParameter param ) virtual const
Overridable version of PhysicsServer2D.body_get_param.
RID _body_get_shape ( RID body, int shape_idx ) virtual const
Overridable version of PhysicsServer2D.body_get_shape.
int _body_get_shape_count ( RID body ) virtual const
Overridable version of PhysicsServer2D.body_get_shape_count.
Transform2D _body_get_shape_transform ( RID body, int shape_idx ) virtual const
Overridable version of PhysicsServer2D.body_get_shape_transform.
RID _body_get_space ( RID body ) virtual const
Overridable version of PhysicsServer2D.body_get_space.
Variant _body_get_state ( RID body, BodyState state ) virtual const
Overridable version of PhysicsServer2D.body_get_state.
bool _body_is_omitting_force_integration ( RID body ) virtual const
Overridable version of PhysicsServer2D.body_is_omitting_force_integration.
void _body_remove_collision_exception ( RID body, RID excepted_body ) virtual
Overridable version of PhysicsServer2D.body_remove_collision_exception.
void _body_remove_shape ( RID body, int shape_idx ) virtual
Overridable version of PhysicsServer2D.body_remove_shape.
void _body_reset_mass_properties ( RID body ) virtual
Overridable version of PhysicsServer2D.body_reset_mass_properties.
void _body_set_axis_velocity ( RID body, Vector2 axis_velocity ) virtual
Overridable version of PhysicsServer2D.body_set_axis_velocity.
void _body_set_collision_layer ( RID body, int layer ) virtual
Overridable version of PhysicsServer2D.body_set_collision_layer.
void _body_set_collision_mask ( RID body, int mask ) virtual
Overridable version of PhysicsServer2D.body_set_collision_mask.
void _body_set_collision_priority ( RID body, float priority ) virtual
Overridable version of PhysicsServer2D.body_set_collision_priority.
void _body_set_constant_force ( RID body, Vector2 force ) virtual
Overridable version of PhysicsServer2D.body_set_constant_force.
void _body_set_constant_torque ( RID body, float torque ) virtual
Overridable version of PhysicsServer2D.body_set_constant_torque.
void _body_set_contacts_reported_depth_threshold ( RID body, float threshold ) virtual
Overridable version of PhysicsServer2D's internal body_set_contacts_reported_depth_threshold
method.
Note: This method is currently unused by Godot's default physics implementation.
void _body_set_continuous_collision_detection_mode ( RID body, CCDMode mode ) virtual
Overridable version of PhysicsServer2D.body_set_continuous_collision_detection_mode.
void _body_set_force_integration_callback ( RID body, Callable callable, Variant userdata ) virtual
Overridable version of PhysicsServer2D.body_set_force_integration_callback.
void _body_set_max_contacts_reported ( RID body, int amount ) virtual
Overridable version of PhysicsServer2D.body_set_max_contacts_reported.
void _body_set_mode ( RID body, BodyMode mode ) virtual
Overridable version of PhysicsServer2D.body_set_mode.
void _body_set_omit_force_integration ( RID body, bool enable ) virtual
Overridable version of PhysicsServer2D.body_set_omit_force_integration.
void _body_set_param ( RID body, BodyParameter param, Variant value ) virtual
Overridable version of PhysicsServer2D.body_set_param.
void _body_set_pickable ( RID body, bool pickable ) virtual
If set to true
, allows the body with the given RID to detect mouse inputs when the mouse cursor is hovering on it.
Overridable version of PhysicsServer2D's internal body_set_pickable
method. Corresponds to CollisionObject2D.input_pickable.
void _body_set_shape ( RID body, int shape_idx, RID shape ) virtual
Overridable version of PhysicsServer2D.body_set_shape.
void _body_set_shape_as_one_way_collision ( RID body, int shape_idx, bool enable, float margin ) virtual
Overridable version of PhysicsServer2D.body_set_shape_as_one_way_collision.
void _body_set_shape_disabled ( RID body, int shape_idx, bool disabled ) virtual
Overridable version of PhysicsServer2D.body_set_shape_disabled.
void _body_set_shape_transform ( RID body, int shape_idx, Transform2D transform ) virtual
Overridable version of PhysicsServer2D.body_set_shape_transform.
void _body_set_space ( RID body, RID space ) virtual
Overridable version of PhysicsServer2D.body_set_space.
void _body_set_state ( RID body, BodyState state, Variant value ) virtual
Overridable version of PhysicsServer2D.body_set_state.
void _body_set_state_sync_callback ( RID body, Callable callable ) virtual
Assigns the body
to call the given callable
during the synchronization phase of the loop, before _step is called. See also _sync.
Overridable version of PhysicsServer2D's internal body_set_state_sync_callback
method.
bool _body_test_motion ( RID body, Transform2D from, Vector2 motion, float margin, bool collide_separation_ray, bool recovery_as_collision, PhysicsServer2DExtensionMotionResult* result ) virtual const
Overridable version of PhysicsServer2D.body_test_motion. Unlike the exposed implementation, this method does not receive all of the arguments inside a PhysicsTestMotionParameters2D.
RID _capsule_shape_create ( ) virtual
Overridable version of PhysicsServer2D.capsule_shape_create.
RID _circle_shape_create ( ) virtual
Overridable version of PhysicsServer2D.circle_shape_create.
RID _concave_polygon_shape_create ( ) virtual
Overridable version of PhysicsServer2D.concave_polygon_shape_create.
RID _convex_polygon_shape_create ( ) virtual
Overridable version of PhysicsServer2D.convex_polygon_shape_create.
float _damped_spring_joint_get_param ( RID joint, DampedSpringParam param ) virtual const
Overridable version of PhysicsServer2D.damped_spring_joint_get_param.
void _damped_spring_joint_set_param ( RID joint, DampedSpringParam param, float value ) virtual
Overridable version of PhysicsServer2D.damped_spring_joint_set_param.
void _end_sync ( ) virtual
Called to indicate that the physics server has stopped synchronizing. It is in the loop's iteration/physics phase, and can access physics objects even if running on a separate thread. See also _sync.
Overridable version of PhysicsServer2D's internal end_sync
method.
void _finish ( ) virtual
Called when the main loop finalizes to shut down the physics server. See also MainLoop._finalize and _init.
Overridable version of PhysicsServer2D's internal finish
method.
void _flush_queries ( ) virtual
Called every physics step before _step to process all remaining queries.
Overridable version of PhysicsServer2D's internal flush_queries
method.
void _free_rid ( RID rid ) virtual
Overridable version of PhysicsServer2D.free_rid.
int _get_process_info ( ProcessInfo process_info ) virtual
Overridable version of PhysicsServer2D.get_process_info.
void _init ( ) virtual
Called when the main loop is initialized and creates a new instance of this physics server. See also MainLoop._initialize and _finish.
Overridable version of PhysicsServer2D's internal init
method.
bool _is_flushing_queries ( ) virtual const
Overridable method that should return true
when the physics server is processing queries. See also _flush_queries.
Overridable version of PhysicsServer2D's internal is_flushing_queries
method.
void _joint_clear ( RID joint ) virtual
Overridable version of PhysicsServer2D.joint_clear.
RID _joint_create ( ) virtual
Overridable version of PhysicsServer2D.joint_create.
void _joint_disable_collisions_between_bodies ( RID joint, bool disable ) virtual
Overridable version of PhysicsServer2D.joint_disable_collisions_between_bodies.
float _joint_get_param ( RID joint, JointParam param ) virtual const
Overridable version of PhysicsServer2D.joint_get_param.
JointType _joint_get_type ( RID joint ) virtual const
Overridable version of PhysicsServer2D.joint_get_type.
bool _joint_is_disabled_collisions_between_bodies ( RID joint ) virtual const
Overridable version of PhysicsServer2D.joint_is_disabled_collisions_between_bodies.
void _joint_make_damped_spring ( RID joint, Vector2 anchor_a, Vector2 anchor_b, RID body_a, RID body_b ) virtual
Overridable version of PhysicsServer2D.joint_make_damped_spring.
void _joint_make_groove ( RID joint, Vector2 a_groove1, Vector2 a_groove2, Vector2 b_anchor, RID body_a, RID body_b ) virtual
Overridable version of PhysicsServer2D.joint_make_groove.
void _joint_make_pin ( RID joint, Vector2 anchor, RID body_a, RID body_b ) virtual
Overridable version of PhysicsServer2D.joint_make_pin.
void _joint_set_param ( RID joint, JointParam param, float value ) virtual
Overridable version of PhysicsServer2D.joint_set_param.
bool _pin_joint_get_flag ( RID joint, PinJointFlag flag ) virtual const
Overridable version of PhysicsServer2D.pin_joint_get_flag.
float _pin_joint_get_param ( RID joint, PinJointParam param ) virtual const
Overridable version of PhysicsServer2D.pin_joint_get_param.
void _pin_joint_set_flag ( RID joint, PinJointFlag flag, bool enabled ) virtual
Overridable version of PhysicsServer2D.pin_joint_set_flag.
void _pin_joint_set_param ( RID joint, PinJointParam param, float value ) virtual
Overridable version of PhysicsServer2D.pin_joint_set_param.
RID _rectangle_shape_create ( ) virtual
Overridable version of PhysicsServer2D.rectangle_shape_create.
RID _segment_shape_create ( ) virtual
Overridable version of PhysicsServer2D.segment_shape_create.
RID _separation_ray_shape_create ( ) virtual
Overridable version of PhysicsServer2D.separation_ray_shape_create.
void _set_active ( bool active ) virtual
Overridable version of PhysicsServer2D.set_active.
bool _shape_collide ( RID shape_A, Transform2D xform_A, Vector2 motion_A, RID shape_B, Transform2D xform_B, Vector2 motion_B, void* results, int result_max, int32_t* result_count ) virtual
Given two shapes and their parameters, should return true
if a collision between the two would occur, with additional details passed in results
.
Overridable version of PhysicsServer2D's internal shape_collide
method. Corresponds to PhysicsDirectSpaceState2D.collide_shape.
float _shape_get_custom_solver_bias ( RID shape ) virtual const
Should return the custom solver bias of the given shape
, which defines how much bodies are forced to separate on contact when this shape is involved.
Overridable version of PhysicsServer2D's internal shape_get_custom_solver_bias
method. Corresponds to Shape2D.custom_solver_bias.
Variant _shape_get_data ( RID shape ) virtual const
Overridable version of PhysicsServer2D.shape_get_data.
ShapeType _shape_get_type ( RID shape ) virtual const
Overridable version of PhysicsServer2D.shape_get_type.
void _shape_set_custom_solver_bias ( RID shape, float bias ) virtual
Should set the custom solver bias for the given shape
. It defines how much bodies are forced to separate on contact.
Overridable version of PhysicsServer2D's internal shape_get_custom_solver_bias
method. Corresponds to Shape2D.custom_solver_bias.
void _shape_set_data ( RID shape, Variant data ) virtual
Overridable version of PhysicsServer2D.shape_set_data.
RID _space_create ( ) virtual
Overridable version of PhysicsServer2D.space_create.
int _space_get_contact_count ( RID space ) virtual const
Should return how many contacts have occurred during the last physics step in the given space
. See also _space_get_contacts and _space_set_debug_contacts.
Overridable version of PhysicsServer2D's internal space_get_contact_count
method.
PackedVector2Array _space_get_contacts ( RID space ) virtual const
Should return the positions of all contacts that have occurred during the last physics step in the given space
. See also _space_get_contact_count and _space_set_debug_contacts.
Overridable version of PhysicsServer2D's internal space_get_contacts
method.
PhysicsDirectSpaceState2D _space_get_direct_state ( RID space ) virtual
Overridable version of PhysicsServer2D.space_get_direct_state.
float _space_get_param ( RID space, SpaceParameter param ) virtual const
Overridable version of PhysicsServer2D.space_get_param.
bool _space_is_active ( RID space ) virtual const
Overridable version of PhysicsServer2D.space_is_active.
void _space_set_active ( RID space, bool active ) virtual
Overridable version of PhysicsServer2D.space_set_active.
void _space_set_debug_contacts ( RID space, int max_contacts ) virtual
Used internally to allow the given space
to store contact points, up to max_contacts
. This is automatically set for the main World2D's space when SceneTree.debug_collisions_hint is true
, or by checking "Visible Collision Shapes" in the editor. Only works in debug builds.
Overridable version of PhysicsServer2D's internal space_set_debug_contacts
method.
void _space_set_param ( RID space, SpaceParameter param, float value ) virtual
Overridable version of PhysicsServer2D.space_set_param.
void _step ( float step ) virtual
Called every physics step to process the physics simulation. step
is the time elapsed since the last physics step, in seconds. It is usually the same as Node.get_physics_process_delta_time.
Overridable version of PhysicsServer2D's internal step
method.
void _sync ( ) virtual
Called to indicate that the physics server is synchronizing and cannot access physics states if running on a separate thread. See also _end_sync.
Overridable version of PhysicsServer2D's internal sync
method.
RID _world_boundary_shape_create ( ) virtual
Overridable version of PhysicsServer2D.world_boundary_shape_create.
bool body_test_motion_is_excluding_body ( RID body ) const
Returns true
if the body with the given RID is being excluded from _body_test_motion. See also Object.get_instance_id.
bool body_test_motion_is_excluding_object ( int object ) const
Returns true
if the object with the given instance ID is being excluded from _body_test_motion. See also Object.get_instance_id.