Panda3D
physxBoxForceFieldShape.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 physxBoxForceFieldShape.h
10  * @author enn0x
11  * @date 2009-11-15
12  */
13 
14 #ifndef PHYSXBOXFORCEFIELDSHAPE_H
15 #define PHYSXBOXFORCEFIELDSHAPE_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 box shaped region used to define a force field.
27  */
28 class EXPCL_PANDAPHYSX PhysxBoxForceFieldShape : public PhysxForceFieldShape {
29 PUBLISHED:
30  INLINE PhysxBoxForceFieldShape();
31  INLINE ~PhysxBoxForceFieldShape();
32 
33  void save_to_desc(PhysxBoxForceFieldShapeDesc &shapeDesc) const;
34 
35  void set_dimensions(const LVector3f &dimensions);
36  LVector3f get_dimensions() const;
37 
38 public:
39  INLINE NxForceFieldShape *ptr() const { return (NxForceFieldShape *)_ptr; };
40 
41  void link(NxForceFieldShape *shapePtr);
42  void unlink();
43 
44 private:
45  NxBoxForceFieldShape *_ptr;
46 
47 public:
48  static TypeHandle get_class_type() {
49  return _type_handle;
50  }
51  static void init_type() {
52  PhysxForceFieldShape::init_type();
53  register_type(_type_handle, "PhysxBoxForceFieldShape",
54  PhysxForceFieldShape::get_class_type());
55  }
56  virtual TypeHandle get_type() const {
57  return get_class_type();
58  }
59  virtual TypeHandle force_init_type() {
60  init_type();
61  return get_class_type();
62  }
63 
64 private:
65  static TypeHandle _type_handle;
66 };
67 
69 
70 #endif // PHYSXBOXFORCEFIELDSHAPE_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 box 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 box force field shape.