Panda3D

bulletCapsuleShape.cxx

00001 // Filename: bulletCapsuleShape.cxx
00002 // Created by:  enn0x (27Jan10)
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 "bulletCapsuleShape.h"
00016 
00017 TypeHandle BulletCapsuleShape::_type_handle;
00018 
00019 ////////////////////////////////////////////////////////////////////
00020 //     Function: BulletCapsuleShape::Constructor
00021 //       Access: Published
00022 //  Description:
00023 ////////////////////////////////////////////////////////////////////
00024 BulletCapsuleShape::
00025 BulletCapsuleShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up) {
00026 
00027   switch (up) {
00028   case X_up:
00029     _shape = new btCapsuleShapeX(radius, height);
00030     break;
00031   case Y_up:
00032     _shape = new btCapsuleShape(radius, height);
00033     break;
00034   case Z_up:
00035     _shape = new btCapsuleShapeZ(radius, 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: BulletCapsuleShape::ptr
00047 //       Access: Public
00048 //  Description:
00049 ////////////////////////////////////////////////////////////////////
00050 btCollisionShape *BulletCapsuleShape::
00051 ptr() const {
00052 
00053   return _shape;
00054 }
00055 
 All Classes Functions Variables Enumerations