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