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"
128 CF_KINEMATIC_OBJECT= 2,
129 CF_NO_CONTACT_RESPONSE = 4,
130 CF_CUSTOM_MATERIAL_CALLBACK = 8,
131 CF_CHARACTER_OBJECT = 16,
132 CF_DISABLE_VISUALIZE_OBJECT = 32,
133 CF_DISABLE_SPU_COLLISION_PROCESSING = 64
138 CO_COLLISION_OBJECT =1,
146 CO_FEATHERSTONE_LINK=64
151 CF_ANISOTROPIC_FRICTION_DISABLED=0,
152 CF_ANISOTROPIC_FRICTION = 1,
153 CF_ANISOTROPIC_ROLLING_FRICTION = 2
159 return ((m_collisionFlags & (CF_STATIC_OBJECT | CF_KINEMATIC_OBJECT | CF_NO_CONTACT_RESPONSE) )==0);
164 return m_anisotropicFriction;
168 m_anisotropicFriction = anisotropicFriction;
169 bool isUnity = (anisotropicFriction[0]!=1.f) || (anisotropicFriction[1]!=1.f) || (anisotropicFriction[2]!=1.f);
170 m_hasAnisotropicFriction = isUnity?frictionMode : 0;
174 return (m_hasAnisotropicFriction&frictionMode)!=0;
181 m_contactProcessingThreshold = contactProcessingThreshold;
185 return m_contactProcessingThreshold;
189 return (m_collisionFlags & CF_STATIC_OBJECT) != 0;
194 return (m_collisionFlags & CF_KINEMATIC_OBJECT) != 0;
199 return (m_collisionFlags & (CF_KINEMATIC_OBJECT | CF_STATIC_OBJECT)) != 0 ;
203 return (m_collisionFlags & CF_NO_CONTACT_RESPONSE)==0;
214 m_collisionShape = collisionShape;
215 m_rootCollisionShape = collisionShape;
220 return m_collisionShape;
225 return m_collisionShape;
236 return m_extensionPointer;
242 m_extensionPointer = pointer;
247 void setActivationState(
int newState)
const;
251 m_deactivationTime = time;
255 return m_deactivationTime;
258 void forceActivationState(
int newState)
const;
260 void activate(
bool forceActivation =
false)
const;
270 m_restitution = rest;
274 return m_restitution;
289 m_rollingFriction = frict;
293 return m_rollingFriction;
300 return m_internalType;
305 return m_worldTransform;
310 return m_worldTransform;
316 m_worldTransform = worldTrans;
322 return m_broadphaseHandle;
327 return m_broadphaseHandle;
332 m_broadphaseHandle = handle;
338 return m_interpolationWorldTransform;
343 return m_interpolationWorldTransform;
349 m_interpolationWorldTransform = trans;
355 m_interpolationLinearVelocity = linvel;
361 m_interpolationAngularVelocity = angvel;
366 return m_interpolationLinearVelocity;
371 return m_interpolationAngularVelocity;
386 return m_companionId;
396 return m_hitFraction;
401 m_hitFraction = hitFraction;
407 return m_collisionFlags;
412 m_collisionFlags = flags;
418 return m_ccdSweptSphereRadius;
424 m_ccdSweptSphereRadius = radius;
429 return m_ccdMotionThreshold;
434 return m_ccdMotionThreshold*m_ccdMotionThreshold;
442 m_ccdMotionThreshold = ccdMotionThreshold;
448 return m_userObjectPointer;
458 m_userObjectPointer = userPointer;
469 return m_updateRevision;
475 if (m_checkCollideWith)
476 return checkCollideWithOverride(co);
481 virtual int calculateSerializeBufferSize()
const;
484 virtual const char* serialize(
void* dataBuffer,
class btSerializer* serializer)
const;
486 virtual void serializeSingleObject(
class btSerializer* serializer)
const;
565 #endif //BT_COLLISION_OBJECT_H
btTransformFloatData m_worldTransform
int getUpdateRevisionInternal() const
btScalar getDeactivationTime() const
btScalar getCcdMotionThreshold() const
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
btScalar getCcdSweptSphereRadius() const
Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::
double m_contactProcessingThreshold
btVector3FloatData m_anisotropicFriction
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...
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::
int getInternalType() const
reserved for Bullet internal usage
const btVector3 & getInterpolationAngularVelocity() const
virtual int calculateSerializeBufferSize() const
btTransformFloatData m_interpolationWorldTransform
float m_ccdMotionThreshold
bool mergesSimulationIslands() const
void setCcdMotionThreshold(btScalar ccdMotionThreshold)
Don't do continuous collision detection if the motion (in one step) is less then m_ccdMotionThreshold...
double m_ccdSweptSphereRadius
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)
#define SIMD_FORCE_INLINE
int m_hasAnisotropicFriction
btScalar getContactProcessingThreshold() const
int getCollisionFlags() const
int m_hasAnisotropicFriction
#define btCollisionObjectData
btTransform m_worldTransform
btVector3DoubleData m_anisotropicFriction
const btVector3 & getInterpolationLinearVelocity() const
btCollisionShape * m_collisionShape
btCollisionShapeData * m_rootCollisionShape
bool hasContactResponse() const
void setRestitution(btScalar rest)
const btVector3 & getAnisotropicFriction() const
btVector3DoubleData m_interpolationAngularVelocity
btCollisionShapeData * m_rootCollisionShape
btScalar getCcdSquareMotionThreshold() const
const btTransform & getInterpolationWorldTransform() 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()
void * getUserPointer() const
users can point to their objects, userPointer is not used by Bullet
void setFriction(btScalar frict)
bool isKinematicObject() 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...
btVector3FloatData m_interpolationLinearVelocity
btAlignedObjectArray< class btCollisionObject * > btCollisionObjectArray
float m_ccdSweptSphereRadius
btTransform & getInterpolationWorldTransform()
bool isStaticOrKinematicObject() const
bool checkCollideWith(const btCollisionObject *co) 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
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.
btScalar m_contactProcessingThreshold
btScalar getRestitution() const
void setDeactivationTime(btScalar time)
void setWorldTransform(const btTransform &worldTrans)
void setCompanionId(int id)
int m_updateRevision
internal update revision number. It will be increased when the object changes. This allows some subsy...
void setInterpolationWorldTransform(const btTransform &trans)
The btBroadphaseProxy is the main class that can be used with the Bullet broadphases.
btScalar getHitFraction() const
double m_ccdMotionThreshold
void setInterpolationAngularVelocity(const btVector3 &angvel)
btScalar m_rollingFriction
btVector3 can be used to represent 3D points and vectors.
#define ATTRIBUTE_ALIGNED16(a)
const btBroadphaseProxy * getBroadphaseHandle() const
int getCompanionId() const
void setAnisotropicFriction(const btVector3 &anisotropicFriction, int frictionMode=CF_ANISOTROPIC_FRICTION)
void * m_broadphaseHandle
btCollisionShape * getCollisionShape()
void setCollisionFlags(int flags)
void setBroadphaseHandle(btBroadphaseProxy *handle)
bool hasAnisotropicFriction(int frictionMode=CF_ANISOTROPIC_FRICTION) const
btTransformDoubleData m_worldTransform
btTransformDoubleData m_interpolationWorldTransform
btVector3 m_interpolationAngularVelocity
float m_contactProcessingThreshold
btScalar getRollingFriction() const
void setIslandTag(int tag)
void setRollingFriction(btScalar frict)
btScalar getFriction() const
const btTransform & getWorldTransform() const
#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...
virtual bool checkCollideWithOverride(const btCollisionObject *) const
void * m_userObjectPointer
void * m_broadphaseHandle
void * internalGetExtensionPointer() const
Avoid using this internal API call, the extension pointer is used by some Bullet extensions.
void setInterpolationLinearVelocity(const btVector3 &linvel)
double m_deactivationTime
btBroadphaseProxy * m_broadphaseHandle
btVector3 m_interpolationLinearVelocity
void setContactProcessingThreshold(btScalar contactProcessingThreshold)
the constraint solver can discard solving contacts, if the distance is above this threshold...
const btCollisionShape * getCollisionShape() const
int getActivationState() const
btVector3FloatData m_interpolationAngularVelocity
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...