Panda3D
|
00001 // Filename: physxBoxShape.h 00002 // Created by: enn0x (16Sep09) 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 PHYSXBOXSHAPE_H 00016 #define PHYSXBOXSHAPE_H 00017 00018 #include "pandabase.h" 00019 #include "luse.h" 00020 00021 #include "physxShape.h" 00022 #include "physx_includes.h" 00023 00024 class PhysxBoxShapeDesc; 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : PhysxBoxShape 00028 // Description : A box shaped collision detection primitive. Each 00029 // shape is owned by the actor which it is attached 00030 // to. 00031 // 00032 // An instance can be created by calling the 00033 // createShape() method of the PhysxActor object that 00034 // will own it, with a PhysxBoxShapeDesc object as the 00035 // parameter, or by adding the shape descriptor to the 00036 // PhysxActorDesc class before creating the actor. 00037 // 00038 // The shape is deleted by calling release() on the 00039 // shape itself. 00040 //////////////////////////////////////////////////////////////////// 00041 class EXPCL_PANDAPHYSX PhysxBoxShape : public PhysxShape { 00042 00043 PUBLISHED: 00044 INLINE PhysxBoxShape(); 00045 INLINE ~PhysxBoxShape(); 00046 00047 void save_to_desc(PhysxBoxShapeDesc &shapeDesc) const; 00048 00049 void set_dimensions(const LVector3f &dimensions); 00050 LVector3f get_dimensions() const; 00051 00052 //////////////////////////////////////////////////////////////////// 00053 public: 00054 INLINE NxShape *ptr() const { return (NxShape *)_ptr; }; 00055 00056 void link(NxShape *shapePtr); 00057 void unlink(); 00058 00059 private: 00060 NxBoxShape *_ptr; 00061 00062 //////////////////////////////////////////////////////////////////// 00063 public: 00064 static TypeHandle get_class_type() { 00065 return _type_handle; 00066 } 00067 static void init_type() { 00068 PhysxShape::init_type(); 00069 register_type(_type_handle, "PhysxBoxShape", 00070 PhysxShape::get_class_type()); 00071 } 00072 virtual TypeHandle get_type() const { 00073 return get_class_type(); 00074 } 00075 virtual TypeHandle force_init_type() { 00076 init_type(); 00077 return get_class_type(); 00078 } 00079 00080 private: 00081 static TypeHandle _type_handle; 00082 }; 00083 00084 #include "physxBoxShape.I" 00085 00086 #endif // PHYSXBOXSHAPE_H