Panda3D
|
00001 // Filename: bulletSphereShape.cxx 00002 // Created by: enn0x (23Jan10) 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 "bulletSphereShape.h" 00016 00017 TypeHandle BulletSphereShape::_type_handle; 00018 00019 //////////////////////////////////////////////////////////////////// 00020 // Function: BulletSphereShape::Constructor 00021 // Access: Published 00022 // Description: 00023 //////////////////////////////////////////////////////////////////// 00024 BulletSphereShape:: 00025 BulletSphereShape(PN_stdfloat radius) { 00026 00027 _shape = new btSphereShape(radius); 00028 _shape->setUserPointer(this); 00029 } 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Function: BulletSphereShape::ptr 00033 // Access: Public 00034 // Description: 00035 //////////////////////////////////////////////////////////////////// 00036 btCollisionShape *BulletSphereShape:: 00037 ptr() const { 00038 00039 return _shape; 00040 } 00041 00042 //////////////////////////////////////////////////////////////////// 00043 // Function: BulletSphereShape::make_from_solid 00044 // Access: Public 00045 // Description: 00046 //////////////////////////////////////////////////////////////////// 00047 BulletSphereShape *BulletSphereShape:: 00048 make_from_solid(const CollisionSphere *solid) { 00049 00050 return new BulletSphereShape(solid->get_radius()); 00051 } 00052