Panda3D
|
00001 // Filename: bulletShape.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_SHAPE_H__ 00016 #define __BULLET_SHAPE_H__ 00017 00018 #include "pandabase.h" 00019 00020 #include "bullet_includes.h" 00021 00022 #include "typedReferenceCount.h" 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : BulletShape 00026 // Description : 00027 //////////////////////////////////////////////////////////////////// 00028 class EXPCL_PANDABULLET BulletShape : public TypedReferenceCount { 00029 00030 PUBLISHED: 00031 INLINE virtual ~BulletShape(); 00032 00033 INLINE bool is_polyhedral() const; 00034 INLINE bool is_convex() const; 00035 INLINE bool is_convex_2d() const; 00036 INLINE bool is_concave() const; 00037 INLINE bool is_infinite() const; 00038 INLINE bool is_non_moving() const; 00039 INLINE bool is_soft_body() const; 00040 00041 void set_margin(PN_stdfloat margin); 00042 const char *get_name() const; 00043 00044 PN_stdfloat get_margin() const; 00045 00046 public: 00047 virtual btCollisionShape *ptr() const = 0; 00048 00049 LVecBase3 get_local_scale() const; 00050 void set_local_scale(const LVecBase3 &scale); 00051 00052 //////////////////////////////////////////////////////////////////// 00053 public: 00054 static TypeHandle get_class_type() { 00055 return _type_handle; 00056 } 00057 static void init_type() { 00058 TypedReferenceCount::init_type(); 00059 register_type(_type_handle, "BulletShape", 00060 TypedReferenceCount::get_class_type()); 00061 } 00062 virtual TypeHandle get_type() const { 00063 return get_class_type(); 00064 } 00065 virtual TypeHandle force_init_type() { 00066 init_type(); 00067 return get_class_type(); 00068 } 00069 00070 private: 00071 static TypeHandle _type_handle; 00072 }; 00073 00074 #include "bulletShape.I" 00075 00076 #endif // __BULLET_SHAPE_H__