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

« back to all changes in this revision

Viewing changes to extern/bullet2/src/BulletCollision/CollisionShapes/btConvexInternalShape.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:
 
1
 
 
2
#ifndef BT_CONVEX_INTERNAL_SHAPE_H
 
3
#define BT_CONVEX_INTERNAL_SHAPE_H
 
4
 
 
5
#include "btConvexShape.h"
 
6
 
 
7
///The btConvexInternalShape is an internal base class, shared by most convex shape implementations.
 
8
class btConvexInternalShape : public btConvexShape
 
9
{
 
10
 
 
11
        protected:
 
12
 
 
13
        //local scaling. collisionMargin is not scaled !
 
14
        btVector3       m_localScaling;
 
15
 
 
16
        btVector3       m_implicitShapeDimensions;
 
17
        
 
18
        btScalar        m_collisionMargin;
 
19
 
 
20
        btScalar        m_padding;
 
21
 
 
22
public:
 
23
 
 
24
        btConvexInternalShape();
 
25
 
 
26
        virtual ~btConvexInternalShape()
 
27
        {
 
28
 
 
29
        }
 
30
 
 
31
 
 
32
        virtual btVector3       localGetSupportingVertex(const btVector3& vec)const;
 
33
#ifndef __SPU__
 
34
        virtual btVector3       localGetSupportingVertexWithoutMargin(const btVector3& vec) const= 0;
 
35
        
 
36
        //notice that the vectors should be unit length
 
37
        virtual void    batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const= 0;
 
38
#endif //#ifndef __SPU__
 
39
 
 
40
        const btVector3& getImplicitShapeDimensions() const
 
41
        {
 
42
                return m_implicitShapeDimensions;
 
43
        }
 
44
 
 
45
        ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
 
46
        void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
 
47
        {
 
48
                getAabbSlow(t,aabbMin,aabbMax);
 
49
        }
 
50
 
 
51
 
 
52
        
 
53
        virtual void getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
 
54
 
 
55
 
 
56
        virtual void    setLocalScaling(const btVector3& scaling);
 
57
        virtual const btVector3& getLocalScaling() const 
 
58
        {
 
59
                return m_localScaling;
 
60
        }
 
61
 
 
62
        const btVector3& getLocalScalingNV() const 
 
63
        {
 
64
                return m_localScaling;
 
65
        }
 
66
 
 
67
        virtual void    setMargin(btScalar margin)
 
68
        {
 
69
                m_collisionMargin = margin;
 
70
        }
 
71
        virtual btScalar        getMargin() const
 
72
        {
 
73
                return m_collisionMargin;
 
74
        }
 
75
 
 
76
        btScalar        getMarginNV() const
 
77
        {
 
78
                return m_collisionMargin;
 
79
        }
 
80
 
 
81
        virtual int             getNumPreferredPenetrationDirections() const
 
82
        {
 
83
                return 0;
 
84
        }
 
85
        
 
86
        virtual void    getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const
 
87
        {
 
88
                (void)penetrationVector;
 
89
                (void)index;
 
90
                btAssert(0);
 
91
        }
 
92
 
 
93
 
 
94
        
 
95
};
 
96
 
 
97
 
 
98
#endif //BT_CONVEX_INTERNAL_SHAPE_H