00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "bulletConeShape.h"
00016
00017 TypeHandle BulletConeShape::_type_handle;
00018
00019
00020
00021
00022
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
00047
00048
00049
00050 btCollisionShape *BulletConeShape::
00051 ptr() const {
00052
00053 return _shape;
00054 }
00055