16 #ifndef BT_COLLISION_OBJECT_H    17 #define BT_COLLISION_OBJECT_H    23 #define ISLAND_SLEEPING 2    24 #define WANTS_DEACTIVATION 3    25 #define DISABLE_DEACTIVATION 4    26 #define DISABLE_SIMULATION 5    37 #ifdef BT_USE_DOUBLE_PRECISION    38 #define btCollisionObjectData btCollisionObjectDoubleData    39 #define btCollisionObjectDataName "btCollisionObjectDoubleData"    41 #define btCollisionObjectData btCollisionObjectFloatData    42 #define btCollisionObjectDataName "btCollisionObjectFloatData"   134                 CF_KINEMATIC_OBJECT= 2,
   135                 CF_NO_CONTACT_RESPONSE = 4,
   136                 CF_CUSTOM_MATERIAL_CALLBACK = 8,
   137                 CF_CHARACTER_OBJECT = 16,
   138                 CF_DISABLE_VISUALIZE_OBJECT = 32, 
   139                 CF_DISABLE_SPU_COLLISION_PROCESSING = 64,
   140                 CF_HAS_CONTACT_STIFFNESS_DAMPING = 128,
   141                 CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR = 256,
   146                 CO_COLLISION_OBJECT =1,
   154                 CO_FEATHERSTONE_LINK=64
   159                 CF_ANISOTROPIC_FRICTION_DISABLED=0,
   160                 CF_ANISOTROPIC_FRICTION = 1,
   161                 CF_ANISOTROPIC_ROLLING_FRICTION = 2
   167                 return  ((m_collisionFlags & (CF_STATIC_OBJECT | CF_KINEMATIC_OBJECT | CF_NO_CONTACT_RESPONSE) )==0);
   172                 return m_anisotropicFriction;
   176                 m_anisotropicFriction = anisotropicFriction;
   177                 bool isUnity = (anisotropicFriction[0]!=1.f) || (anisotropicFriction[1]!=1.f) || (anisotropicFriction[2]!=1.f);
   178                 m_hasAnisotropicFriction = isUnity?frictionMode : 0;
   182                 return (m_hasAnisotropicFriction&frictionMode)!=0;
   189                 m_contactProcessingThreshold = contactProcessingThreshold;
   193                 return m_contactProcessingThreshold;
   197                 return (m_collisionFlags & CF_STATIC_OBJECT) != 0;
   202                 return (m_collisionFlags & CF_KINEMATIC_OBJECT) != 0;
   207                 return (m_collisionFlags & (CF_KINEMATIC_OBJECT | CF_STATIC_OBJECT)) != 0 ;
   211                 return (m_collisionFlags & CF_NO_CONTACT_RESPONSE)==0;
   222                 m_collisionShape = collisionShape;
   223                 m_rootCollisionShape = collisionShape;
   228                 return m_collisionShape;
   233                 return m_collisionShape;
   238                 if (ignoreCollisionCheck)
   244                         m_objectsWithoutCollisionCheck.
push_back(co);
   249                         m_objectsWithoutCollisionCheck.
remove(co);
   251                 m_checkCollideWith = m_objectsWithoutCollisionCheck.
size() > 0;
   257                 if (index < m_objectsWithoutCollisionCheck.
size())
   271                 return m_extensionPointer;
   277                 m_extensionPointer = pointer;
   282         void setActivationState(
int newState) 
const;
   286                 m_deactivationTime = time;
   290                 return m_deactivationTime;
   293         void forceActivationState(
int newState) 
const;
   295         void    activate(
bool forceActivation = 
false) 
const;
   305                 m_restitution = rest;
   309                 return m_restitution;
   324                 m_rollingFriction = frict;
   328                 return m_rollingFriction;
   333         m_spinningFriction = frict;
   337         return m_spinningFriction;
   342                 m_contactStiffness = stiffness;
   343                 m_contactDamping = damping;
   345                 m_collisionFlags |=CF_HAS_CONTACT_STIFFNESS_DAMPING;
   356                 return m_contactStiffness;
   361                 return m_contactDamping;
   367                 return m_internalType;
   372                 return m_worldTransform;
   377                 return m_worldTransform;
   383                 m_worldTransform = worldTrans;
   389                 return m_broadphaseHandle;
   394                 return m_broadphaseHandle;
   399                 m_broadphaseHandle = handle;
   405                 return m_interpolationWorldTransform;
   410                 return m_interpolationWorldTransform;
   416                 m_interpolationWorldTransform = trans;
   422                 m_interpolationLinearVelocity = linvel;
   428                 m_interpolationAngularVelocity = angvel;
   433                 return m_interpolationLinearVelocity;
   438                 return m_interpolationAngularVelocity;
   453                 return  m_companionId;
   463         return  m_worldArrayIndex;
   469         m_worldArrayIndex = ix;
   474                 return m_hitFraction; 
   479                 m_hitFraction = hitFraction;
   485                 return m_collisionFlags;
   490                 m_collisionFlags = flags;
   496                 return m_ccdSweptSphereRadius;
   502                 m_ccdSweptSphereRadius = radius;
   507                 return m_ccdMotionThreshold;
   512                 return m_ccdMotionThreshold*m_ccdMotionThreshold;
   520                 m_ccdMotionThreshold = ccdMotionThreshold;
   526                 return m_userObjectPointer;
   542                 m_userObjectPointer = userPointer;
   553                 m_userIndex2 = index;
   558                 return m_updateRevision;
   563                 m_customDebugColorRGB = colorRGB;
   564                 m_collisionFlags |= CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR;
   569                 m_collisionFlags &= ~CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR;
   574                 bool hasCustomColor = (0!=(m_collisionFlags&CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR));
   577                         colorRGB = m_customDebugColorRGB;
   579                 return hasCustomColor;
   584                 if (m_checkCollideWith)
   585                         return checkCollideWithOverride(co);
   590         virtual int     calculateSerializeBufferSize()  
const;
   593         virtual const char*     serialize(
void* dataBuffer, 
class btSerializer* serializer) 
const;
   595         virtual void serializeSingleObject(
class btSerializer* serializer) 
const;
   677 #endif //BT_COLLISION_OBJECT_H 
btTransformFloatData m_worldTransform
void setUserIndex2(int index)
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
const btVector3 & getInterpolationAngularVelocity() const
void setContactStiffnessAndDamping(btScalar stiffness, btScalar damping)
void push_back(const T &_Val)
double m_contactProcessingThreshold
int getUserIndex2() const
btVector3FloatData m_anisotropicFriction
btScalar getContactDamping() const
bool mergesSimulationIslands() const
btScalar m_ccdMotionThreshold
Don't do continuous collision detection if the motion (in one step) is less then m_ccdMotionThreshold...
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
int findLinearSearch(const T &key) const
const btBroadphaseProxy * getBroadphaseHandle() const
btTransform m_interpolationWorldTransform
m_interpolationWorldTransform is used for CCD and interpolation it can be either previous or future (...
btScalar m_ccdSweptSphereRadius
Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm:: 
void removeCustomDebugColor()
btTransformFloatData m_interpolationWorldTransform
float m_ccdMotionThreshold
void setCcdMotionThreshold(btScalar ccdMotionThreshold)
Don't do continuous collision detection if the motion (in one step) is less then m_ccdMotionThreshold...
btScalar getContactStiffness() const
double m_ccdSweptSphereRadius
btAlignedObjectArray< const btCollisionObject * > m_objectsWithoutCollisionCheck
btScalar m_hitFraction
time of impact calculation 
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
void setHitFraction(btScalar hitFraction)
double m_contactStiffness
btScalar m_contactDamping
bool isKinematicObject() const
const btTransform & getWorldTransform() const
void setWorldArrayIndex(int ix)
#define SIMD_FORCE_INLINE
int m_hasAnisotropicFriction
int getActivationState() const
int m_hasAnisotropicFriction
#define btCollisionObjectData
btScalar m_spinningFriction
btTransform m_worldTransform
bool isStaticOrKinematicObject() const
void setCustomDebugColor(const btVector3 &colorRGB)
btVector3DoubleData m_anisotropicFriction
btCollisionShape * m_collisionShape
btCollisionShapeData * m_rootCollisionShape
void setIgnoreCollisionCheck(const btCollisionObject *co, bool ignoreCollisionCheck)
void setRestitution(btScalar rest)
bool checkCollideWith(const btCollisionObject *co) const
btVector3DoubleData m_interpolationAngularVelocity
btCollisionShapeData * m_rootCollisionShape
const btVector3 & getInterpolationLinearVelocity() const
btVector3 m_anisotropicFriction
btScalar m_deactivationTime
virtual void setCollisionShape(btCollisionShape *collisionShape)
int m_hasAnisotropicFriction
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
btTransform & getWorldTransform()
int m_internalType
m_internalType is reserved to distinguish Bullet's btCollisionObject, btRigidBody, btSoftBody, btGhostObject etc. 
btBroadphaseProxy * getBroadphaseHandle()
const btVector3 & getAnisotropicFriction() const
void setFriction(btScalar frict)
btScalar getCcdSquareMotionThreshold() const
bool isStaticObject() const
void setCcdSweptSphereRadius(btScalar radius)
Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm:: 
btCollisionShape * m_rootCollisionShape
m_rootCollisionShape is temporarily used to store the original collision shape The m_collisionShape m...
void setSpinningFriction(btScalar frict)
btVector3FloatData m_interpolationLinearVelocity
btAlignedObjectArray< class btCollisionObject * > btCollisionObjectArray
float m_ccdSweptSphereRadius
btScalar getRestitution() const
btTransform & getInterpolationWorldTransform()
btScalar getDeactivationTime() const
btCollisionObject can be used to manage collision detection objects. 
void setUserPointer(void *userPointer)
users can point to their objects, userPointer is not used by Bullet 
#define DISABLE_SIMULATION
bool hasContactResponse() const
const btTransform & getInterpolationWorldTransform() const
void setUserIndex(int index)
users can point to their objects, userPointer is not used by Bullet 
void * m_extensionPointer
m_extensionPointer is used by some internal low-level Bullet extensions. 
btVector3 m_customDebugColorRGB
btScalar m_contactProcessingThreshold
virtual int calculateSerializeBufferSize() const
void setDeactivationTime(btScalar time)
void setWorldTransform(const btTransform &worldTrans)
void setCompanionId(int id)
int getWorldArrayIndex() const
int m_updateRevision
internal update revision number. It will be increased when the object changes. This allows some subsy...
btScalar getRollingFriction() const
void setInterpolationWorldTransform(const btTransform &trans)
int getCollisionFlags() const
The btBroadphaseProxy is the main class that can be used with the Bullet broadphases. 
btScalar getContactProcessingThreshold() const
double m_ccdMotionThreshold
void * internalGetExtensionPointer() const
Avoid using this internal API call, the extension pointer is used by some Bullet extensions. 
void setInterpolationAngularVelocity(const btVector3 &angvel)
btScalar m_rollingFriction
btVector3 can be used to represent 3D points and vectors. 
#define ATTRIBUTE_ALIGNED16(a)
int size() const
return the number of elements in the array 
void setAnisotropicFriction(const btVector3 &anisotropicFriction, int frictionMode=CF_ANISOTROPIC_FRICTION)
void * m_broadphaseHandle
btScalar getCcdMotionThreshold() const
btCollisionShape * getCollisionShape()
void setCollisionFlags(int flags)
void setBroadphaseHandle(btBroadphaseProxy *handle)
btScalar getSpinningFriction() const
btScalar getHitFraction() const
void remove(const T &key)
btTransformDoubleData m_worldTransform
btTransformDoubleData m_interpolationWorldTransform
btVector3 m_interpolationAngularVelocity
float m_contactProcessingThreshold
void setIslandTag(int tag)
int getInternalType() const
reserved for Bullet internal usage 
void setRollingFriction(btScalar frict)
#define BT_DECLARE_ALIGNED_ALLOCATOR()
btVector3DoubleData m_interpolationLinearVelocity
int m_checkCollideWith
If some object should have elaborate collision filtering by sub-classes. 
void internalSetExtensionPointer(void *pointer)
Avoid using this internal API call, the extension pointer is used by some Bullet extensions If you ne...
bool getCustomDebugColor(btVector3 &colorRGB) const
btScalar m_contactStiffness
void * m_userObjectPointer
users can point to their objects, m_userPointer is not used by Bullet, see setUserPointer/getUserPoin...
void * m_broadphaseHandle
void setInterpolationLinearVelocity(const btVector3 &linvel)
double m_deactivationTime
bool hasAnisotropicFriction(int frictionMode=CF_ANISOTROPIC_FRICTION) const
btBroadphaseProxy * m_broadphaseHandle
btScalar getCcdSweptSphereRadius() const
Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm:: 
btVector3 m_interpolationLinearVelocity
void setContactProcessingThreshold(btScalar contactProcessingThreshold)
the constraint solver can discard solving contacts, if the distance is above this threshold...
btScalar getFriction() const
btVector3FloatData m_interpolationAngularVelocity
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
int getCompanionId() const
virtual bool checkCollideWithOverride(const btCollisionObject *co) const
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
const btCollisionShape * getCollisionShape() const
void * getUserPointer() const
users can point to their objects, userPointer is not used by Bullet 
int getUpdateRevisionInternal() const