Panda3D
 All Classes Functions Variables Enumerations
angularVectorForce.h
1 // Filename: angularVectorForce.h
2 // Created by: charles (09Aug00)
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 ANGULARVECTORFORCE_H
16 #define ANGULARVECTORFORCE_H
17 
18 #include "angularForce.h"
19 
20 ////////////////////////////////////////////////////////////////////
21 // Class : AngularVectorForce
22 // Description : a simple directed torque force, the angular
23 // equivalent of simple vector force.
24 ////////////////////////////////////////////////////////////////////
25 class EXPCL_PANDAPHYSICS AngularVectorForce : public AngularForce {
26 PUBLISHED:
27  AngularVectorForce(const LRotation& quat);
28  AngularVectorForce(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
30  virtual ~AngularVectorForce();
31 
32  INLINE void set_quat(const LRotation& quat);
33  INLINE void set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
34  INLINE LRotation get_local_quat() const;
35 
36  virtual void output(ostream &out) const;
37  virtual void write(ostream &out, unsigned int indent=0) const;
38 
39 private:
40  LRotation _fvec;
41 
42  virtual AngularForce *make_copy() const;
43  virtual LRotation get_child_quat(const PhysicsObject *po);
44 
45 public:
46  static TypeHandle get_class_type() {
47  return _type_handle;
48  }
49  static void init_type() {
50  AngularForce::init_type();
51  register_type(_type_handle, "AngularVectorForce",
52  AngularForce::get_class_type());
53  }
54  virtual TypeHandle get_type() const {
55  return get_class_type();
56  }
57  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
58 
59 private:
60  static TypeHandle _type_handle;
61 };
62 
63 #include "angularVectorForce.I"
64 
65 #endif // ANGULARVECTORFORCE_H
virtual void write(ostream &out, unsigned int indent=0) const
Write a string representation of this instance to <out>.
This is a unit quaternion representing a rotation.
Definition: lrotation.h:92
A body on which physics will be applied.
Definition: physicsObject.h:29
a simple directed torque force, the angular equivalent of simple vector force.
virtual void output(ostream &out) const
Write a string representation of this instance to <out>.
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