feat: updated engine version to 4.4-rc1
This commit is contained in:
parent
ee00efde1f
commit
21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions
|
|
@ -33,17 +33,16 @@
|
|||
#include "physics_server_3d.h"
|
||||
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/string/print_string.h"
|
||||
#include "core/variant/typed_array.h"
|
||||
|
||||
void PhysicsServer3DRenderingServerHandler::set_vertex(int p_vertex_id, const Vector3 &p_vertex) {
|
||||
GDVIRTUAL_REQUIRED_CALL(_set_vertex, p_vertex_id, p_vertex);
|
||||
GDVIRTUAL_CALL(_set_vertex, p_vertex_id, p_vertex);
|
||||
}
|
||||
void PhysicsServer3DRenderingServerHandler::set_normal(int p_vertex_id, const Vector3 &p_normal) {
|
||||
GDVIRTUAL_REQUIRED_CALL(_set_normal, p_vertex_id, p_normal);
|
||||
GDVIRTUAL_CALL(_set_normal, p_vertex_id, p_normal);
|
||||
}
|
||||
void PhysicsServer3DRenderingServerHandler::set_aabb(const AABB &p_aabb) {
|
||||
GDVIRTUAL_REQUIRED_CALL(_set_aabb, p_aabb);
|
||||
GDVIRTUAL_CALL(_set_aabb, p_aabb);
|
||||
}
|
||||
|
||||
void PhysicsServer3DRenderingServerHandler::_bind_methods() {
|
||||
|
|
@ -356,7 +355,7 @@ void PhysicsShapeQueryParameters3D::_bind_methods() {
|
|||
/////////////////////////////////////
|
||||
|
||||
Dictionary PhysicsDirectSpaceState3D::_intersect_ray(const Ref<PhysicsRayQueryParameters3D> &p_ray_query) {
|
||||
ERR_FAIL_COND_V(!p_ray_query.is_valid(), Dictionary());
|
||||
ERR_FAIL_COND_V(p_ray_query.is_null(), Dictionary());
|
||||
|
||||
RayResult result;
|
||||
bool res = intersect_ray(p_ray_query->get_parameters(), result);
|
||||
|
|
@ -403,7 +402,7 @@ TypedArray<Dictionary> PhysicsDirectSpaceState3D::_intersect_point(const Ref<Phy
|
|||
}
|
||||
|
||||
TypedArray<Dictionary> PhysicsDirectSpaceState3D::_intersect_shape(const Ref<PhysicsShapeQueryParameters3D> &p_shape_query, int p_max_results) {
|
||||
ERR_FAIL_COND_V(!p_shape_query.is_valid(), TypedArray<Dictionary>());
|
||||
ERR_FAIL_COND_V(p_shape_query.is_null(), TypedArray<Dictionary>());
|
||||
|
||||
Vector<ShapeResult> sr;
|
||||
sr.resize(p_max_results);
|
||||
|
|
@ -423,7 +422,7 @@ TypedArray<Dictionary> PhysicsDirectSpaceState3D::_intersect_shape(const Ref<Phy
|
|||
}
|
||||
|
||||
Vector<real_t> PhysicsDirectSpaceState3D::_cast_motion(const Ref<PhysicsShapeQueryParameters3D> &p_shape_query) {
|
||||
ERR_FAIL_COND_V(!p_shape_query.is_valid(), Vector<real_t>());
|
||||
ERR_FAIL_COND_V(p_shape_query.is_null(), Vector<real_t>());
|
||||
|
||||
real_t closest_safe = 1.0f, closest_unsafe = 1.0f;
|
||||
bool res = cast_motion(p_shape_query->get_parameters(), closest_safe, closest_unsafe);
|
||||
|
|
@ -438,7 +437,7 @@ Vector<real_t> PhysicsDirectSpaceState3D::_cast_motion(const Ref<PhysicsShapeQue
|
|||
}
|
||||
|
||||
TypedArray<Vector3> PhysicsDirectSpaceState3D::_collide_shape(const Ref<PhysicsShapeQueryParameters3D> &p_shape_query, int p_max_results) {
|
||||
ERR_FAIL_COND_V(!p_shape_query.is_valid(), TypedArray<Vector3>());
|
||||
ERR_FAIL_COND_V(p_shape_query.is_null(), TypedArray<Vector3>());
|
||||
|
||||
Vector<Vector3> ret;
|
||||
ret.resize(p_max_results * 2);
|
||||
|
|
@ -456,7 +455,7 @@ TypedArray<Vector3> PhysicsDirectSpaceState3D::_collide_shape(const Ref<PhysicsS
|
|||
}
|
||||
|
||||
Dictionary PhysicsDirectSpaceState3D::_get_rest_info(const Ref<PhysicsShapeQueryParameters3D> &p_shape_query) {
|
||||
ERR_FAIL_COND_V(!p_shape_query.is_valid(), Dictionary());
|
||||
ERR_FAIL_COND_V(p_shape_query.is_null(), Dictionary());
|
||||
|
||||
ShapeRestInfo sri;
|
||||
|
||||
|
|
@ -652,7 +651,7 @@ void PhysicsTestMotionResult3D::_bind_methods() {
|
|||
///////////////////////////////////////
|
||||
|
||||
bool PhysicsServer3D::_body_test_motion(RID p_body, const Ref<PhysicsTestMotionParameters3D> &p_parameters, const Ref<PhysicsTestMotionResult3D> &p_result) {
|
||||
ERR_FAIL_COND_V(!p_parameters.is_valid(), false);
|
||||
ERR_FAIL_COND_V(p_parameters.is_null(), false);
|
||||
|
||||
MotionResult *result_ptr = nullptr;
|
||||
if (p_result.is_valid()) {
|
||||
|
|
@ -1125,14 +1124,14 @@ PhysicsServer3D::PhysicsServer3D() {
|
|||
singleton = this;
|
||||
|
||||
// World3D physics space
|
||||
GLOBAL_DEF_BASIC("physics/3d/default_gravity", 9.8);
|
||||
GLOBAL_DEF_BASIC("physics/3d/default_gravity_vector", Vector3(0, -1, 0));
|
||||
GLOBAL_DEF_BASIC(PropertyInfo(Variant::FLOAT, "physics/3d/default_gravity", PROPERTY_HINT_RANGE, U"-32,32,0.001,or_less,or_greater,suffix:m/s\u00B2"), 9.8);
|
||||
GLOBAL_DEF_BASIC(PropertyInfo(Variant::VECTOR3, "physics/3d/default_gravity_vector", PROPERTY_HINT_RANGE, "-10,10,0.001,or_less,or_greater"), Vector3(0, -1, 0));
|
||||
GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "physics/3d/default_linear_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), 0.1);
|
||||
GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "physics/3d/default_angular_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), 0.1);
|
||||
|
||||
// PhysicsServer3D
|
||||
GLOBAL_DEF("physics/3d/sleep_threshold_linear", 0.1);
|
||||
GLOBAL_DEF("physics/3d/sleep_threshold_angular", Math::deg_to_rad(8.0));
|
||||
GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "physics/3d/sleep_threshold_linear", PROPERTY_HINT_RANGE, "0,1,0.001,or_greater"), 0.1);
|
||||
GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "physics/3d/sleep_threshold_angular", PROPERTY_HINT_RANGE, "0,90,0.1,radians_as_degrees"), Math::deg_to_rad(8.0));
|
||||
GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "physics/3d/time_before_sleep", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater"), 0.5);
|
||||
GLOBAL_DEF(PropertyInfo(Variant::INT, "physics/3d/solver/solver_iterations", PROPERTY_HINT_RANGE, "1,32,1,or_greater"), 16);
|
||||
GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "physics/3d/solver/contact_recycle_radius", PROPERTY_HINT_RANGE, "0,0.1,0.001,or_greater"), 0.01);
|
||||
|
|
@ -1155,6 +1154,7 @@ void PhysicsServer3DManager::on_servers_changed() {
|
|||
}
|
||||
ProjectSettings::get_singleton()->set_custom_property_info(PropertyInfo(Variant::STRING, setting_property_name, PROPERTY_HINT_ENUM, physics_servers2));
|
||||
ProjectSettings::get_singleton()->set_restart_if_changed(setting_property_name, true);
|
||||
ProjectSettings::get_singleton()->set_as_basic(setting_property_name, true);
|
||||
}
|
||||
|
||||
void PhysicsServer3DManager::_bind_methods() {
|
||||
|
|
@ -1201,7 +1201,9 @@ String PhysicsServer3DManager::get_server_name(int p_id) {
|
|||
}
|
||||
|
||||
PhysicsServer3D *PhysicsServer3DManager::new_default_server() {
|
||||
ERR_FAIL_COND_V(default_server_id == -1, nullptr);
|
||||
if (default_server_id == -1) {
|
||||
return nullptr;
|
||||
}
|
||||
Variant ret;
|
||||
Callable::CallError ce;
|
||||
physics_servers[default_server_id].create_callback.callp(nullptr, 0, ret, ce);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue