From 8cfd2641481652b2588596f863217022b129817a Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Thu, 30 Dec 2021 15:20:56 -0800 Subject: [PATCH] Improve the default size for 3D shapes (Box, Capsule, and Cylinder) --- doc/classes/BoxMesh.xml | 2 +- doc/classes/BoxShape3D.xml | 2 +- doc/classes/CapsuleMesh.xml | 4 ++-- doc/classes/CapsuleShape3D.xml | 4 ++-- doc/classes/CylinderMesh.xml | 4 ++-- doc/classes/CylinderShape3D.xml | 2 +- modules/csg/csg_shape.cpp | 8 ++++---- modules/csg/csg_shape.h | 2 +- modules/csg/doc_classes/CSGBox3D.xml | 2 +- modules/csg/doc_classes/CSGCylinder3D.xml | 4 ++-- modules/csg/doc_classes/CSGTorus3D.xml | 4 ++-- scene/resources/box_shape_3d.cpp | 2 +- scene/resources/capsule_shape_3d.h | 4 ++-- scene/resources/cylinder_shape_3d.h | 2 +- scene/resources/primitive_meshes.h | 10 +++++----- 15 files changed, 28 insertions(+), 28 deletions(-) diff --git a/doc/classes/BoxMesh.xml b/doc/classes/BoxMesh.xml index af3365b6ea8..bf499c89719 100644 --- a/doc/classes/BoxMesh.xml +++ b/doc/classes/BoxMesh.xml @@ -11,7 +11,7 @@ - + The box's width, height and depth. diff --git a/doc/classes/BoxShape3D.xml b/doc/classes/BoxShape3D.xml index 3bfded65123..cf2bf2338b2 100644 --- a/doc/classes/BoxShape3D.xml +++ b/doc/classes/BoxShape3D.xml @@ -12,7 +12,7 @@ https://godotengine.org/asset-library/asset/125 - + The box's width, height and depth. diff --git a/doc/classes/CapsuleMesh.xml b/doc/classes/CapsuleMesh.xml index 3b4e60ce936..45dd64c174a 100644 --- a/doc/classes/CapsuleMesh.xml +++ b/doc/classes/CapsuleMesh.xml @@ -9,13 +9,13 @@ - + Total height of the capsule mesh (including the hemispherical ends). Number of radial segments on the capsule mesh. - + Radius of the capsule mesh. diff --git a/doc/classes/CapsuleShape3D.xml b/doc/classes/CapsuleShape3D.xml index 8856ec37797..ba4ead49307 100644 --- a/doc/classes/CapsuleShape3D.xml +++ b/doc/classes/CapsuleShape3D.xml @@ -10,10 +10,10 @@ https://godotengine.org/asset-library/asset/675 - + The capsule's height. - + The capsule's radius. diff --git a/doc/classes/CylinderMesh.xml b/doc/classes/CylinderMesh.xml index 077435990bc..ce34cc91ad9 100644 --- a/doc/classes/CylinderMesh.xml +++ b/doc/classes/CylinderMesh.xml @@ -9,7 +9,7 @@ - + Bottom radius of the cylinder. If set to [code]0.0[/code], the bottom faces will not be generated, resulting in a conic shape. @@ -21,7 +21,7 @@ Number of edge rings along the height of the cylinder. Changing [member rings] does not have any visual impact unless a shader or procedural mesh tool is used to alter the vertex data. Higher values result in more subdivisions, which can be used to create smoother-looking effects with shaders or procedural mesh tools (at the cost of performance). When not altering the vertex data using a shader or procedural mesh tool, [member rings] should be kept to its default value. - + Top radius of the cylinder. If set to [code]0.0[/code], the top faces will not be generated, resulting in a conic shape. diff --git a/doc/classes/CylinderShape3D.xml b/doc/classes/CylinderShape3D.xml index d40b96710b3..6fa6c4d75e3 100644 --- a/doc/classes/CylinderShape3D.xml +++ b/doc/classes/CylinderShape3D.xml @@ -15,7 +15,7 @@ The cylinder's height. - + The cylinder's radius. diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index 4b36bca02ac..fbddedbe55d 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -1451,8 +1451,8 @@ Ref CSGCylinder3D::get_material() const { CSGCylinder3D::CSGCylinder3D() { // defaults - radius = 1.0; - height = 1.0; + radius = 0.5; + height = 2.0; sides = 8; cone = false; smooth_faces = true; @@ -1671,8 +1671,8 @@ Ref CSGTorus3D::get_material() const { CSGTorus3D::CSGTorus3D() { // defaults - inner_radius = 2.0; - outer_radius = 3.0; + inner_radius = 0.5; + outer_radius = 1.0; sides = 8; ring_sides = 6; smooth_faces = true; diff --git a/modules/csg/csg_shape.h b/modules/csg/csg_shape.h index eed995a40ef..6da9893368d 100644 --- a/modules/csg/csg_shape.h +++ b/modules/csg/csg_shape.h @@ -239,7 +239,7 @@ class CSGBox3D : public CSGPrimitive3D { virtual CSGBrush *_build_brush() override; Ref material; - Vector3 size = Vector3(2, 2, 2); + Vector3 size = Vector3(1, 1, 1); protected: static void _bind_methods(); diff --git a/modules/csg/doc_classes/CSGBox3D.xml b/modules/csg/doc_classes/CSGBox3D.xml index d64e58ae4de..4b479ed42e7 100644 --- a/modules/csg/doc_classes/CSGBox3D.xml +++ b/modules/csg/doc_classes/CSGBox3D.xml @@ -12,7 +12,7 @@ The material used to render the box. - + The box's width, height and depth. diff --git a/modules/csg/doc_classes/CSGCylinder3D.xml b/modules/csg/doc_classes/CSGCylinder3D.xml index 40e989bfb33..1fe2025bab6 100644 --- a/modules/csg/doc_classes/CSGCylinder3D.xml +++ b/modules/csg/doc_classes/CSGCylinder3D.xml @@ -12,13 +12,13 @@ If [code]true[/code] a cone is created, the [member radius] will only apply to one side. - + The height of the cylinder. The material used to render the cylinder. - + The radius of the cylinder. diff --git a/modules/csg/doc_classes/CSGTorus3D.xml b/modules/csg/doc_classes/CSGTorus3D.xml index 91ee63a4c91..2c0eef8f09b 100644 --- a/modules/csg/doc_classes/CSGTorus3D.xml +++ b/modules/csg/doc_classes/CSGTorus3D.xml @@ -9,13 +9,13 @@ - + The inner radius of the torus. The material used to render the torus. - + The outer radius of the torus. diff --git a/scene/resources/box_shape_3d.cpp b/scene/resources/box_shape_3d.cpp index b97d378e023..a1ec9a22309 100644 --- a/scene/resources/box_shape_3d.cpp +++ b/scene/resources/box_shape_3d.cpp @@ -95,5 +95,5 @@ void BoxShape3D::_bind_methods() { BoxShape3D::BoxShape3D() : Shape3D(PhysicsServer3D::get_singleton()->shape_create(PhysicsServer3D::SHAPE_BOX)) { - set_size(Vector3(2, 2, 2)); + set_size(Vector3(1, 1, 1)); } diff --git a/scene/resources/capsule_shape_3d.h b/scene/resources/capsule_shape_3d.h index 967a413da4e..4c039ab3265 100644 --- a/scene/resources/capsule_shape_3d.h +++ b/scene/resources/capsule_shape_3d.h @@ -35,8 +35,8 @@ class CapsuleShape3D : public Shape3D { GDCLASS(CapsuleShape3D, Shape3D); - float radius = 1.0; - float height = 3.0; + float radius = 0.5; + float height = 2.0; protected: static void _bind_methods(); diff --git a/scene/resources/cylinder_shape_3d.h b/scene/resources/cylinder_shape_3d.h index 0211f2b08f6..65427423c89 100644 --- a/scene/resources/cylinder_shape_3d.h +++ b/scene/resources/cylinder_shape_3d.h @@ -35,7 +35,7 @@ class CylinderShape3D : public Shape3D { GDCLASS(CylinderShape3D, Shape3D); - float radius = 1.0; + float radius = 0.5; float height = 2.0; protected: diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h index aa9682bd804..3fc5fd4a169 100644 --- a/scene/resources/primitive_meshes.h +++ b/scene/resources/primitive_meshes.h @@ -106,8 +106,8 @@ class CapsuleMesh : public PrimitiveMesh { GDCLASS(CapsuleMesh, PrimitiveMesh); private: - float radius = 1.0; - float height = 3.0; + float radius = 0.5; + float height = 2.0; int radial_segments = 64; int rings = 8; @@ -138,7 +138,7 @@ class BoxMesh : public PrimitiveMesh { GDCLASS(BoxMesh, PrimitiveMesh); private: - Vector3 size = Vector3(2.0, 2.0, 2.0); + Vector3 size = Vector3(1, 1, 1); int subdivide_w = 0; int subdivide_h = 0; int subdivide_d = 0; @@ -171,8 +171,8 @@ class CylinderMesh : public PrimitiveMesh { GDCLASS(CylinderMesh, PrimitiveMesh); private: - float top_radius = 1.0; - float bottom_radius = 1.0; + float top_radius = 0.5; + float bottom_radius = 0.5; float height = 2.0; int radial_segments = 64; int rings = 4;