Panda3D
bulletMinkowskiSumShape.cxx
1 // Filename: bulletMinkowskiSumShape.cxx
2 // Created by: enn0x (15Aug13)
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 #include "bulletMinkowskiSumShape.h"
16 
17 TypeHandle BulletMinkowskiSumShape::_type_handle;
18 
19 ////////////////////////////////////////////////////////////////////
20 // Function: BulletMinkowskiSumShape::Constructor
21 // Access: Published
22 // Description:
23 ////////////////////////////////////////////////////////////////////
24 BulletMinkowskiSumShape::
25 BulletMinkowskiSumShape(const BulletShape *shape_a, const BulletShape *shape_b) {
26 
27  nassertv(shape_a->is_convex());
28  nassertv(shape_b->is_convex());
29 
30  const btConvexShape *ptr_a = (const btConvexShape *)shape_a->ptr();
31  const btConvexShape *ptr_b = (const btConvexShape *)shape_b->ptr();
32 
33  _shape = new btMinkowskiSumShape(ptr_a, ptr_b);
34  _shape->setUserPointer(this);
35 
36  _shape_a = shape_a;
37  _shape_b = shape_b;
38 }
39 
40 ////////////////////////////////////////////////////////////////////
41 // Function: BulletMinkowskiSumShape::ptr
42 // Access: Public
43 // Description:
44 ////////////////////////////////////////////////////////////////////
45 btCollisionShape *BulletMinkowskiSumShape::
46 ptr() const {
47 
48  return _shape;
49 }
50 
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85