diff options
Diffstat (limited to 'scene/resources/3d/shape_3d.h')
-rw-r--r-- | scene/resources/3d/shape_3d.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scene/resources/3d/shape_3d.h b/scene/resources/3d/shape_3d.h index 2adfd152f9..7b005c1fb9 100644 --- a/scene/resources/3d/shape_3d.h +++ b/scene/resources/3d/shape_3d.h @@ -36,6 +36,7 @@ #include "core/io/resource.h" class ArrayMesh; +class Material; class Shape3D : public Resource { GDCLASS(Shape3D, Resource); @@ -46,6 +47,10 @@ class Shape3D : public Resource { real_t margin = 0.04; Ref<ArrayMesh> debug_mesh_cache; + Ref<Material> collision_material; + + Color debug_color = Color(0.0, 0.0, 0.0, 0.0); + bool debug_fill = true; protected: static void _bind_methods(); @@ -53,6 +58,8 @@ protected: _FORCE_INLINE_ RID get_shape() const { return shape; } Shape3D(RID p_shape); + Ref<Material> get_debug_collision_material(); + virtual void _update_shape(); public: @@ -60,6 +67,7 @@ public: Ref<ArrayMesh> get_debug_mesh(); virtual Vector<Vector3> get_debug_mesh_lines() const = 0; // { return Vector<Vector3>(); } + virtual Ref<ArrayMesh> get_debug_arraymesh_faces(const Color &p_modulate) const = 0; /// Returns the radius of a sphere that fully enclose this shape virtual real_t get_enclosing_radius() const = 0; @@ -71,6 +79,14 @@ public: real_t get_margin() const; void set_margin(real_t p_margin); +#ifdef DEBUG_ENABLED + void set_debug_color(const Color &p_color); + Color get_debug_color() const; + + void set_debug_fill(bool p_fill); + bool get_debug_fill() const; +#endif // DEBUG_ENABLED + Shape3D(); ~Shape3D(); }; |