From 03903fdeec0023d4c504a7399d248257e6756f4c Mon Sep 17 00:00:00 2001 From: Julian Adamse Date: Fri, 5 Nov 2021 20:46:32 +0100 Subject: [PATCH] Fix the volume calculation for cylinders --- servers/physics_3d/godot_shape_3d.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/physics_3d/godot_shape_3d.h b/servers/physics_3d/godot_shape_3d.h index 8822d9487b..67497ba9b7 100644 --- a/servers/physics_3d/godot_shape_3d.h +++ b/servers/physics_3d/godot_shape_3d.h @@ -256,7 +256,7 @@ public: _FORCE_INLINE_ real_t get_height() const { return height; } _FORCE_INLINE_ real_t get_radius() const { return radius; } - virtual real_t get_area() const override { return 4.0 / 3.0 * Math_PI * radius * radius * radius + height * Math_PI * radius * radius; } + virtual real_t get_area() const override { return height * Math_PI * radius * radius; } virtual PhysicsServer3D::ShapeType get_type() const override { return PhysicsServer3D::SHAPE_CYLINDER; }