diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-08-11 10:38:14 -0700 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-08-11 14:54:53 -0700 |
commit | f9176a39ce48685adacca2698b8da8136c5de166 (patch) | |
tree | 5c1efcc6c45b7f5b8561985dfc7f97103787dcc1 /servers/physics_3d/shape_3d_sw.h | |
parent | 7188cb60127c1f4e900f080adbc47a55645f1645 (diff) |
Make radius & height in CapsuleShape3D independent
Also changed CapsuleMesh to make settings consistent between render and
physics.
Diffstat (limited to 'servers/physics_3d/shape_3d_sw.h')
-rw-r--r-- | servers/physics_3d/shape_3d_sw.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/servers/physics_3d/shape_3d_sw.h b/servers/physics_3d/shape_3d_sw.h index dde423ad60..c11c3a08f6 100644 --- a/servers/physics_3d/shape_3d_sw.h +++ b/servers/physics_3d/shape_3d_sw.h @@ -207,7 +207,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 { return 4.0 / 3.0 * Math_PI * radius * radius * radius + height * Math_PI * radius * radius; } + virtual real_t get_area() const { return 4.0 / 3.0 * Math_PI * radius * radius * radius + (height - radius * 2.0) * Math_PI * radius * radius; } virtual PhysicsServer3D::ShapeType get_type() const { return PhysicsServer3D::SHAPE_CAPSULE; } |