Explorar o código

Merge pull request #54642 from BoilingFusion/master

Fix the volume calculation for cylinders
Camille Mohr-Daurat %!s(int64=3) %!d(string=hai) anos
pai
achega
70c82d9d3d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      servers/physics_3d/godot_shape_3d.h

+ 1 - 1
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_height() const { return height; }
 	_FORCE_INLINE_ real_t get_radius() const { return radius; }
 	_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; }
 	virtual PhysicsServer3D::ShapeType get_type() const override { return PhysicsServer3D::SHAPE_CYLINDER; }