Panda3D
|
00001 // Filename: bulletSphereShape.h 00002 // Created by: enn0x (23Jan10) 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 #ifndef __BULLET_SPHERE_SHAPE_H__ 00016 #define __BULLET_SPHERE_SHAPE_H__ 00017 00018 #include "pandabase.h" 00019 00020 #include "bullet_includes.h" 00021 #include "bullet_utils.h" 00022 #include "bulletShape.h" 00023 00024 #include "collisionSphere.h" 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : BulletSphereShape 00028 // Description : 00029 //////////////////////////////////////////////////////////////////// 00030 class EXPCL_PANDABULLET BulletSphereShape : public BulletShape { 00031 00032 PUBLISHED: 00033 BulletSphereShape(PN_stdfloat radius); 00034 INLINE BulletSphereShape(const BulletSphereShape ©); 00035 INLINE void operator = (const BulletSphereShape ©); 00036 INLINE ~BulletSphereShape(); 00037 00038 INLINE PN_stdfloat get_radius() const; 00039 00040 static BulletSphereShape *make_from_solid(const CollisionSphere *solid); 00041 00042 public: 00043 virtual btCollisionShape *ptr() const; 00044 00045 private: 00046 btSphereShape *_shape; 00047 00048 //////////////////////////////////////////////////////////////////// 00049 public: 00050 static TypeHandle get_class_type() { 00051 return _type_handle; 00052 } 00053 static void init_type() { 00054 BulletShape::init_type(); 00055 register_type(_type_handle, "BulletSphereShape", 00056 BulletShape::get_class_type()); 00057 } 00058 virtual TypeHandle get_type() const { 00059 return get_class_type(); 00060 } 00061 virtual TypeHandle force_init_type() { 00062 init_type(); 00063 return get_class_type(); 00064 } 00065 00066 private: 00067 static TypeHandle _type_handle; 00068 }; 00069 00070 #include "bulletSphereShape.I" 00071 00072 #endif // __BULLET_SPHERE_SHAPE_H__