Panda3D
 All Classes Functions Variables Enumerations
physxForceField.h
1 // Filename: physxForceField.h
2 // Created by: enn0x (06Nov09)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef PHYSXFORCEFIELD_H
16 #define PHYSXFORCEFIELD_H
17 
18 #include "pandabase.h"
19 #include "luse.h"
20 
21 #include "physxObject.h"
22 #include "physx_includes.h"
23 
24 class PhysxScene;
27 
28 ////////////////////////////////////////////////////////////////////
29 // Class : PhysxForceField
30 // Description : A force field effector. Instances of this object
31 // automate the application of forces onto rigid
32 // bodies, fluid, soft bodies and cloth.
33 // Force fields allow you to implement for example
34 // gusts of wind, dust devils, vacuum cleaners or
35 // anti-gravity zones.
36 ////////////////////////////////////////////////////////////////////
37 class EXPCL_PANDAPHYSX PhysxForceField : public PhysxObject {
38 
39 PUBLISHED:
40  INLINE PhysxForceField();
41  INLINE ~PhysxForceField();
42 
43  //void load_from_desc(const PhysxForceFieldDesc &materialDesc);
44  //void save_to_desc(PhysxForceFieldDesc &materialDesc) const;
45 
46  void set_name(const char *name);
47 
48  const char *get_name() const;
49  PhysxScene *get_scene() const;
50  PhysxForceFieldShapeGroup *get_include_shape_group() const;
51 
52  unsigned int get_num_shape_groups() const;
53  PhysxForceFieldShapeGroup *get_shape_group(unsigned int idx) const;
54  MAKE_SEQ(get_shape_groups, get_num_shape_groups, get_shape_group);
55 
56 ////////////////////////////////////////////////////////////////////
57 PUBLISHED:
58  void release();
59 
60  INLINE void ls() const;
61  INLINE void ls(ostream &out, int indent_level=0) const;
62 
63 public:
64  INLINE NxForceField *ptr() const { return _ptr; };
65 
66  void link(NxForceField *ptr);
67  void unlink();
68 
69 private:
70  NxForceField *_ptr;
71  string _name;
72 
73 ////////////////////////////////////////////////////////////////////
74 public:
75  static TypeHandle get_class_type() {
76  return _type_handle;
77  }
78  static void init_type() {
79  PhysxObject::init_type();
80  register_type(_type_handle, "PhysxForceField",
81  PhysxObject::get_class_type());
82  }
83  virtual TypeHandle get_type() const {
84  return get_class_type();
85  }
86  virtual TypeHandle force_init_type() {
87  init_type();
88  return get_class_type();
89  }
90 
91 private:
92  static TypeHandle _type_handle;
93 };
94 
95 #include "physxForceField.I"
96 
97 #endif // PHYSXFORCEFIELD_H
A scene is a collection of bodies, constraints, and effectors which can interact. ...
Definition: physxScene.h:73
Descriptor class for force fields.
A force field effector.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85