diff options
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/lightmap_gi.cpp | 4 | ||||
-rw-r--r-- | scene/3d/lightmapper.h | 12 | ||||
-rw-r--r-- | scene/3d/node_3d.h | 4 | ||||
-rw-r--r-- | scene/3d/physics_body_3d.cpp | 19 | ||||
-rw-r--r-- | scene/3d/physics_body_3d.h | 9 | ||||
-rw-r--r-- | scene/3d/skeleton_3d.h | 4 | ||||
-rw-r--r-- | scene/3d/velocity_tracker_3d.h | 4 |
7 files changed, 35 insertions, 21 deletions
diff --git a/scene/3d/lightmap_gi.cpp b/scene/3d/lightmap_gi.cpp index cc1177d541..a3f681e53c 100644 --- a/scene/3d/lightmap_gi.cpp +++ b/scene/3d/lightmap_gi.cpp @@ -31,11 +31,11 @@ #include "lightmap_gi.h" #include "core/io/config_file.h" +#include "core/io/dir_access.h" +#include "core/io/file_access.h" #include "core/io/resource_saver.h" #include "core/math/camera_matrix.h" #include "core/math/delaunay_3d.h" -#include "core/os/dir_access.h" -#include "core/os/file_access.h" #include "core/os/os.h" #include "core/templates/sort_array.h" #include "lightmap_probe.h" diff --git a/scene/3d/lightmapper.h b/scene/3d/lightmapper.h index f63515f666..3a6a88d435 100644 --- a/scene/3d/lightmapper.h +++ b/scene/3d/lightmapper.h @@ -44,8 +44,8 @@ #endif -class LightmapDenoiser : public Reference { - GDCLASS(LightmapDenoiser, Reference) +class LightmapDenoiser : public RefCounted { + GDCLASS(LightmapDenoiser, RefCounted) protected: static LightmapDenoiser *(*create_function)(); @@ -54,8 +54,8 @@ public: static Ref<LightmapDenoiser> create(); }; -class LightmapRaycaster : public Reference { - GDCLASS(LightmapRaycaster, Reference) +class LightmapRaycaster : public RefCounted { + GDCLASS(LightmapRaycaster, RefCounted) protected: static LightmapRaycaster *(*create_function)(); @@ -121,8 +121,8 @@ public: static Ref<LightmapRaycaster> create(); }; -class Lightmapper : public Reference { - GDCLASS(Lightmapper, Reference) +class Lightmapper : public RefCounted { + GDCLASS(Lightmapper, RefCounted) public: enum GenerateProbes { GENERATE_PROBES_DISABLED, diff --git a/scene/3d/node_3d.h b/scene/3d/node_3d.h index 09a96bf8ca..5f076ceb12 100644 --- a/scene/3d/node_3d.h +++ b/scene/3d/node_3d.h @@ -34,8 +34,8 @@ #include "scene/main/node.h" #include "scene/main/scene_tree.h" -class Node3DGizmo : public Reference { - GDCLASS(Node3DGizmo, Reference); +class Node3DGizmo : public RefCounted { + GDCLASS(Node3DGizmo, RefCounted); public: virtual void create() = 0; diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index 3496ed1a56..25c7c3d798 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -1204,8 +1204,16 @@ real_t CharacterBody3D::get_floor_max_angle() const { return floor_max_angle; } -void CharacterBody3D::set_floor_max_angle(real_t p_floor_max_angle) { - floor_max_angle = p_floor_max_angle; +void CharacterBody3D::set_floor_max_angle(real_t p_radians) { + floor_max_angle = p_radians; +} + +real_t CharacterBody3D::get_floor_max_angle_degrees() const { + return Math::rad2deg(floor_max_angle); +} + +void CharacterBody3D::set_floor_max_angle_degrees(real_t p_degrees) { + floor_max_angle = Math::deg2rad(p_degrees); } const Vector3 &CharacterBody3D::get_snap() const { @@ -1251,7 +1259,9 @@ void CharacterBody3D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_max_slides"), &CharacterBody3D::get_max_slides); ClassDB::bind_method(D_METHOD("set_max_slides", "max_slides"), &CharacterBody3D::set_max_slides); ClassDB::bind_method(D_METHOD("get_floor_max_angle"), &CharacterBody3D::get_floor_max_angle); - ClassDB::bind_method(D_METHOD("set_floor_max_angle", "floor_max_angle"), &CharacterBody3D::set_floor_max_angle); + ClassDB::bind_method(D_METHOD("set_floor_max_angle", "radians"), &CharacterBody3D::set_floor_max_angle); + ClassDB::bind_method(D_METHOD("get_floor_max_angle_degrees"), &CharacterBody3D::get_floor_max_angle_degrees); + ClassDB::bind_method(D_METHOD("set_floor_max_angle_degrees", "degrees"), &CharacterBody3D::set_floor_max_angle_degrees); ClassDB::bind_method(D_METHOD("get_snap"), &CharacterBody3D::get_snap); ClassDB::bind_method(D_METHOD("set_snap", "snap"), &CharacterBody3D::set_snap); ClassDB::bind_method(D_METHOD("get_up_direction"), &CharacterBody3D::get_up_direction); @@ -1270,7 +1280,8 @@ void CharacterBody3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "stop_on_slope"), "set_stop_on_slope_enabled", "is_stop_on_slope_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "infinite_inertia"), "set_infinite_inertia_enabled", "is_infinite_inertia_enabled"); ADD_PROPERTY(PropertyInfo(Variant::INT, "max_slides"), "set_max_slides", "get_max_slides"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "floor_max_angle"), "set_floor_max_angle", "get_floor_max_angle"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "floor_max_angle", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_floor_max_angle", "get_floor_max_angle"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "floor_max_angle_degrees", PROPERTY_HINT_RANGE, "0,180,0.1", PROPERTY_USAGE_EDITOR), "set_floor_max_angle_degrees", "get_floor_max_angle_degrees"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "snap"), "set_snap", "get_snap"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "up_direction"), "set_up_direction", "get_up_direction"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "collision/safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_safe_margin", "get_safe_margin"); diff --git a/scene/3d/physics_body_3d.h b/scene/3d/physics_body_3d.h index d5e474c5d5..8df3635be0 100644 --- a/scene/3d/physics_body_3d.h +++ b/scene/3d/physics_body_3d.h @@ -305,7 +305,10 @@ private: void set_max_slides(int p_max_slides); real_t get_floor_max_angle() const; - void set_floor_max_angle(real_t p_floor_max_angle); + void set_floor_max_angle(real_t p_radians); + + real_t get_floor_max_angle_degrees() const; + void set_floor_max_angle_degrees(real_t p_degrees); const Vector3 &get_snap() const; void set_snap(const Vector3 &p_snap); @@ -336,8 +339,8 @@ public: ~CharacterBody3D(); }; -class KinematicCollision3D : public Reference { - GDCLASS(KinematicCollision3D, Reference); +class KinematicCollision3D : public RefCounted { + GDCLASS(KinematicCollision3D, RefCounted); PhysicsBody3D *owner = nullptr; friend class PhysicsBody3D; diff --git a/scene/3d/skeleton_3d.h b/scene/3d/skeleton_3d.h index 9be7dce5d2..2f6e416c8c 100644 --- a/scene/3d/skeleton_3d.h +++ b/scene/3d/skeleton_3d.h @@ -40,8 +40,8 @@ typedef int BoneId; class PhysicalBone3D; class Skeleton3D; -class SkinReference : public Reference { - GDCLASS(SkinReference, Reference) +class SkinReference : public RefCounted { + GDCLASS(SkinReference, RefCounted) friend class Skeleton3D; Skeleton3D *skeleton_node; diff --git a/scene/3d/velocity_tracker_3d.h b/scene/3d/velocity_tracker_3d.h index e971f4755a..827c3f5bd8 100644 --- a/scene/3d/velocity_tracker_3d.h +++ b/scene/3d/velocity_tracker_3d.h @@ -33,8 +33,8 @@ #include "scene/3d/node_3d.h" -class VelocityTracker3D : public Reference { - GDCLASS(VelocityTracker3D, Reference); +class VelocityTracker3D : public RefCounted { + GDCLASS(VelocityTracker3D, RefCounted); struct PositionHistory { uint64_t frame = 0; |