Panda3D
angularForce.h
1 // Filename: angularForce.h
2 // Created by: charles (08Aug00)
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 ANGULARFORCE_H
16 #define ANGULARFORCE_H
17 
18 #include "baseForce.h"
19 
20 ////////////////////////////////////////////////////////////////////
21 // Class : AngularForce
22 // Description : pure virtual parent of all quat-based forces.
23 ////////////////////////////////////////////////////////////////////
24 class EXPCL_PANDAPHYSICS AngularForce : public BaseForce {
25 PUBLISHED:
26  virtual ~AngularForce();
27 
28  virtual AngularForce *make_copy() const = 0;
29  LRotation get_quat(const PhysicsObject *po);
30  virtual bool is_linear() const;
31 
32  virtual void output(ostream &out) const;
33  virtual void write(ostream &out, unsigned int indent=0) const;
34 
35 protected:
36  AngularForce();
37  AngularForce(const AngularForce &copy);
38 
39 private:
40  virtual LRotation get_child_quat(const PhysicsObject *po) = 0;
41 
42 public:
43  static TypeHandle get_class_type() {
44  return _type_handle;
45  }
46  static void init_type() {
47  BaseForce::init_type();
48  register_type(_type_handle, "AngularForce",
49  BaseForce::get_class_type());
50  }
51  virtual TypeHandle get_type() const {
52  return get_class_type();
53  }
54  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
55 
56 private:
57  static TypeHandle _type_handle;
58 };
59 
60 #endif // ANGULARFORCE_H
This is a unit quaternion representing a rotation.
Definition: lrotation.h:92
virtual void write(ostream &out, int indent_level=0) const
Write a string representation of this instance to <out>.
Definition: baseForce.cxx:72
A body on which physics will be applied.
Definition: physicsObject.h:29
pure virtual base class for all forces that could POSSIBLY exist.
Definition: baseForce.h:32
virtual void output(ostream &out) const
Write a string representation of this instance to <out>.
Definition: baseForce.cxx:61
pure virtual parent of all quat-based forces.
Definition: angularForce.h:24
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85