Panda3D
physxBoxForceFieldShape.h
1 // Filename: physxBoxForceFieldShape.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 PHYSXBOXFORCEFIELDSHAPE_H
16 #define PHYSXBOXFORCEFIELDSHAPE_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 : PhysxBoxForceFieldShape
28 // Description : A box shaped region used to define a force field.
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_PANDAPHYSX PhysxBoxForceFieldShape : public PhysxForceFieldShape {
31 
32 PUBLISHED:
33  INLINE PhysxBoxForceFieldShape();
34  INLINE ~PhysxBoxForceFieldShape();
35 
36  void save_to_desc(PhysxBoxForceFieldShapeDesc &shapeDesc) const;
37 
38  void set_dimensions(const LVector3f &dimensions);
39  LVector3f get_dimensions() const;
40 
41 ////////////////////////////////////////////////////////////////////
42 public:
43  INLINE NxForceFieldShape *ptr() const { return (NxForceFieldShape *)_ptr; };
44 
45  void link(NxForceFieldShape *shapePtr);
46  void unlink();
47 
48 private:
49  NxBoxForceFieldShape *_ptr;
50 
51 ////////////////////////////////////////////////////////////////////
52 public:
53  static TypeHandle get_class_type() {
54  return _type_handle;
55  }
56  static void init_type() {
57  PhysxForceFieldShape::init_type();
58  register_type(_type_handle, "PhysxBoxForceFieldShape",
59  PhysxForceFieldShape::get_class_type());
60  }
61  virtual TypeHandle get_type() const {
62  return get_class_type();
63  }
64  virtual TypeHandle force_init_type() {
65  init_type();
66  return get_class_type();
67  }
68 
69 private:
70  static TypeHandle _type_handle;
71 };
72 
73 #include "physxBoxForceFieldShape.I"
74 
75 #endif // PHYSXBOXFORCEFIELDSHAPE_H
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
Abstract base class for force field shapes.
A box shaped region used to define a force field.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
Descriptor for a box force field shape.