~ubuntu-branches/ubuntu/precise/supertuxkart/precise

« back to all changes in this revision

Viewing changes to src/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.h

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2011-02-24 22:36:25 UTC
  • mfrom: (1.1.9 upstream) (6.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110224223625-ygrjfpg92obovuch
Tags: 0.7+dfsg1-1
New upstream release

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
 
///btConvexInternalShape carries some additional data, shared by most 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
 
1
 
 
2
#ifndef BT_CONVEX_INTERNAL_SHAPE_H
 
3
#define BT_CONVEX_INTERNAL_SHAPE_H
 
4
 
 
5
#include "btConvexShape.h"
 
6
 
 
7
///btConvexInternalShape carries some additional data, shared by most 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