2
Bullet Continuous Collision Detection and Physics Library
3
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
5
This software is provided 'as-is', without any express or implied warranty.
6
In no event will the authors be held liable for any damages arising from the use of this software.
7
Permission is granted to anyone to use this software for any purpose,
8
including commercial applications, and to alter it and redistribute it freely,
9
subject to the following restrictions:
11
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13
3. This notice may not be removed or altered from any source distribution.
16
#ifndef COLLISION_OBJECT_H
17
#define COLLISION_OBJECT_H
19
#include "SimdTransform.h"
21
//island management, m_activationState1
23
#define ISLAND_SLEEPING 2
24
#define WANTS_DEACTIVATION 3
25
#define DISABLE_DEACTIVATION 4
26
#define DISABLE_SIMULATION 5
28
struct BroadphaseProxy;
31
struct CollisionObject
33
SimdTransform m_worldTransform;
35
//m_interpolationWorldTransform is used for CCD and interpolation
36
//it can be either previous or future (predicted) transform
37
SimdTransform m_interpolationWorldTransform;
42
noContactResponse = 2,
49
int m_activationState1;
50
float m_deactivationTime;
52
BroadphaseProxy* m_broadphaseHandle;
53
CollisionShape* m_collisionShape;
55
void* m_userPointer;//not use by Bullet internally
57
//time of impact calculation
60
bool mergesSimulationIslands() const;
62
inline bool IsStatic() const {
63
return m_collisionFlags & isStatic;
66
inline bool HasContactResponse() {
67
return !(m_collisionFlags & noContactResponse);
76
void SetCollisionShape(CollisionShape* collisionShape)
78
m_collisionShape = collisionShape;
81
int GetActivationState() const { return m_activationState1;}
83
void SetActivationState(int newState);
85
void ForceActivationState(int newState);
89
inline bool IsActive() const
91
return ((GetActivationState() != ISLAND_SLEEPING) && (GetActivationState() != DISABLE_SIMULATION));
97
#endif //COLLISION_OBJECT_H