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

« back to all changes in this revision

Viewing changes to extern/bullet2/src/BulletCollision/CollisionShapes/btCollisionShape.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 COLLISION_SHAPE_H
17
17
#define COLLISION_SHAPE_H
18
18
 
19
 
#include "../../LinearMath/btTransform.h"
20
 
#include "../../LinearMath/btVector3.h"
21
 
#include "../../LinearMath/btMatrix3x3.h"
22
 
#include "../../LinearMath/btPoint3.h"
23
 
#include "../BroadphaseCollision/btBroadphaseProxy.h" //for the shape types
 
19
#include "LinearMath/btTransform.h"
 
20
#include "LinearMath/btVector3.h"
 
21
#include "LinearMath/btMatrix3x3.h"
 
22
#include "LinearMath/btPoint3.h"
 
23
#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" //for the shape types
24
24
 
25
 
///btCollisionShape provides interface for collision shapes that can be shared among btCollisionObjects.
 
25
///The btCollisionShape class provides an interface for collision shapes that can be shared among btCollisionObjects.
26
26
class btCollisionShape
27
27
{
 
28
 
 
29
        void* m_userPointer;
 
30
 
28
31
public:
29
32
 
30
 
        btCollisionShape() 
 
33
        btCollisionShape() : m_userPointer(0)
31
34
        {
32
35
        }
33
36
        virtual ~btCollisionShape()
45
48
 
46
49
        ///calculateTemporalAabb calculates the enclosing aabb for the moving object over interval [0..timeStep)
47
50
        ///result is conservative
48
 
        void calculateTemporalAabb(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep, btVector3& temporalAabbMin,btVector3& temporalAabbMax);
 
51
        void calculateTemporalAabb(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep, btVector3& temporalAabbMin,btVector3& temporalAabbMax) const;
49
52
 
50
53
#ifndef __SPU__
51
54
 
52
 
        inline bool     isPolyhedral() const
 
55
        SIMD_FORCE_INLINE bool  isPolyhedral() const
53
56
        {
54
57
                return btBroadphaseProxy::isPolyhedral(getShapeType());
55
58
        }
56
59
 
57
 
        inline bool     isConvex() const
 
60
        SIMD_FORCE_INLINE bool  isConvex() const
58
61
        {
59
62
                return btBroadphaseProxy::isConvex(getShapeType());
60
63
        }
61
 
        inline bool     isConcave() const
 
64
        SIMD_FORCE_INLINE bool  isConcave() const
62
65
        {
63
66
                return btBroadphaseProxy::isConcave(getShapeType());
64
67
        }
65
 
        inline bool     isCompound() const
 
68
        SIMD_FORCE_INLINE bool  isCompound() const
66
69
        {
67
70
                return btBroadphaseProxy::isCompound(getShapeType());
68
71
        }
69
72
 
70
73
        ///isInfinite is used to catch simulation error (aabb check)
71
 
        inline bool isInfinite() const
 
74
        SIMD_FORCE_INLINE bool isInfinite() const
72
75
        {
73
76
                return btBroadphaseProxy::isInfinite(getShapeType());
74
77
        }
76
79
        virtual int             getShapeType() const=0;
77
80
        virtual void    setLocalScaling(const btVector3& scaling) =0;
78
81
        virtual const btVector3& getLocalScaling() const =0;
79
 
        virtual void    calculateLocalInertia(btScalar mass,btVector3& inertia) = 0;
 
82
        virtual void    calculateLocalInertia(btScalar mass,btVector3& inertia) const = 0;
80
83
 
81
84
 
82
85
//debugging support
83
 
        virtual char*   getName()const =0 ;
 
86
        virtual const char*     getName()const =0 ;
84
87
#endif //__SPU__
85
88
 
86
89
        
88
91
        virtual void    setMargin(btScalar margin) = 0;
89
92
        virtual btScalar        getMargin() const = 0;
90
93
 
 
94
        
 
95
        ///optional user data pointer
 
96
        void    setUserPointer(void* userPtr)
 
97
        {
 
98
                m_userPointer = userPtr;
 
99
        }
 
100
 
 
101
        void*   getUserPointer() const
 
102
        {
 
103
                return m_userPointer;
 
104
        }
 
105
 
91
106
};      
92
107
 
93
108
#endif //COLLISION_SHAPE_H