22 #ifndef _BULLETSPHERESHAPE_HH_
23 #define _BULLETSPHERESHAPE_HH_
53 gzerr <<
"Sphere shape does not support negative radius\n";
61 gzwarn <<
"Setting sphere shape's radius to zero \n";
68 this->collisionParent);
74 bParent->SetCollisionShape(
new btSphereShape(_radius));
78 btVector3 sphereScale;
79 sphereScale.setX(_radius / this->initialSize.x);
80 sphereScale.setY(_radius / this->initialSize.y);
81 sphereScale.setZ(_radius / this->initialSize.z);
83 shape->setLocalScaling(sphereScale);
93 if (bLink->GetBulletLink()->getCollisionShape()->isCompound())
95 btCompoundShape *compoundShape =
96 dynamic_cast<btCompoundShape *
>(
97 bLink->GetBulletLink()->getCollisionShape());
99 compoundShape->removeChildShape(shape);
101 this->collisionParent->GetRelativePose();
102 relativePose.
pos -= bLink->GetInertial()->GetCoG();
103 compoundShape->addChildShape(
Bullet collisions.
Definition: BulletCollision.hh:53
boost::shared_ptr< BulletLink > BulletLinkPtr
Definition: BulletTypes.hh:44
Bullet Link class.
Definition: BulletLink.hh:44
Encapsulates a position and rotation in three space.
Definition: Pose.hh:40
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:43
void SetRadius(double _radius)
Set the radius.
Definition: BulletSphereShape.hh:49
btCollisionShape * GetCollisionShape() const
Get the bullet collision shape.
#define gzwarn
Output a warning message.
Definition: Console.hh:44
BulletSphereShape(CollisionPtr _parent)
Constructor.
Definition: BulletSphereShape.hh:42
#define gzerr
Output an error message.
Definition: Console.hh:47
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:168
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:94
virtual ~BulletSphereShape()
Destructor.
Definition: BulletSphereShape.hh:45
static math::Pose ConvertPose(const btTransform &_bt)
Convert a bullet transform to a gazebo pose.
Definition: BulletTypes.hh:93
Vector3 pos
The position.
Definition: Pose.hh:243
void ClearCollisionCache()
boost::shared_ptr< BulletCollision > BulletCollisionPtr
Definition: BulletTypes.hh:41
Bullet sphere collision.
Definition: BulletSphereShape.hh:39
virtual void SetRadius(double _radius)
Set the size.
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
Sphere collision shape.
Definition: SphereShape.hh:38