Panda3D
bulletSoftBodyShape.cxx
1 // Filename: bulletSoftBodyShape.cxx
2 // Created by: enn0x (06May10)
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 "bulletSoftBodyShape.h"
16 #include "bulletSoftBodyNode.h"
17 
18 TypeHandle BulletSoftBodyShape::_type_handle;
19 
20 ////////////////////////////////////////////////////////////////////
21 // Function: BulletSoftBodyShape::Constructor
22 // Access: Public
23 // Description:
24 ////////////////////////////////////////////////////////////////////
25 BulletSoftBodyShape::
26 BulletSoftBodyShape(btSoftBodyCollisionShape *shapePtr) {
27 
28  _shape = shapePtr;
29  _shape->setUserPointer(this);
30 }
31 
32 ////////////////////////////////////////////////////////////////////
33 // Function: BulletSoftBodyShape::ptr
34 // Access: Public
35 // Description:
36 ////////////////////////////////////////////////////////////////////
37 btCollisionShape *BulletSoftBodyShape::
38 ptr() const {
39 
40  return _shape;
41 }
42 
43 ////////////////////////////////////////////////////////////////////
44 // Function: BulletSoftBodyShape::get_body
45 // Access: Published
46 // Description:
47 ////////////////////////////////////////////////////////////////////
48 BulletSoftBodyNode *BulletSoftBodyShape::
49 get_body() const {
50 
51  if (_shape->m_body) {
52  return (BulletSoftBodyNode *)_shape->m_body->getUserPointer();
53  }
54  else
55  {
56  return NULL;
57  }
58 }
59 
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85