Panda3D
angularVectorForce.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 angularVectorForce.h
10  * @author charles
11  * @date 2000-08-09
12  */
13 
14 #ifndef ANGULARVECTORFORCE_H
15 #define ANGULARVECTORFORCE_H
16 
17 #include "angularForce.h"
18 
19 /**
20  * a simple directed torque force, the angular equivalent of simple vector
21  * force.
22  */
23 class EXPCL_PANDA_PHYSICS AngularVectorForce : public AngularForce {
24 PUBLISHED:
25  explicit AngularVectorForce(const LRotation& quat);
26  explicit AngularVectorForce(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
28  virtual ~AngularVectorForce();
29 
30  INLINE void set_quat(const LRotation& quat);
31  INLINE void set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
32  INLINE LRotation get_local_quat() const;
33 
34  virtual void output(std::ostream &out) const;
35  virtual void write(std::ostream &out, int indent=0) const;
36 
37 private:
38  LRotation _fvec;
39 
40  virtual AngularForce *make_copy() const;
41  virtual LRotation get_child_quat(const PhysicsObject *po);
42 
43 public:
44  static TypeHandle get_class_type() {
45  return _type_handle;
46  }
47  static void init_type() {
48  AngularForce::init_type();
49  register_type(_type_handle, "AngularVectorForce",
50  AngularForce::get_class_type());
51  }
52  virtual TypeHandle get_type() const {
53  return get_class_type();
54  }
55  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
56 
57 private:
58  static TypeHandle _type_handle;
59 };
60 
61 #include "angularVectorForce.I"
62 
63 #endif // ANGULARVECTORFORCE_H
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A body on which physics will be applied.
Definition: physicsObject.h:27
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
a simple directed torque force, the angular equivalent of simple vector force.
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition: indent.cxx:20
pure virtual parent of all quat-based forces.
Definition: angularForce.h:22
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81