Panda3D
|
00001 // Filename: bulletConeShape.cxx 00002 // Created by: enn0x (24Jan10) 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 "bulletConeShape.h" 00016 00017 TypeHandle BulletConeShape::_type_handle; 00018 00019 //////////////////////////////////////////////////////////////////// 00020 // Function: BulletConeShape::Constructor 00021 // Access: Published 00022 // Description: 00023 //////////////////////////////////////////////////////////////////// 00024 BulletConeShape:: 00025 BulletConeShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up) { 00026 00027 switch (up) { 00028 case X_up: 00029 _shape = new btConeShapeX((btScalar)radius, (btScalar)height); 00030 break; 00031 case Y_up: 00032 _shape = new btConeShape((btScalar)radius, (btScalar)height); 00033 break; 00034 case Z_up: 00035 _shape = new btConeShapeZ((btScalar)radius, (btScalar)height); 00036 break; 00037 default: 00038 bullet_cat.error() << "invalid up-axis:" << up << endl; 00039 break; 00040 } 00041 00042 _shape->setUserPointer(this); 00043 } 00044 00045 //////////////////////////////////////////////////////////////////// 00046 // Function: BulletConeShape::ptr 00047 // Access: Public 00048 // Description: 00049 //////////////////////////////////////////////////////////////////// 00050 btCollisionShape *BulletConeShape:: 00051 ptr() const { 00052 00053 return _shape; 00054 } 00055