Panda3D
angularIntegrator.cxx
1 // Filename: angularIntegrator.cxx
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 #include "angularIntegrator.h"
16 
17 ConfigVariableDouble AngularIntegrator::_max_angular_dt
18 ("default_max_angular_dt", 1.0f / 30.0f);
19 
20 ////////////////////////////////////////////////////////////////////
21 // Function : AngularIntegrator
22 // Access : protected
23 // Description : constructor
24 ////////////////////////////////////////////////////////////////////
25 AngularIntegrator::
26 AngularIntegrator() {
27 }
28 
29 ////////////////////////////////////////////////////////////////////
30 // Function : ~AngularIntegrator
31 // Access : public, virtual
32 // Description : destructor
33 ////////////////////////////////////////////////////////////////////
36 }
37 
38 ////////////////////////////////////////////////////////////////////
39 // Function : Integrate
40 // Access : public
41 // Description : high-level integration. API.
42 ////////////////////////////////////////////////////////////////////
45  PN_stdfloat dt) {
46  // intercept in case we want to censor/adjust values
47  if (dt > _max_angular_dt) {
48  dt = _max_angular_dt;
49  }
50 
51  // this actually does the integration.
52  child_integrate(physical, forces, dt);
53 }
54 
55 ////////////////////////////////////////////////////////////////////
56 // Function : output
57 // Access : Public
58 // Description : Write a string representation of this instance to
59 // <out>.
60 ////////////////////////////////////////////////////////////////////
62 output(ostream &out) const {
63  #ifndef NDEBUG //[
64  out<<"AngularIntegrator";
65  #endif //] NDEBUG
66 }
67 
68 ////////////////////////////////////////////////////////////////////
69 // Function : write
70 // Access : Public
71 // Description : Write a string representation of this instance to
72 // <out>.
73 ////////////////////////////////////////////////////////////////////
75 write(ostream &out, unsigned int indent) const {
76  #ifndef NDEBUG //[
77  out.width(indent); out<<""; out<<"AngularIntegrator:\n";
78  out.width(indent+2); out<<""; out<<"_max_angular_dt "<<_max_angular_dt<<" (class const)\n";
79  BaseIntegrator::write(out, indent+2);
80  #endif //] NDEBUG
81 }
void integrate(Physical *physical, AngularForceVector &forces, PN_stdfloat dt)
high-level integration.
virtual void write(ostream &out, unsigned int indent=0) const
Write a string representation of this instance to <out>.
virtual ~AngularIntegrator()
destructor
This is a convenience class to specialize ConfigVariable as a floating-point type.
Defines a set of physically modeled attributes.
Definition: physical.h:40
virtual void output(ostream &out) const
Write a string representation of this instance to <out>.
virtual void write(ostream &out, unsigned int indent=0) const
Write a string representation of this instance to <out>.