22 #ifndef _BULLETCYLINDERSHAPE_HH_
23 #define _BULLETCYLINDERSHAPE_HH_
50 public:
void SetSize(
double _radius,
double _length)
54 gzerr <<
"Cylinder shape does not support negative radius\n";
59 gzerr <<
"Cylinder shape does not support negative length\n";
67 gzwarn <<
"Setting cylinder shape's radius to zero \n";
72 gzwarn <<
"Setting cylinder shape's length to zero \n";
79 this->collisionParent);
85 bParent->SetCollisionShape(
new btCylinderShapeZ(
86 btVector3(_radius, _radius, _length * 0.5)));
90 btVector3 cylinderScale;
91 cylinderScale.setX(_radius / this->initialSize.x);
92 cylinderScale.setY(_radius / this->initialSize.y);
93 cylinderScale.setZ(_length / this->initialSize.z);
95 shape->setLocalScaling(cylinderScale);
105 if (bLink->GetBulletLink()->getCollisionShape()->isCompound())
107 btCompoundShape *compoundShape =
108 dynamic_cast<btCompoundShape *
>(
109 bLink->GetBulletLink()->getCollisionShape());
111 compoundShape->removeChildShape(shape);
113 this->collisionParent->GetRelativePose();
114 relativePose.
pos -= bLink->GetInertial()->GetCoG();
115 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 SetSize(double _radius, double _length)
Set the size of the cylinder.
Definition: BulletCylinderShape.hh:50
btCollisionShape * GetCollisionShape() const
Get the bullet collision shape.
Cylinder collision.
Definition: CylinderShape.hh:37
virtual void SetSize(double _radius, double _length)
Set the size of the cylinder.
Cylinder collision.
Definition: BulletCylinderShape.hh:38
#define gzwarn
Output a warning message.
Definition: Console.hh:46
virtual ~BulletCylinderShape()
Destructor.
Definition: BulletCylinderShape.hh:45
#define gzerr
Output an error message.
Definition: Console.hh:49
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
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
BulletCylinderShape(CollisionPtr _parent)
Constructor.
Definition: BulletCylinderShape.hh:41
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48