Panda3D
 All Classes Functions Variables Enumerations
physxSphereForceFieldShape.h
1 // Filename: physxSphereForceFieldShape.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 PHYSXSPHEREFORCEFIELDSHAPE_H
16 #define PHYSXSPHEREFORCEFIELDSHAPE_H
17 
18 #include "pandabase.h"
19 #include "luse.h"
20 
21 #include "physxForceFieldShape.h"
22 #include "physx_includes.h"
23 
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : PhysxSphereForceFieldShape
28 // Description : A spherical force field shape.
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_PANDAPHYSX PhysxSphereForceFieldShape : public PhysxForceFieldShape {
31 
32 PUBLISHED:
34  INLINE ~PhysxSphereForceFieldShape();
35 
36  void save_to_desc(PhysxSphereForceFieldShapeDesc &shapeDesc) const;
37 
38  void set_radius(float radius);
39 
40  float get_radius() const;
41 
42 ////////////////////////////////////////////////////////////////////
43 public:
44  INLINE NxForceFieldShape *ptr() const { return (NxForceFieldShape *)_ptr; };
45 
46  void link(NxForceFieldShape *shapePtr);
47  void unlink();
48 
49 private:
50  NxSphereForceFieldShape *_ptr;
51 
52 ////////////////////////////////////////////////////////////////////
53 public:
54  static TypeHandle get_class_type() {
55  return _type_handle;
56  }
57  static void init_type() {
58  PhysxForceFieldShape::init_type();
59  register_type(_type_handle, "PhysxSphereForceFieldShape",
60  PhysxForceFieldShape::get_class_type());
61  }
62  virtual TypeHandle get_type() const {
63  return get_class_type();
64  }
65  virtual TypeHandle force_init_type() {
66  init_type();
67  return get_class_type();
68  }
69 
70 private:
71  static TypeHandle _type_handle;
72 };
73 
74 #include "physxSphereForceFieldShape.I"
75 
76 #endif // PHYSXSPHEREFORCEFIELDSHAPE_H
Abstract base class for force field shapes.
A descriptor for a sphere force field shape.
A spherical force field shape.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85