Panda3D
 All Classes Functions Variables Enumerations
bulletMinkowskiSumShape.I
1 // Filename: bulletMinkowskiSumShape.I
2 // Created by: enn0x (23Jan10)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 ////////////////////////////////////////////////////////////////////
16 // Function: BulletMinkowskiSumShape::Destructor
17 // Access: Published
18 // Description:
19 ////////////////////////////////////////////////////////////////////
20 INLINE BulletMinkowskiSumShape::
21 ~BulletMinkowskiSumShape() {
22 
23  delete _shape;
24 }
25 
26 ////////////////////////////////////////////////////////////////////
27 // Function: BulletMinkowskiSumShape::Copy Constructor
28 // Access: Published
29 // Description:
30 ////////////////////////////////////////////////////////////////////
31 INLINE BulletMinkowskiSumShape::
32 BulletMinkowskiSumShape(const BulletMinkowskiSumShape &copy) :
33  _shape(copy._shape),
34  _shape_a(copy._shape_a),
35  _shape_b(copy._shape_b) {
36 }
37 
38 ////////////////////////////////////////////////////////////////////
39 // Function: BulletMinkowskiSumShape::Copy Assignment Operator
40 // Access: Published
41 // Description:
42 ////////////////////////////////////////////////////////////////////
43 INLINE void BulletMinkowskiSumShape::
44 operator = (const BulletMinkowskiSumShape &copy) {
45  _shape = copy._shape;
46  _shape_a = copy._shape_a;
47  _shape_b = copy._shape_b;
48 }
49 
50 ////////////////////////////////////////////////////////////////////
51 // Function: BulletMinkowskiSumShape::set_transform_a
52 // Access: Published
53 // Description:
54 ////////////////////////////////////////////////////////////////////
55 INLINE void BulletMinkowskiSumShape::
56 set_transform_a(const TransformState *ts) {
57 
58  nassertv(ts);
59  _shape->setTransformA(TransformState_to_btTrans(ts));
60 }
61 
62 ////////////////////////////////////////////////////////////////////
63 // Function: BulletMinkowskiSumShape::set_transform_b
64 // Access: Published
65 // Description:
66 ////////////////////////////////////////////////////////////////////
67 INLINE void BulletMinkowskiSumShape::
68 set_transform_b(const TransformState *ts) {
69 
70  nassertv(ts);
71  _shape->setTransformB(TransformState_to_btTrans(ts));
72 }
73 
74 ////////////////////////////////////////////////////////////////////
75 // Function: BulletMinkowskiSumShape::get_transform_a
76 // Access: Published
77 // Description:
78 ////////////////////////////////////////////////////////////////////
79 INLINE CPT(TransformState) BulletMinkowskiSumShape::
80 get_transform_a() const {
81 
82  return btTrans_to_TransformState(_shape->getTransformA());
83 }
84 
85 ////////////////////////////////////////////////////////////////////
86 // Function: BulletMinkowskiSumShape::get_transform_b
87 // Access: Published
88 // Description:
89 ////////////////////////////////////////////////////////////////////
90 INLINE CPT(TransformState) BulletMinkowskiSumShape::
91 get_transform_b() const {
92 
93  return btTrans_to_TransformState(_shape->GetTransformB());
94 }
95 
96 ////////////////////////////////////////////////////////////////////
97 // Function: BulletMinkowskiSumShape::get_shape_a
98 // Access: Published
99 // Description:
100 ////////////////////////////////////////////////////////////////////
101 INLINE const BulletShape *BulletMinkowskiSumShape::
102 get_shape_a() const {
103 
104  return _shape_a;
105 }
106 
107 ////////////////////////////////////////////////////////////////////
108 // Function: BulletMinkowskiSumShape::get_shape_b
109 // Access: Published
110 // Description:
111 ////////////////////////////////////////////////////////////////////
112 INLINE const BulletShape *BulletMinkowskiSumShape::
113 get_shape_b() const {
114 
115  return _shape_b;
116 }
117 
118 ////////////////////////////////////////////////////////////////////
119 // Function: BulletMinkowskiSumShape::get_margin
120 // Access: Published
121 // Description:
122 ////////////////////////////////////////////////////////////////////
123 INLINE PN_stdfloat BulletMinkowskiSumShape::
124 get_margin() const {
125 
126  return (PN_stdfloat)_shape->getMargin();
127 }
128