diff options
Diffstat (limited to 'modules/csg/csg_shape.h')
-rw-r--r-- | modules/csg/csg_shape.h | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/modules/csg/csg_shape.h b/modules/csg/csg_shape.h index 7e95d685c5..7dff8b6d3b 100644 --- a/modules/csg/csg_shape.h +++ b/modules/csg/csg_shape.h @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -114,7 +114,7 @@ protected: friend class CSGCombiner3D; CSGBrush *_get_brush(); - virtual void _validate_property(PropertyInfo &property) const; + virtual void _validate_property(PropertyInfo &property) const override; public: Array get_meshes() const; @@ -124,8 +124,8 @@ public: virtual Vector<Vector3> get_brush_faces(); - virtual AABB get_aabb() const; - virtual Vector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual AABB get_aabb() const override; + virtual Vector<Face3> get_faces(uint32_t p_usage_flags) const override; void set_use_collision(bool p_enable); bool is_using_collision() const; @@ -159,7 +159,7 @@ class CSGCombiner3D : public CSGShape3D { GDCLASS(CSGCombiner3D, CSGShape3D); private: - virtual CSGBrush *_build_brush(); + virtual CSGBrush *_build_brush() override; public: CSGCombiner3D(); @@ -185,7 +185,7 @@ public: class CSGMesh3D : public CSGPrimitive3D { GDCLASS(CSGMesh3D, CSGPrimitive3D); - virtual CSGBrush *_build_brush(); + virtual CSGBrush *_build_brush() override; Ref<Mesh> mesh; Ref<Material> material; @@ -205,7 +205,7 @@ public: class CSGSphere3D : public CSGPrimitive3D { GDCLASS(CSGSphere3D, CSGPrimitive3D); - virtual CSGBrush *_build_brush(); + virtual CSGBrush *_build_brush() override; Ref<Material> material; bool smooth_faces; @@ -237,35 +237,27 @@ public: class CSGBox3D : public CSGPrimitive3D { GDCLASS(CSGBox3D, CSGPrimitive3D); - virtual CSGBrush *_build_brush(); + virtual CSGBrush *_build_brush() override; Ref<Material> material; - float width; - float height; - float depth; + Vector3 size = Vector3(2, 2, 2); protected: static void _bind_methods(); public: - void set_width(const float p_width); - float get_width() const; - - void set_height(const float p_height); - float get_height() const; - - void set_depth(const float p_depth); - float get_depth() const; + void set_size(const Vector3 &p_size); + Vector3 get_size() const; void set_material(const Ref<Material> &p_material); Ref<Material> get_material() const; - CSGBox3D(); + CSGBox3D() {} }; class CSGCylinder3D : public CSGPrimitive3D { GDCLASS(CSGCylinder3D, CSGPrimitive3D); - virtual CSGBrush *_build_brush(); + virtual CSGBrush *_build_brush() override; Ref<Material> material; float radius; @@ -301,7 +293,7 @@ public: class CSGTorus3D : public CSGPrimitive3D { GDCLASS(CSGTorus3D, CSGPrimitive3D); - virtual CSGBrush *_build_brush(); + virtual CSGBrush *_build_brush() override; Ref<Material> material; float inner_radius; @@ -352,7 +344,7 @@ public: }; private: - virtual CSGBrush *_build_brush(); + virtual CSGBrush *_build_brush() override; Vector<Vector2> polygon; Ref<Material> material; @@ -383,7 +375,7 @@ private: protected: static void _bind_methods(); - virtual void _validate_property(PropertyInfo &property) const; + virtual void _validate_property(PropertyInfo &property) const override; void _notification(int p_what); public: |