Panda3D
|
00001 // Filename: physxForceField.h 00002 // Created by: enn0x (06Nov09) 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 PHYSXFORCEFIELD_H 00016 #define PHYSXFORCEFIELD_H 00017 00018 #include "pandabase.h" 00019 #include "luse.h" 00020 00021 #include "physxObject.h" 00022 #include "physx_includes.h" 00023 00024 class PhysxScene; 00025 class PhysxForceFieldDesc; 00026 class PhysxForceFieldShapeGroup; 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Class : PhysxForceField 00030 // Description : A force field effector. Instances of this object 00031 // automate the application of forces onto rigid 00032 // bodies, fluid, soft bodies and cloth. 00033 // Force fields allow you to implement for example 00034 // gusts of wind, dust devils, vacuum cleaners or 00035 // anti-gravity zones. 00036 //////////////////////////////////////////////////////////////////// 00037 class EXPCL_PANDAPHYSX PhysxForceField : public PhysxObject { 00038 00039 PUBLISHED: 00040 INLINE PhysxForceField(); 00041 INLINE ~PhysxForceField(); 00042 00043 //void load_from_desc(const PhysxForceFieldDesc &materialDesc); 00044 //void save_to_desc(PhysxForceFieldDesc &materialDesc) const; 00045 00046 void set_name(const char *name); 00047 00048 const char *get_name() const; 00049 PhysxScene *get_scene() const; 00050 PhysxForceFieldShapeGroup *get_include_shape_group() const; 00051 00052 unsigned int get_num_shape_groups() const; 00053 PhysxForceFieldShapeGroup *get_shape_group(unsigned int idx) const; 00054 MAKE_SEQ(get_shape_groups, get_num_shape_groups, get_shape_group); 00055 00056 //////////////////////////////////////////////////////////////////// 00057 PUBLISHED: 00058 void release(); 00059 00060 INLINE void ls() const; 00061 INLINE void ls(ostream &out, int indent_level=0) const; 00062 00063 public: 00064 INLINE NxForceField *ptr() const { return _ptr; }; 00065 00066 void link(NxForceField *ptr); 00067 void unlink(); 00068 00069 private: 00070 NxForceField *_ptr; 00071 string _name; 00072 00073 //////////////////////////////////////////////////////////////////// 00074 public: 00075 static TypeHandle get_class_type() { 00076 return _type_handle; 00077 } 00078 static void init_type() { 00079 PhysxObject::init_type(); 00080 register_type(_type_handle, "PhysxForceField", 00081 PhysxObject::get_class_type()); 00082 } 00083 virtual TypeHandle get_type() const { 00084 return get_class_type(); 00085 } 00086 virtual TypeHandle force_init_type() { 00087 init_type(); 00088 return get_class_type(); 00089 } 00090 00091 private: 00092 static TypeHandle _type_handle; 00093 }; 00094 00095 #include "physxForceField.I" 00096 00097 #endif // PHYSXFORCEFIELD_H