Panda3D
 All Classes Functions Variables Enumerations
bulletConeShape.cxx
1 // Filename: bulletConeShape.cxx
2 // Created by: enn0x (24Jan10)
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 "bulletConeShape.h"
16 
17 TypeHandle BulletConeShape::_type_handle;
18 
19 ////////////////////////////////////////////////////////////////////
20 // Function: BulletConeShape::Constructor
21 // Access: Published
22 // Description:
23 ////////////////////////////////////////////////////////////////////
24 BulletConeShape::
25 BulletConeShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up) {
26 
27  switch (up) {
28  case X_up:
29  _shape = new btConeShapeX((btScalar)radius, (btScalar)height);
30  break;
31  case Y_up:
32  _shape = new btConeShape((btScalar)radius, (btScalar)height);
33  break;
34  case Z_up:
35  _shape = new btConeShapeZ((btScalar)radius, (btScalar)height);
36  break;
37  default:
38  bullet_cat.error() << "invalid up-axis:" << up << endl;
39  break;
40  }
41 
42  _shape->setUserPointer(this);
43 }
44 
45 ////////////////////////////////////////////////////////////////////
46 // Function: BulletConeShape::ptr
47 // Access: Public
48 // Description:
49 ////////////////////////////////////////////////////////////////////
50 btCollisionShape *BulletConeShape::
51 ptr() const {
52 
53  return _shape;
54 }
55 
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85