Panda3D
Loading...
Searching...
No Matches
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
16TypeHandle AngularVectorForce::_type_handle;
17
18/**
19 * constructor
20 */
22AngularVectorForce(const LRotation &vec) :
23 AngularForce(), _fvec(vec) {
24}
25
26/**
27 * constructor
28 */
30AngularVectorForce(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 */
50
51/**
52 * dynamic copier
53 */
54AngularForce *AngularVectorForce::
55make_copy() const {
56 return new AngularVectorForce(*this);
57}
58
59/**
60 * query
61 */
62LRotation AngularVectorForce::
63get_child_quat(const PhysicsObject *) {
64 return _fvec;
65}
66
67/**
68 * Write a string representation of this instance to <out>.
69 */
71output(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 */
81write(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}
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pure virtual parent of all quat-based forces.
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
a simple directed torque force, the angular equivalent of simple vector force.
AngularVectorForce(const LRotation &quat)
constructor
virtual void output(std::ostream &out) 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
A body on which physics will be applied.
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition indent.cxx:20