Panda3D
physxCapsuleForceFieldShape.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file physxCapsuleForceFieldShape.h
10  * @author enn0x
11  * @date 2009-11-15
12  */
13 
14 #ifndef PHYSXCAPSULEFORCEFIELDSHAPE_H
15 #define PHYSXCAPSULEFORCEFIELDSHAPE_H
16 
17 #include "pandabase.h"
18 #include "luse.h"
19 
20 #include "physxForceFieldShape.h"
21 #include "physx_includes.h"
22 
24 
25 /**
26  * A capsule shaped region used to define a force field.
27  */
28 class EXPCL_PANDAPHYSX PhysxCapsuleForceFieldShape : public PhysxForceFieldShape {
29 
30 PUBLISHED:
33 
34  void save_to_desc(PhysxCapsuleForceFieldShapeDesc &shapeDesc) const;
35 
36  void set_radius(float radius);
37  void set_height(float height);
38 
39  float get_radius() const;
40  float get_height() const;
41 
42 public:
43  INLINE NxForceFieldShape *ptr() const { return (NxForceFieldShape *)_ptr; };
44 
45  void link(NxForceFieldShape *shapePtr);
46  void unlink();
47 
48 private:
49  NxCapsuleForceFieldShape *_ptr;
50 
51 public:
52  static TypeHandle get_class_type() {
53  return _type_handle;
54  }
55  static void init_type() {
56  PhysxForceFieldShape::init_type();
57  register_type(_type_handle, "PhysxCapsuleForceFieldShape",
58  PhysxForceFieldShape::get_class_type());
59  }
60  virtual TypeHandle get_type() const {
61  return get_class_type();
62  }
63  virtual TypeHandle force_init_type() {
64  init_type();
65  return get_class_type();
66  }
67 
68 private:
69  static TypeHandle _type_handle;
70 };
71 
73 
74 #endif // PHYSXCAPSULEFORCEFIELDSHAPE_H
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Abstract base class for force field shapes.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A capsule shaped region used to define a force field.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
Descriptor for a capsule force field shape.