00001 // Filename: bulletSoftBodyShape.cxx 00002 // Created by: enn0x (06May10) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #include "bulletSoftBodyShape.h" 00016 #include "bulletSoftBodyNode.h" 00017 00018 TypeHandle BulletSoftBodyShape::_type_handle; 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: BulletSoftBodyShape::Constructor 00022 // Access: Public 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 BulletSoftBodyShape:: 00026 BulletSoftBodyShape(btSoftBodyCollisionShape *shapePtr) { 00027 00028 _shape = shapePtr; 00029 _shape->setUserPointer(this); 00030 } 00031 00032 //////////////////////////////////////////////////////////////////// 00033 // Function: BulletSoftBodyShape::ptr 00034 // Access: Public 00035 // Description: 00036 //////////////////////////////////////////////////////////////////// 00037 btCollisionShape *BulletSoftBodyShape:: 00038 ptr() const { 00039 00040 return _shape; 00041 } 00042 00043 //////////////////////////////////////////////////////////////////// 00044 // Function: BulletSoftBodyShape::get_body 00045 // Access: Published 00046 // Description: 00047 //////////////////////////////////////////////////////////////////// 00048 BulletSoftBodyNode *BulletSoftBodyShape:: 00049 get_body() const { 00050 00051 if (_shape->m_body) { 00052 return (BulletSoftBodyNode *)_shape->m_body->getUserPointer(); 00053 } 00054 else 00055 { 00056 return NULL; 00057 } 00058 } 00059