34 #include "LinearMath/btVector3.h"
35 #include "BulletCollision/CollisionShapes/btSphereShape.h"
75 tgRigidInfo::initRigidBody(world);
92 std::cout <<
"creating sphere with tags " << getTags() << std::endl;
104 const double radius = m_config.
radius;
106 new btSphereShape(radius);
118 const double radius = m_config.
radius;
119 const double density = m_config.
density;
120 const double volume = 4.0 / 3.0 * M_PI * radius * radius * radius;
121 return volume * density;
126 const btVector3& destinationPoint)
const
133 const btVector3& destinationPoint,
134 const double rotation)
const
136 if (referencePoint == destinationPoint)
139 std::invalid_argument(
"Destination point is the reference point.");
144 std::cerr <<
"Rotation not yet supported due to lack of central axis" << std::endl;
148 const btVector3 startPoint = (
getNode());
150 const btVector3 refToDest =
151 (destinationPoint - referencePoint).normalize();
155 const btVector3 surfaceVector = refToDest
160 return startPoint + surfaceVector;
165 std::set<tgRigidInfo*> leaves;
171 std::set<btVector3> contained;
Definition of class tgSphereInfo.
const btVector3 & getNode() const
Contains the definition of class tgWorldBulletPhysicsImpl.
const double rollFriction
tgSphereInfo(const tgSphere::Config &config)
virtual void initRigidBody(tgWorld &world)
tgRigidInfo * createRigidInfo(const tgNode &node)
virtual btCollisionShape * getCollisionShape(tgWorld &world) const
virtual double getMass() const
virtual btRigidBody * getRigidBody()
btCollisionObject * m_collisionObject
tgWorldImpl & implementation() const
virtual std::set< tgRigidInfo * > getLeafRigids()
virtual btVector3 getConnectionPoint(const btVector3 &referencePoint, const btVector3 &destinationPoint) const
void addCollisionShape(btCollisionShape *pShape)
virtual std::set< btVector3 > getContainedNodes() const
btCollisionShape * m_collisionShape