Panda3D

bulletMultiSphereShape.I

00001 // Filename: bulletMultiSphereShape.I
00002 // Created by:  enn0x (04Jan12)
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 ////////////////////////////////////////////////////////////////////
00016 //     Function: BulletMultiSphereShape::Destructor
00017 //       Access: Published
00018 //  Description:
00019 ////////////////////////////////////////////////////////////////////
00020 INLINE BulletMultiSphereShape::
00021 ~BulletMultiSphereShape() {
00022 
00023   delete _shape;
00024 }
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //     Function: BulletMultiSphereShape::Copy Constructor
00028 //       Access: Published
00029 //  Description:
00030 ////////////////////////////////////////////////////////////////////
00031 INLINE BulletMultiSphereShape::
00032 BulletMultiSphereShape(const BulletMultiSphereShape &copy) :
00033   _shape(copy._shape) {
00034 }
00035 
00036 ////////////////////////////////////////////////////////////////////
00037 //     Function: BulletMultiSphereShape::Copy Assignment Operator
00038 //       Access: Published
00039 //  Description:
00040 ////////////////////////////////////////////////////////////////////
00041 INLINE void BulletMultiSphereShape::
00042 operator = (const BulletMultiSphereShape &copy) {
00043   _shape = copy._shape;
00044 }
00045 
00046 ////////////////////////////////////////////////////////////////////
00047 //     Function: BulletMultiSphereShape::get_sphere_count
00048 //       Access: Published
00049 //  Description:
00050 ////////////////////////////////////////////////////////////////////
00051 INLINE int BulletMultiSphereShape::
00052 get_sphere_count() const {
00053 
00054   return _shape->getSphereCount();
00055 }
00056 
00057 ////////////////////////////////////////////////////////////////////
00058 //     Function: BulletMultiSphereShape::get_sphere_pos
00059 //       Access: Published
00060 //  Description:
00061 ////////////////////////////////////////////////////////////////////
00062 INLINE LPoint3 BulletMultiSphereShape::
00063 get_sphere_pos(int index) const {
00064 
00065   nassertr(index >=0 && index <_shape->getSphereCount(), LPoint3::zero());
00066   return btVector3_to_LPoint3(_shape->getSpherePosition(index));
00067 }
00068 
00069 ////////////////////////////////////////////////////////////////////
00070 //     Function: BulletMultiSphereShape::get_sphere_radius
00071 //       Access: Published
00072 //  Description:
00073 ////////////////////////////////////////////////////////////////////
00074 INLINE PN_stdfloat BulletMultiSphereShape::
00075 get_sphere_radius(int index) const {
00076 
00077   nassertr(index >=0 && index <_shape->getSphereCount(), 0.0);
00078   return (PN_stdfloat)_shape->getSphereRadius(index);
00079 }
00080 
 All Classes Functions Variables Enumerations