2014-02-10 02:10:30 +01:00
|
|
|
/*************************************************************************/
|
2020-03-28 13:19:05 +01:00
|
|
|
/* physics_server_2d_sw.h */
|
2014-02-10 02:10:30 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
2017-08-27 14:16:55 +02:00
|
|
|
/* https://godotengine.org */
|
2014-02-10 02:10:30 +01:00
|
|
|
/*************************************************************************/
|
2021-01-01 20:13:46 +01:00
|
|
|
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
|
2014-02-10 02:10:30 +01:00
|
|
|
/* */
|
|
|
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
|
|
/* a copy of this software and associated documentation files (the */
|
|
|
|
/* "Software"), to deal in the Software without restriction, including */
|
|
|
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
|
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
|
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
|
|
/* the following conditions: */
|
|
|
|
/* */
|
|
|
|
/* The above copyright notice and this permission notice shall be */
|
|
|
|
/* included in all copies or substantial portions of the Software. */
|
|
|
|
/* */
|
|
|
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
|
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
|
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
|
|
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
|
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
|
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
|
|
/*************************************************************************/
|
2018-01-05 00:50:27 +01:00
|
|
|
|
2014-02-10 02:10:30 +01:00
|
|
|
#ifndef PHYSICS_2D_SERVER_SW
|
|
|
|
#define PHYSICS_2D_SERVER_SW
|
|
|
|
|
2020-11-07 23:33:38 +01:00
|
|
|
#include "core/templates/rid_owner.h"
|
2017-03-05 16:44:50 +01:00
|
|
|
#include "joints_2d_sw.h"
|
2020-03-27 19:21:27 +01:00
|
|
|
#include "servers/physics_server_2d.h"
|
2014-02-10 02:10:30 +01:00
|
|
|
#include "shape_2d_sw.h"
|
|
|
|
#include "space_2d_sw.h"
|
|
|
|
#include "step_2d_sw.h"
|
|
|
|
|
2020-03-27 19:21:27 +01:00
|
|
|
class PhysicsServer2DSW : public PhysicsServer2D {
|
|
|
|
GDCLASS(PhysicsServer2DSW, PhysicsServer2D);
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-03-28 13:19:05 +01:00
|
|
|
friend class PhysicsDirectSpaceState2DSW;
|
|
|
|
friend class PhysicsDirectBodyState2DSW;
|
2014-02-10 02:10:30 +01:00
|
|
|
bool active;
|
|
|
|
int iterations;
|
|
|
|
bool doing_sync;
|
|
|
|
real_t last_step;
|
|
|
|
|
2014-09-03 04:13:40 +02:00
|
|
|
int island_count;
|
|
|
|
int active_objects;
|
|
|
|
int collision_pairs;
|
|
|
|
|
2015-05-26 06:05:08 +02:00
|
|
|
bool using_threads;
|
|
|
|
|
2018-11-16 12:49:26 +01:00
|
|
|
bool flushing_queries;
|
|
|
|
|
2014-02-10 02:10:30 +01:00
|
|
|
Step2DSW *stepper;
|
2017-03-05 16:44:50 +01:00
|
|
|
Set<const Space2DSW *> active_spaces;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-03-28 13:19:05 +01:00
|
|
|
PhysicsDirectBodyState2DSW *direct_state;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2019-06-10 17:38:51 +02:00
|
|
|
mutable RID_PtrOwner<Shape2DSW> shape_owner;
|
|
|
|
mutable RID_PtrOwner<Space2DSW> space_owner;
|
|
|
|
mutable RID_PtrOwner<Area2DSW> area_owner;
|
|
|
|
mutable RID_PtrOwner<Body2DSW> body_owner;
|
|
|
|
mutable RID_PtrOwner<Joint2DSW> joint_owner;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-03-27 19:21:27 +01:00
|
|
|
static PhysicsServer2DSW *singletonsw;
|
2014-02-23 00:28:19 +01:00
|
|
|
|
2017-01-14 12:26:56 +01:00
|
|
|
//void _clear_query(Query2DSW *p_query);
|
2019-06-21 13:33:01 +02:00
|
|
|
friend class CollisionObject2DSW;
|
|
|
|
SelfList<CollisionObject2DSW>::List pending_shape_update_list;
|
|
|
|
void _update_shapes();
|
2017-11-10 03:34:01 +01:00
|
|
|
|
|
|
|
RID _shape_create(ShapeType p_shape);
|
|
|
|
|
2014-02-23 00:28:19 +01:00
|
|
|
public:
|
2014-02-19 15:57:14 +01:00
|
|
|
struct CollCbkData {
|
2015-01-14 01:19:11 +01:00
|
|
|
Vector2 valid_dir;
|
2017-02-14 00:25:05 +01:00
|
|
|
real_t valid_depth;
|
2014-02-19 15:57:14 +01:00
|
|
|
int max;
|
|
|
|
int amount;
|
2019-01-18 18:15:05 +01:00
|
|
|
int passed;
|
2017-09-01 03:55:01 +02:00
|
|
|
int invalid_by_dir;
|
2014-02-19 15:57:14 +01:00
|
|
|
Vector2 *ptr;
|
|
|
|
};
|
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual RID line_shape_create() override;
|
|
|
|
virtual RID ray_shape_create() override;
|
|
|
|
virtual RID segment_shape_create() override;
|
|
|
|
virtual RID circle_shape_create() override;
|
|
|
|
virtual RID rectangle_shape_create() override;
|
|
|
|
virtual RID capsule_shape_create() override;
|
|
|
|
virtual RID convex_polygon_shape_create() override;
|
|
|
|
virtual RID concave_polygon_shape_create() override;
|
2017-11-10 03:34:01 +01:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
static void _shape_col_cbk(const Vector2 &p_point_A, const Vector2 &p_point_B, void *p_userdata);
|
2014-02-19 15:57:14 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void shape_set_data(RID p_shape, const Variant &p_data) override;
|
|
|
|
virtual void shape_set_custom_solver_bias(RID p_shape, real_t p_bias) override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual ShapeType shape_get_type(RID p_shape) const override;
|
|
|
|
virtual Variant shape_get_data(RID p_shape) const override;
|
|
|
|
virtual real_t shape_get_custom_solver_bias(RID p_shape) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual bool shape_collide(RID p_shape_A, const Transform2D &p_xform_A, const Vector2 &p_motion_A, RID p_shape_B, const Transform2D &p_xform_B, const Vector2 &p_motion_B, Vector2 *r_results, int p_result_max, int &r_result_count) override;
|
2014-02-19 15:57:14 +01:00
|
|
|
|
2014-02-10 02:10:30 +01:00
|
|
|
/* SPACE API */
|
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual RID space_create() override;
|
|
|
|
virtual void space_set_active(RID p_space, bool p_active) override;
|
|
|
|
virtual bool space_is_active(RID p_space) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void space_set_param(RID p_space, SpaceParameter p_param, real_t p_value) override;
|
|
|
|
virtual real_t space_get_param(RID p_space, SpaceParameter p_param) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void space_set_debug_contacts(RID p_space, int p_max_contacts) override;
|
|
|
|
virtual Vector<Vector2> space_get_contacts(RID p_space) const override;
|
|
|
|
virtual int space_get_contact_count(RID p_space) const override;
|
2015-09-20 18:03:46 +02:00
|
|
|
|
2017-09-30 16:19:07 +02:00
|
|
|
// this function only works on physics process, errors and returns null otherwise
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual PhysicsDirectSpaceState2D *space_get_direct_state(RID p_space) override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
|
|
|
/* AREA API */
|
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual RID area_create() override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void area_set_space_override_mode(RID p_area, AreaSpaceOverrideMode p_mode) override;
|
|
|
|
virtual AreaSpaceOverrideMode area_get_space_override_mode(RID p_area) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void area_set_space(RID p_area, RID p_space) override;
|
|
|
|
virtual RID area_get_space(RID p_area) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void area_add_shape(RID p_area, RID p_shape, const Transform2D &p_transform = Transform2D(), bool p_disabled = false) override;
|
|
|
|
virtual void area_set_shape(RID p_area, int p_shape_idx, RID p_shape) override;
|
|
|
|
virtual void area_set_shape_transform(RID p_area, int p_shape_idx, const Transform2D &p_transform) override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual int area_get_shape_count(RID p_area) const override;
|
|
|
|
virtual RID area_get_shape(RID p_area, int p_shape_idx) const override;
|
|
|
|
virtual Transform2D area_get_shape_transform(RID p_area, int p_shape_idx) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void area_set_shape_disabled(RID p_area, int p_shape, bool p_disabled) override;
|
2017-06-24 04:30:43 +02:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void area_remove_shape(RID p_area, int p_shape_idx) override;
|
|
|
|
virtual void area_clear_shapes(RID p_area) override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void area_attach_object_instance_id(RID p_area, ObjectID p_id) override;
|
|
|
|
virtual ObjectID area_get_object_instance_id(RID p_area) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void area_attach_canvas_instance_id(RID p_area, ObjectID p_id) override;
|
|
|
|
virtual ObjectID area_get_canvas_instance_id(RID p_area) const override;
|
2018-08-25 00:03:26 +02:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void area_set_param(RID p_area, AreaParameter p_param, const Variant &p_value) override;
|
|
|
|
virtual void area_set_transform(RID p_area, const Transform2D &p_transform) override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual Variant area_get_param(RID p_area, AreaParameter p_param) const override;
|
|
|
|
virtual Transform2D area_get_transform(RID p_area) const override;
|
|
|
|
virtual void area_set_monitorable(RID p_area, bool p_monitorable) override;
|
|
|
|
virtual void area_set_collision_mask(RID p_area, uint32_t p_mask) override;
|
|
|
|
virtual void area_set_collision_layer(RID p_area, uint32_t p_layer) override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void area_set_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) override;
|
|
|
|
virtual void area_set_area_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) override;
|
2015-03-22 05:46:18 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void area_set_pickable(RID p_area, bool p_pickable) override;
|
2015-03-22 05:46:18 +01:00
|
|
|
|
2014-02-10 02:10:30 +01:00
|
|
|
/* BODY API */
|
|
|
|
|
|
|
|
// create a body of a given type
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual RID body_create() override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_set_space(RID p_body, RID p_space) override;
|
|
|
|
virtual RID body_get_space(RID p_body) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_set_mode(RID p_body, BodyMode p_mode) override;
|
|
|
|
virtual BodyMode body_get_mode(RID p_body) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_add_shape(RID p_body, RID p_shape, const Transform2D &p_transform = Transform2D(), bool p_disabled = false) override;
|
|
|
|
virtual void body_set_shape(RID p_body, int p_shape_idx, RID p_shape) override;
|
|
|
|
virtual void body_set_shape_transform(RID p_body, int p_shape_idx, const Transform2D &p_transform) override;
|
|
|
|
virtual void body_set_shape_metadata(RID p_body, int p_shape_idx, const Variant &p_metadata) override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual int body_get_shape_count(RID p_body) const override;
|
|
|
|
virtual RID body_get_shape(RID p_body, int p_shape_idx) const override;
|
|
|
|
virtual Transform2D body_get_shape_transform(RID p_body, int p_shape_idx) const override;
|
|
|
|
virtual Variant body_get_shape_metadata(RID p_body, int p_shape_idx) const override;
|
2014-10-16 05:06:34 +02:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_remove_shape(RID p_body, int p_shape_idx) override;
|
|
|
|
virtual void body_clear_shapes(RID p_body) override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) override;
|
|
|
|
virtual void body_set_shape_as_one_way_collision(RID p_body, int p_shape_idx, bool p_enable, float p_margin) override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_attach_object_instance_id(RID p_body, ObjectID p_id) override;
|
|
|
|
virtual ObjectID body_get_object_instance_id(RID p_body) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_attach_canvas_instance_id(RID p_body, ObjectID p_id) override;
|
|
|
|
virtual ObjectID body_get_canvas_instance_id(RID p_body) const override;
|
2018-08-25 00:03:26 +02:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_set_continuous_collision_detection_mode(RID p_body, CCDMode p_mode) override;
|
|
|
|
virtual CCDMode body_get_continuous_collision_detection_mode(RID p_body) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_set_collision_layer(RID p_body, uint32_t p_layer) override;
|
|
|
|
virtual uint32_t body_get_collision_layer(RID p_body) const override;
|
2014-05-14 06:22:15 +02:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_set_collision_mask(RID p_body, uint32_t p_mask) override;
|
|
|
|
virtual uint32_t body_get_collision_mask(RID p_body) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_set_param(RID p_body, BodyParameter p_param, real_t p_value) override;
|
|
|
|
virtual real_t body_get_param(RID p_body, BodyParameter p_param) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) override;
|
|
|
|
virtual Variant body_get_state(RID p_body, BodyState p_state) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_set_applied_force(RID p_body, const Vector2 &p_force) override;
|
|
|
|
virtual Vector2 body_get_applied_force(RID p_body) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_set_applied_torque(RID p_body, real_t p_torque) override;
|
|
|
|
virtual real_t body_get_applied_torque(RID p_body) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_add_central_force(RID p_body, const Vector2 &p_force) override;
|
|
|
|
virtual void body_add_force(RID p_body, const Vector2 &p_force, const Vector2 &p_position = Vector2()) override;
|
|
|
|
virtual void body_add_torque(RID p_body, real_t p_torque) override;
|
2016-04-26 14:15:15 +02:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_apply_central_impulse(RID p_body, const Vector2 &p_impulse) override;
|
|
|
|
virtual void body_apply_torque_impulse(RID p_body, real_t p_torque) override;
|
|
|
|
virtual void body_apply_impulse(RID p_body, const Vector2 &p_impulse, const Vector2 &p_position = Vector2()) override;
|
|
|
|
virtual void body_set_axis_velocity(RID p_body, const Vector2 &p_axis_velocity) override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_add_collision_exception(RID p_body, RID p_body_b) override;
|
|
|
|
virtual void body_remove_collision_exception(RID p_body, RID p_body_b) override;
|
|
|
|
virtual void body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_set_contacts_reported_depth_threshold(RID p_body, real_t p_threshold) override;
|
|
|
|
virtual real_t body_get_contacts_reported_depth_threshold(RID p_body) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_set_omit_force_integration(RID p_body, bool p_omit) override;
|
|
|
|
virtual bool body_is_omitting_force_integration(RID p_body) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_set_max_contacts_reported(RID p_body, int p_contacts) override;
|
|
|
|
virtual int body_get_max_contacts_reported(RID p_body) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_set_force_integration_callback(RID p_body, Object *p_receiver, const StringName &p_method, const Variant &p_udata = Variant()) override;
|
|
|
|
virtual bool body_collide_shape(RID p_body, int p_body_shape, RID p_shape, const Transform2D &p_shape_xform, const Vector2 &p_motion, Vector2 *r_results, int p_result_max, int &r_result_count) override;
|
2015-01-14 01:19:11 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void body_set_pickable(RID p_body, bool p_pickable) override;
|
2015-04-20 01:50:55 +02:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual bool body_test_motion(RID p_body, const Transform2D &p_from, const Vector2 &p_motion, bool p_infinite_inertia, real_t p_margin = 0.001, MotionResult *r_result = nullptr, bool p_exclude_raycast_shapes = true) override;
|
|
|
|
virtual int body_test_ray_separation(RID p_body, const Transform2D &p_transform, bool p_infinite_inertia, Vector2 &r_recover_motion, SeparationResult *r_results, int p_result_max, float p_margin = 0.001) override;
|
2015-04-20 01:50:55 +02:00
|
|
|
|
2017-09-29 17:33:30 +02:00
|
|
|
// this function only works on physics process, errors and returns null otherwise
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual PhysicsDirectBodyState2D *body_get_direct_state(RID p_body) override;
|
2017-09-29 17:33:30 +02:00
|
|
|
|
2014-02-10 02:10:30 +01:00
|
|
|
/* JOINT API */
|
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void joint_set_param(RID p_joint, JointParam p_param, real_t p_value) override;
|
|
|
|
virtual real_t joint_get_param(RID p_joint, JointParam p_param) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void joint_disable_collisions_between_bodies(RID p_joint, const bool p_disabled) override;
|
|
|
|
virtual bool joint_is_disabled_collisions_between_bodies(RID p_joint) const override;
|
2018-02-05 18:20:26 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual RID pin_joint_create(const Vector2 &p_pos, RID p_body_a, RID p_body_b = RID()) override;
|
|
|
|
virtual RID groove_joint_create(const Vector2 &p_a_groove1, const Vector2 &p_a_groove2, const Vector2 &p_b_anchor, RID p_body_a, RID p_body_b) override;
|
|
|
|
virtual RID damped_spring_joint_create(const Vector2 &p_anchor_a, const Vector2 &p_anchor_b, RID p_body_a, RID p_body_b = RID()) override;
|
|
|
|
virtual void pin_joint_set_param(RID p_joint, PinJointParam p_param, real_t p_value) override;
|
|
|
|
virtual real_t pin_joint_get_param(RID p_joint, PinJointParam p_param) const override;
|
|
|
|
virtual void damped_spring_joint_set_param(RID p_joint, DampedSpringParam p_param, real_t p_value) override;
|
|
|
|
virtual real_t damped_spring_joint_get_param(RID p_joint, DampedSpringParam p_param) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual JointType joint_get_type(RID p_joint) const override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
|
|
|
/* MISC */
|
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void free(RID p_rid) override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual void set_active(bool p_active) override;
|
|
|
|
virtual void init() override;
|
|
|
|
virtual void step(real_t p_step) override;
|
|
|
|
virtual void sync() override;
|
|
|
|
virtual void flush_queries() override;
|
|
|
|
virtual void end_sync() override;
|
|
|
|
virtual void finish() override;
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
virtual bool is_flushing_queries() const override { return flushing_queries; }
|
2018-11-16 12:49:26 +01:00
|
|
|
|
2020-07-10 12:34:39 +02:00
|
|
|
int get_process_info(ProcessInfo p_info) override;
|
2014-09-03 04:13:40 +02:00
|
|
|
|
2020-03-27 19:21:27 +01:00
|
|
|
PhysicsServer2DSW();
|
2020-05-19 11:24:58 +02:00
|
|
|
~PhysicsServer2DSW() {}
|
2014-02-10 02:10:30 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|