Panda3D
|
00001 // Filename: bulletPlaneShape.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_PLANE_SHAPE_H__ 00016 #define __BULLET_PLANE_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 "collisionPlane.h" 00025 #include "luse.h" 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Class : BulletPlaneShape 00029 // Description : 00030 //////////////////////////////////////////////////////////////////// 00031 class EXPCL_PANDABULLET BulletPlaneShape : public BulletShape { 00032 00033 PUBLISHED: 00034 BulletPlaneShape(const LVector3 &normal, PN_stdfloat constant); 00035 INLINE BulletPlaneShape(const BulletPlaneShape ©); 00036 INLINE void operator = (const BulletPlaneShape ©); 00037 INLINE ~BulletPlaneShape(); 00038 00039 INLINE LVector3 get_plane_normal() const; 00040 INLINE PN_stdfloat get_plane_constant() const; 00041 00042 static BulletPlaneShape *make_from_solid(const CollisionPlane *solid); 00043 00044 public: 00045 virtual btCollisionShape *ptr() const; 00046 00047 private: 00048 btStaticPlaneShape *_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, "BulletPlaneShape", 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 "bulletPlaneShape.I" 00073 00074 #endif // __BULLET_PLANE_SHAPE_H__