Panda3D
Loading...
Searching...
No Matches
linearRandomForce.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 linearRandomForce.cxx
10 * @author charles
11 * @date 2000-06-19
12 */
13
14#include "linearRandomForce.h"
15
16TypeHandle LinearRandomForce::_type_handle;
17
18/**
19 * vector constructor
20 */
21LinearRandomForce::
22LinearRandomForce(PN_stdfloat a, bool mass) :
23 LinearForce(a, mass) {
24}
25
26/**
27 * copy constructor
28 */
29LinearRandomForce::
30LinearRandomForce(const LinearRandomForce &copy) :
31 LinearForce(copy) {
32}
33
34/**
35 * destructor
36 */
40
41/**
42 * Returns a float in [0, 1]
43 */
44PN_stdfloat LinearRandomForce::
45bounded_rand() {
46 return ((PN_stdfloat)rand() / (PN_stdfloat)RAND_MAX);
47}
48
49/**
50 * Write a string representation of this instance to <out>.
51 */
53output(std::ostream &out) const {
54 #ifndef NDEBUG //[
55 out<<"LinearRandomForce";
56 #endif //] NDEBUG
57}
58
59/**
60 * Write a string representation of this instance to <out>.
61 */
63write(std::ostream &out, int indent) const {
64 #ifndef NDEBUG //[
65 out.width(indent); out<<""; out<<"LinearRandomForce:\n";
67 #endif //] NDEBUG
68}
A force that acts on a PhysicsObject by way of an Integrator.
Definition linearForce.h:23
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
Pure virtual, parent to noiseForce and jitterForce.
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
virtual ~LinearRandomForce()
destructor
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
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.