Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

PhysicsServer2DExtension

继承: PhysicsServer2D < Object

提供覆盖后可以用来创建自定义 PhysicsServer2D 实现的虚方法。

描述

这个类扩展自 PhysicsServer2D,提供可额外的可覆盖虚方法。覆盖这些方法后,就不会调用物理服务器内部方法,而是调用这些覆盖后的方法。

旨在用于 GDExtension,用于创建自定义 PhysicsServer2D 实现。

方法

void

_area_add_shape(area: RID, shape: RID, transform: Transform2D, disabled: bool) virtual

void

_area_attach_canvas_instance_id(area: RID, id: int) virtual

void

_area_attach_object_instance_id(area: RID, id: int) virtual

void

_area_clear_shapes(area: RID) virtual

RID

_area_create() virtual

int

_area_get_canvas_instance_id(area: RID) virtual const

int

_area_get_collision_layer(area: RID) virtual const

int

_area_get_collision_mask(area: RID) virtual const

int

_area_get_object_instance_id(area: RID) virtual const

Variant

_area_get_param(area: RID, param: AreaParameter) virtual const

RID

_area_get_shape(area: RID, shape_idx: int) virtual const

int

_area_get_shape_count(area: RID) virtual const

Transform2D

_area_get_shape_transform(area: RID, shape_idx: int) virtual const

RID

_area_get_space(area: RID) virtual const

Transform2D

_area_get_transform(area: RID) virtual const

void

_area_remove_shape(area: RID, shape_idx: int) virtual

void

_area_set_area_monitor_callback(area: RID, callback: Callable) virtual

void

_area_set_collision_layer(area: RID, layer: int) virtual

void

_area_set_collision_mask(area: RID, mask: int) virtual

void

_area_set_monitor_callback(area: RID, callback: Callable) virtual

void

_area_set_monitorable(area: RID, monitorable: bool) virtual

void

_area_set_param(area: RID, param: AreaParameter, value: Variant) virtual

void

_area_set_pickable(area: RID, pickable: bool) virtual

void

_area_set_shape(area: RID, shape_idx: int, shape: RID) virtual

void

_area_set_shape_disabled(area: RID, shape_idx: int, disabled: bool) virtual

void

_area_set_shape_transform(area: RID, shape_idx: int, transform: Transform2D) virtual

void

_area_set_space(area: RID, space: RID) virtual

void

_area_set_transform(area: RID, transform: Transform2D) virtual

void

_body_add_collision_exception(body: RID, excepted_body: RID) virtual

void

_body_add_constant_central_force(body: RID, force: Vector2) virtual

void

_body_add_constant_force(body: RID, force: Vector2, position: Vector2) virtual

void

_body_add_constant_torque(body: RID, torque: float) virtual

void

_body_add_shape(body: RID, shape: RID, transform: Transform2D, disabled: bool) virtual

void

_body_apply_central_force(body: RID, force: Vector2) virtual

void

_body_apply_central_impulse(body: RID, impulse: Vector2) virtual

void

_body_apply_force(body: RID, force: Vector2, position: Vector2) virtual

void

_body_apply_impulse(body: RID, impulse: Vector2, position: Vector2) virtual

void

_body_apply_torque(body: RID, torque: float) virtual

void

_body_apply_torque_impulse(body: RID, impulse: float) virtual

void

_body_attach_canvas_instance_id(body: RID, id: int) virtual

void

_body_attach_object_instance_id(body: RID, id: int) virtual

void

_body_clear_shapes(body: RID) virtual

bool

_body_collide_shape(body: RID, body_shape: int, shape: RID, shape_xform: Transform2D, motion: Vector2, results: void*, result_max: int, result_count: int32_t*) virtual

RID

_body_create() virtual

int

_body_get_canvas_instance_id(body: RID) virtual const

Array[RID]

_body_get_collision_exceptions(body: RID) virtual const

int

_body_get_collision_layer(body: RID) virtual const

int

_body_get_collision_mask(body: RID) virtual const

float

_body_get_collision_priority(body: RID) virtual const

Vector2

_body_get_constant_force(body: RID) virtual const

float

_body_get_constant_torque(body: RID) virtual const

float

_body_get_contacts_reported_depth_threshold(body: RID) virtual const

CCDMode

_body_get_continuous_collision_detection_mode(body: RID) virtual const

PhysicsDirectBodyState2D

_body_get_direct_state(body: RID) virtual

int

_body_get_max_contacts_reported(body: RID) virtual const

BodyMode

_body_get_mode(body: RID) virtual const

int

_body_get_object_instance_id(body: RID) virtual const

Variant

_body_get_param(body: RID, param: BodyParameter) virtual const

RID

_body_get_shape(body: RID, shape_idx: int) virtual const

int

_body_get_shape_count(body: RID) virtual const

Transform2D

_body_get_shape_transform(body: RID, shape_idx: int) virtual const

RID

_body_get_space(body: RID) virtual const

Variant

_body_get_state(body: RID, state: BodyState) virtual const

bool

_body_is_omitting_force_integration(body: RID) virtual const

void

_body_remove_collision_exception(body: RID, excepted_body: RID) virtual

void

_body_remove_shape(body: RID, shape_idx: int) virtual

void

_body_reset_mass_properties(body: RID) virtual

void

_body_set_axis_velocity(body: RID, axis_velocity: Vector2) virtual

void

_body_set_collision_layer(body: RID, layer: int) virtual

void

_body_set_collision_mask(body: RID, mask: int) virtual

void

_body_set_collision_priority(body: RID, priority: float) virtual

void

_body_set_constant_force(body: RID, force: Vector2) virtual

void

_body_set_constant_torque(body: RID, torque: float) virtual

void

_body_set_contacts_reported_depth_threshold(body: RID, threshold: float) virtual

void

_body_set_continuous_collision_detection_mode(body: RID, mode: CCDMode) virtual

void

_body_set_force_integration_callback(body: RID, callable: Callable, userdata: Variant) virtual

void

_body_set_max_contacts_reported(body: RID, amount: int) virtual

void

_body_set_mode(body: RID, mode: BodyMode) virtual

void

_body_set_omit_force_integration(body: RID, enable: bool) virtual

void

_body_set_param(body: RID, param: BodyParameter, value: Variant) virtual

void

_body_set_pickable(body: RID, pickable: bool) virtual

void

_body_set_shape(body: RID, shape_idx: int, shape: RID) virtual

void

_body_set_shape_as_one_way_collision(body: RID, shape_idx: int, enable: bool, margin: float) virtual

void

_body_set_shape_disabled(body: RID, shape_idx: int, disabled: bool) virtual

void

_body_set_shape_transform(body: RID, shape_idx: int, transform: Transform2D) virtual

void

_body_set_space(body: RID, space: RID) virtual

void

_body_set_state(body: RID, state: BodyState, value: Variant) virtual

void

_body_set_state_sync_callback(body: RID, callable: Callable) virtual

bool

_body_test_motion(body: RID, from: Transform2D, motion: Vector2, margin: float, collide_separation_ray: bool, recovery_as_collision: bool, result: PhysicsServer2DExtensionMotionResult*) virtual const

RID

_capsule_shape_create() virtual

RID

_circle_shape_create() virtual

RID

_concave_polygon_shape_create() virtual

RID

_convex_polygon_shape_create() virtual

float

_damped_spring_joint_get_param(joint: RID, param: DampedSpringParam) virtual const

void

_damped_spring_joint_set_param(joint: