Skip to content

Commit aa750f4

Browse files
Fix BulletCapsuleShape creation from Panda CollisionTube
Functions get_point_a() and get_point_b() appear to return the top of the cylinder section of the tube, not the tip of the endcap, making subtracting the radius unnecessary.
1 parent 97d4e32 commit aa750f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

panda/src/bullet/bulletCapsuleShape.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ BulletCapsuleShape *BulletCapsuleShape::
9393
make_from_solid(const CollisionTube *solid) {
9494

9595
PN_stdfloat radius = solid->get_radius();
96-
// CollisionTube height includes the hemispheres, Bullet only wants the cylinder height.
97-
PN_stdfloat height = (solid->get_point_b() - solid->get_point_a()).length() - (radius * 2);
96+
// Get tube's cylinder height: length from point A to point B
97+
PN_stdfloat height = (solid->get_point_b() - solid->get_point_a()).length();
9898

9999
// CollisionTubes are always Z-Up.
100100
return new BulletCapsuleShape(radius, height, Z_up);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy