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 | btConvexInternalShape(); |
---|
23 | |
---|
24 | public: |
---|
25 | |
---|
26 | |
---|
27 | |
---|
28 | virtual ~btConvexInternalShape() |
---|
29 | { |
---|
30 | |
---|
31 | } |
---|
32 | |
---|
33 | virtual btVector3 localGetSupportingVertex(const btVector3& vec)const; |
---|
34 | |
---|
35 | const btVector3& getImplicitShapeDimensions() const |
---|
36 | { |
---|
37 | return m_implicitShapeDimensions; |
---|
38 | } |
---|
39 | |
---|
40 | ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version |
---|
41 | void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const |
---|
42 | { |
---|
43 | getAabbSlow(t,aabbMin,aabbMax); |
---|
44 | } |
---|
45 | |
---|
46 | |
---|
47 | |
---|
48 | virtual void getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; |
---|
49 | |
---|
50 | |
---|
51 | virtual void setLocalScaling(const btVector3& scaling); |
---|
52 | virtual const btVector3& getLocalScaling() const |
---|
53 | { |
---|
54 | return m_localScaling; |
---|
55 | } |
---|
56 | |
---|
57 | const btVector3& getLocalScalingNV() const |
---|
58 | { |
---|
59 | return m_localScaling; |
---|
60 | } |
---|
61 | |
---|
62 | virtual void setMargin(btScalar margin) |
---|
63 | { |
---|
64 | m_collisionMargin = margin; |
---|
65 | } |
---|
66 | virtual btScalar getMargin() const |
---|
67 | { |
---|
68 | return m_collisionMargin; |
---|
69 | } |
---|
70 | |
---|
71 | btScalar getMarginNV() const |
---|
72 | { |
---|
73 | return m_collisionMargin; |
---|
74 | } |
---|
75 | |
---|
76 | virtual int getNumPreferredPenetrationDirections() const |
---|
77 | { |
---|
78 | return 0; |
---|
79 | } |
---|
80 | |
---|
81 | virtual void getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const |
---|
82 | { |
---|
83 | (void)penetrationVector; |
---|
84 | (void)index; |
---|
85 | btAssert(0); |
---|
86 | } |
---|
87 | |
---|
88 | |
---|
89 | |
---|
90 | }; |
---|
91 | |
---|
92 | |
---|
93 | #endif //BT_CONVEX_INTERNAL_SHAPE_H |
---|