Panda3D
 All Classes Functions Variables Enumerations
linearJitterForce.cxx
1 // Filename: linearJitterForce.cxx
2 // Created by: charles (16Jun00)
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 "linearJitterForce.h"
16 
17 TypeHandle LinearJitterForce::_type_handle;
18 
19 ////////////////////////////////////////////////////////////////////
20 // Function : LinearJitterForce
21 // Access : Public
22 // Description : constructor
23 ////////////////////////////////////////////////////////////////////
25 LinearJitterForce(PN_stdfloat a, bool mass) :
26  LinearRandomForce(a, mass) {
27 }
28 
29 ////////////////////////////////////////////////////////////////////
30 // Function : LinearJitterForce
31 // Access : Public
32 // Description : copy constructor
33 ////////////////////////////////////////////////////////////////////
36  LinearRandomForce(copy) {
37 }
38 
39 ////////////////////////////////////////////////////////////////////
40 // Function : LinearJitterForce
41 // Access : Public
42 // Description : constructor
43 ////////////////////////////////////////////////////////////////////
46 }
47 
48 ////////////////////////////////////////////////////////////////////
49 // Function : make_copy
50 // Access : Public
51 // Description : copier
52 ////////////////////////////////////////////////////////////////////
53 LinearForce *LinearJitterForce::
54 make_copy() {
55  return new LinearJitterForce(*this);
56 }
57 
58 ////////////////////////////////////////////////////////////////////
59 // Function : get_child_vector
60 // Access : Public
61 // Description : random value
62 ////////////////////////////////////////////////////////////////////
63 LVector3 LinearJitterForce::
64 get_child_vector(const PhysicsObject *) {
65  return random_unit_vector();
66 }
67 
68 ////////////////////////////////////////////////////////////////////
69 // Function : output
70 // Access : Public
71 // Description : Write a string representation of this instance to
72 // <out>.
73 ////////////////////////////////////////////////////////////////////
75 output(ostream &out) const {
76  #ifndef NDEBUG //[
77  out<<"LinearJitterForce";
78  #endif //] NDEBUG
79 }
80 
81 ////////////////////////////////////////////////////////////////////
82 // Function : write
83 // Access : Public
84 // Description : Write a string representation of this instance to
85 // <out>.
86 ////////////////////////////////////////////////////////////////////
88 write(ostream &out, unsigned int indent) const {
89  #ifndef NDEBUG //[
90  out.width(indent); out<<""; out<<"LinearJitterForce:\n";
91  LinearRandomForce::write(out, indent+2);
92  #endif //] NDEBUG
93 }
virtual ~LinearJitterForce()
constructor
virtual void write(ostream &out, unsigned int indent=0) const
Write a string representation of this instance to &lt;out&gt;.
Pure virtual, parent to noiseForce and jitterForce.
virtual void write(ostream &out, unsigned int indent=0) const
Write a string representation of this instance to &lt;out&gt;.
virtual void output(ostream &out) const
Write a string representation of this instance to &lt;out&gt;.
A body on which physics will be applied.
Definition: physicsObject.h:29
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
LinearJitterForce(PN_stdfloat a=1.0f, bool m=false)
constructor
A force that acts on a PhysicsObject by way of an Integrator.
Definition: linearForce.h:25
Completely random noise force vector.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85