Panda3D
physxForceFieldShape.h
1 // Filename: physxForceFieldShape.h
2 // Created by: enn0x (15Nov09)
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 PHYSXFORCEFIELDSHAPE_H
16 #define PHYSXFORCEFIELDSHAPE_H
17 
18 #include "pandabase.h"
19 #include "pointerTo.h"
20 #include "luse.h"
21 
22 #include "physxObject.h"
23 #include "physxEnums.h"
24 #include "physx_includes.h"
25 
26 class PhysxForceField;
28 
29 ////////////////////////////////////////////////////////////////////
30 // Class : PhysxForceFieldShape
31 // Description : Abstract base class for force field shapes.
32 ////////////////////////////////////////////////////////////////////
33 class EXPCL_PANDAPHYSX PhysxForceFieldShape : public PhysxObject, public PhysxEnums {
34 
35 PUBLISHED:
36  void release();
37 
38  PhysxForceField *get_force_field() const;
39  PhysxForceFieldShapeGroup *get_shape_group() const;
40 
41  void set_name(const char *name);
42  void set_mat(const LMatrix4f &mat);
43  void set_pos(const LPoint3f &pos);
44 
45  const char *get_name() const;
46  LMatrix4f get_mat() const;
47  LPoint3f get_pos() const;
48 
49  INLINE void ls() const;
50  INLINE void ls(ostream &out, int indent_level=0) const;
51 
52 public:
53  static PhysxForceFieldShape *factory(NxShapeType shapeType);
54 
55  virtual NxForceFieldShape *ptr() const = 0;
56 
57  virtual void link(NxForceFieldShape *shapePtr) = 0;
58  virtual void unlink() = 0;
59 
60 protected:
61  INLINE PhysxForceFieldShape();
62 
63 private:
64  string _name;
65 
66 ////////////////////////////////////////////////////////////////////
67 public:
68  static TypeHandle get_class_type() {
69  return _type_handle;
70  }
71  static void init_type() {
72  PhysxObject::init_type();
73  register_type(_type_handle, "PhysxForceFieldShape",
74  PhysxObject::get_class_type());
75  }
76  virtual TypeHandle get_type() const {
77  return get_class_type();
78  }
79  virtual TypeHandle force_init_type() {
80  init_type();
81  return get_class_type();
82  }
83 
84 private:
85  static TypeHandle _type_handle;
86 };
87 
88 #include "physxForceFieldShape.I"
89 
90 #endif // PHYSXFORCEFIELDSHAPE_H
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
Abstract base class for force field shapes.
This class exists just to provide scoping for the enums shared by PhysX classes.
Definition: physxEnums.h:357
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:451
A force field effector.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85