Panda3D
angularVectorForce.cxx
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.cxx
10  * @author charles
11  * @date 2000-08-09
12  */
13 
14 #include "angularVectorForce.h"
15 
16 TypeHandle AngularVectorForce::_type_handle;
17 
18 /**
19  * constructor
20  */
22 AngularVectorForce(const LRotation &vec) :
23  AngularForce(), _fvec(vec) {
24 }
25 
26 /**
27  * constructor
28  */
30 AngularVectorForce(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) :
31  AngularForce() {
32  _fvec.set_hpr(LVecBase3(h, p, r));
33 }
34 
35 /**
36  * copy constructor
37  */
40  AngularForce(copy) {
41  _fvec = copy._fvec;
42 }
43 
44 /**
45  * destructor
46  */
49 }
50 
51 /**
52  * dynamic copier
53  */
54 AngularForce *AngularVectorForce::
55 make_copy() const {
56  return new AngularVectorForce(*this);
57 }
58 
59 /**
60  * query
61  */
62 LRotation AngularVectorForce::
63 get_child_quat(const PhysicsObject *) {
64  return _fvec;
65 }
66 
67 /**
68  * Write a string representation of this instance to <out>.
69  */
71 output(std::ostream &out) const {
72  #ifndef NDEBUG //[
73  out<<"AngularVectorForce";
74  #endif //] NDEBUG
75 }
76 
77 /**
78  * Write a string representation of this instance to <out>.
79  */
81 write(std::ostream &out, int indent) const {
82  #ifndef NDEBUG //[
83  out.width(indent); out<<""; out<<"AngularVectorForce:\n";
84  out.width(indent+2); out<<""; out<<"_fvec "<<_fvec<<"\n";
86  #endif //] NDEBUG
87 }
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
virtual ~AngularVectorForce()
destructor
AngularVectorForce(const LRotation &quat)
constructor
A body on which physics will be applied.
Definition: physicsObject.h:27
a simple directed torque force, the angular equivalent of simple vector force.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
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