Panda3D
collisionHandlerPusher.h
1 // Filename: collisionHandlerPusher.h
2 // Created by: drose (16Mar02)
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 COLLISIONHANDLERPUSHER_H
16 #define COLLISIONHANDLERPUSHER_H
17 
18 #include "pandabase.h"
19 
20 #include "collisionHandlerPhysical.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : CollisionHandlerPusher
24 // Description : A specialized kind of CollisionHandler that simply
25 // pushes back on things that attempt to move into solid
26 // walls. This is the simplest kind of "real-world"
27 // collisions you can have.
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDA_COLLIDE CollisionHandlerPusher : public CollisionHandlerPhysical {
30 PUBLISHED:
32  virtual ~CollisionHandlerPusher();
33 
34  INLINE void set_horizontal(bool flag);
35  INLINE bool get_horizontal() const;
36 
37 protected:
38  virtual bool handle_entries();
39  virtual void apply_net_shove(
40  ColliderDef &def, const LVector3 &net_shove,
41  const LVector3 &force_normal);
42  virtual void apply_linear_force(ColliderDef &def, const LVector3 &force);
43 
44  bool _horizontal;
45 
46 
47 public:
48  static TypeHandle get_class_type() {
49  return _type_handle;
50  }
51  static void init_type() {
52  CollisionHandlerPhysical::init_type();
53  register_type(_type_handle, "CollisionHandlerPusher",
54  CollisionHandlerPhysical::get_class_type());
55  }
56  virtual TypeHandle get_type() const {
57  return get_class_type();
58  }
59  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
60 
61 private:
62  static TypeHandle _type_handle;
63 };
64 
65 #include "collisionHandlerPusher.I"
66 
67 #endif
68 
69 
70 
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
The abstract base class for a number of CollisionHandlers that have some physical effect on their mov...
A specialized kind of CollisionHandler that simply pushes back on things that attempt to move into so...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85