~ubuntu-branches/ubuntu/maverick/blender/maverick

« back to all changes in this revision

Viewing changes to extern/bullet2/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h

  • Committer: Bazaar Package Importer
  • Author(s): Khashayar Naderehvandi, Khashayar Naderehvandi, Alessio Treglia
  • Date: 2009-01-22 16:53:59 UTC
  • mfrom: (14.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090122165359-v0996tn7fbit64ni
Tags: 2.48a+dfsg-1ubuntu1
[ Khashayar Naderehvandi ]
* Merge from debian experimental (LP: #320045), Ubuntu remaining changes:
  - Add patch correcting header file locations.
  - Add libvorbis-dev and libgsm1-dev to Build-Depends.
  - Use avcodec_decode_audio2() in source/blender/src/hddaudio.c

[ Alessio Treglia ]
* Add missing previous changelog entries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#ifndef BROADPHASE_PROXY_H
17
17
#define BROADPHASE_PROXY_H
18
18
 
19
 
#include "../../LinearMath/btScalar.h" //for SIMD_FORCE_INLINE
 
19
#include "LinearMath/btScalar.h" //for SIMD_FORCE_INLINE
 
20
#include "LinearMath/btAlignedAllocator.h"
20
21
 
21
22
 
22
23
/// btDispatcher uses these types
38
39
        CONE_SHAPE_PROXYTYPE,
39
40
        CONVEX_SHAPE_PROXYTYPE,
40
41
        CYLINDER_SHAPE_PROXYTYPE,
 
42
        UNIFORM_SCALING_SHAPE_PROXYTYPE,
41
43
        MINKOWSKI_SUM_SHAPE_PROXYTYPE,
42
44
        MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE,
43
45
//concave shapes
44
46
CONCAVE_SHAPES_START_HERE,
45
47
        //keep all the convex shapetype below here, for the check IsConvexShape in broadphase proxy!
46
48
        TRIANGLE_MESH_SHAPE_PROXYTYPE,
 
49
        SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE,
47
50
        ///used for demo integration FAST/Swift collision library and Bullet
48
51
        FAST_CONCAVE_MESH_PROXYTYPE,
49
52
        //terrain
50
53
        TERRAIN_SHAPE_PROXYTYPE,
51
54
///Used for GIMPACT Trimesh integration
52
55
        GIMPACT_SHAPE_PROXYTYPE,
 
56
///Multimaterial mesh
 
57
    MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE,
53
58
        
54
59
        EMPTY_SHAPE_PROXYTYPE,
55
60
        STATIC_PLANE_PROXYTYPE,
57
62
 
58
63
        COMPOUND_SHAPE_PROXYTYPE,
59
64
 
 
65
        SOFTBODY_SHAPE_PROXYTYPE,
 
66
 
60
67
        MAX_BROADPHASE_COLLISION_TYPES
61
68
};
62
69
 
63
70
 
64
 
///btBroadphaseProxy
65
 
struct btBroadphaseProxy
 
71
///The btBroadphaseProxy is the main class that can be used with the Bullet broadphases. 
 
72
///It stores collision shape type information, collision filter information and a client object, typically a btCollisionObject or btRigidBody.
 
73
ATTRIBUTE_ALIGNED16(struct) btBroadphaseProxy
66
74
{
 
75
 
 
76
BT_DECLARE_ALIGNED_ALLOCATOR();
67
77
        
68
78
        ///optional filtering to cull potential collisions
69
79
        enum CollisionFilterGroups
73
83
                KinematicFilter = 4,
74
84
                DebrisFilter = 8,
75
85
                        SensorTrigger = 16,
76
 
                AllFilter = DefaultFilter | StaticFilter | KinematicFilter | DebrisFilter | SensorTrigger
 
86
                AllFilter = -1 //all bits sets: DefaultFilter | StaticFilter | KinematicFilter | DebrisFilter | SensorTrigger
77
87
        };
78
88
 
79
89
        //Usually the client btCollisionObject or Rigidbody class
80
90
        void*   m_clientObject;
 
91
 
81
92
        short int m_collisionFilterGroup;
82
93
        short int m_collisionFilterMask;
83
94
 
 
95
        void*   m_multiSapParentProxy;          
 
96
 
 
97
 
 
98
        int                     m_uniqueId;//m_uniqueId is introduced for paircache. could get rid of this, by calculating the address offset etc.
 
99
 
 
100
        SIMD_FORCE_INLINE int getUid() const
 
101
        {
 
102
                return m_uniqueId;
 
103
        }
 
104
 
84
105
        //used for memory pools
85
 
        btBroadphaseProxy() :m_clientObject(0){}
 
106
        btBroadphaseProxy() :m_clientObject(0),m_multiSapParentProxy(0)
 
107
        {
 
108
        }
86
109
 
87
 
        btBroadphaseProxy(void* userPtr,short int collisionFilterGroup, short int collisionFilterMask)
 
110
        btBroadphaseProxy(void* userPtr,short int collisionFilterGroup, short int collisionFilterMask,void* multiSapParentProxy=0)
88
111
                :m_clientObject(userPtr),
89
112
                m_collisionFilterGroup(collisionFilterGroup),
90
113
                m_collisionFilterMask(collisionFilterMask)
91
114
        {
 
115
                m_multiSapParentProxy = multiSapParentProxy;
92
116
        }
93
117
 
94
 
        static inline bool isPolyhedral(int proxyType)
 
118
        
 
119
 
 
120
        static SIMD_FORCE_INLINE bool isPolyhedral(int proxyType)
95
121
        {
96
122
                return (proxyType  < IMPLICIT_CONVEX_SHAPES_START_HERE);
97
123
        }
98
124
 
99
 
        static inline bool      isConvex(int proxyType)
 
125
        static SIMD_FORCE_INLINE bool   isConvex(int proxyType)
100
126
        {
101
127
                return (proxyType < CONCAVE_SHAPES_START_HERE);
102
128
        }
103
129
 
104
 
        static inline bool      isConcave(int proxyType)
 
130
        static SIMD_FORCE_INLINE bool   isConcave(int proxyType)
105
131
        {
106
132
                return ((proxyType > CONCAVE_SHAPES_START_HERE) &&
107
133
                        (proxyType < CONCAVE_SHAPES_END_HERE));
108
134
        }
109
 
        static inline bool      isCompound(int proxyType)
 
135
        static SIMD_FORCE_INLINE bool   isCompound(int proxyType)
110
136
        {
111
137
                return (proxyType == COMPOUND_SHAPE_PROXYTYPE);
112
138
        }
113
 
        static inline bool isInfinite(int proxyType)
 
139
        static SIMD_FORCE_INLINE bool isInfinite(int proxyType)
114
140
        {
115
141
                return (proxyType == STATIC_PLANE_PROXYTYPE);
116
142
        }
124
150
 
125
151
 
126
152
 
127
 
/// contains a pair of aabb-overlapping objects
128
 
struct btBroadphasePair
 
153
///The btBroadphasePair class contains a pair of aabb-overlapping objects.
 
154
///A btDispatcher can search a btCollisionAlgorithm that performs exact/narrowphase collision detection on the actual collision shapes.
 
155
ATTRIBUTE_ALIGNED16(struct) btBroadphasePair
129
156
{
130
157
        btBroadphasePair ()
131
158
                :
136
163
        {
137
164
        }
138
165
 
 
166
BT_DECLARE_ALIGNED_ALLOCATOR();
 
167
 
139
168
        btBroadphasePair(const btBroadphasePair& other)
140
169
                :               m_pProxy0(other.m_pProxy0),
141
170
                                m_pProxy1(other.m_pProxy1),
181
210
*/
182
211
 
183
212
 
 
213
 
184
214
class btBroadphasePairSortPredicate
185
215
{
186
216
        public: