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