22 #ifndef _BULLETSPHERESHAPE_HH_
23 #define _BULLETSPHERESHAPE_HH_
55 gzerr <<
"Sphere shape does not support negative radius\n";
63 gzwarn <<
"Setting sphere shape's radius to zero \n";
70 this->collisionParent);
76 bParent->SetCollisionShape(
new btSphereShape(_radius));
80 btVector3 sphereScale;
81 sphereScale.setX(_radius / this->initialSize.x);
82 sphereScale.setY(_radius / this->initialSize.y);
83 sphereScale.setZ(_radius / this->initialSize.z);
85 shape->setLocalScaling(sphereScale);
95 if (bLink->GetBulletLink()->getCollisionShape()->isCompound())
97 btCompoundShape *compoundShape =
98 dynamic_cast<btCompoundShape *
>(
99 bLink->GetBulletLink()->getCollisionShape());
101 compoundShape->removeChildShape(shape);
103 this->collisionParent->GetRelativePose();
104 relativePose.
pos -= bLink->GetInertial()->GetCoG();
105 compoundShape->addChildShape(
Bullet collisions.
Definition: BulletCollision.hh:53
Bullet Link class.
Definition: BulletLink.hh:42
Encapsulates a position and rotation in three space.
Definition: Pose.hh:37
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
boost::shared_ptr< BulletCollision > BulletCollisionPtr
Definition: BulletTypes.hh:40
#define gzwarn
Output a warning message.
Definition: Console.hh:47
#define gzerr
Output an error message.
Definition: Console.hh:50
bool equal(const T &_a, const T &_b, const T &_epsilon=1e-6)
check if two values are equal, within a tolerance
Definition: Helpers.hh:171
BulletSphereShape(CollisionPtr _parent)
Constructor.
Definition: BulletSphereShape.hh:44
virtual void SetRadius(double _radius)
Set the size.
static math::Pose ConvertPose(const btTransform &_bt)
Convert a bullet transform to a gazebo pose.
Definition: BulletTypes.hh:92
boost::shared_ptr< BulletLink > BulletLinkPtr
Definition: BulletTypes.hh:43
virtual ~BulletSphereShape()
Destructor.
Definition: BulletSphereShape.hh:47
btCollisionShape * GetCollisionShape() const
Get the bullet collision shape.
Vector3 pos
The position.
Definition: Pose.hh:252
void SetRadius(double _radius)
Set the radius.
Definition: BulletSphereShape.hh:51
Bullet sphere collision.
Definition: BulletSphereShape.hh:41
void ClearCollisionCache()
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:113
Sphere collision shape.
Definition: SphereShape.hh:44