Panda3D

baseParticle.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 baseParticle.cxx
10 * @author charles
11 * @date 2000-06-14
12 */
13
14 #include "baseParticle.h"
15
16 /**
17 * Default Constructor
18 */
19 BaseParticle::
20 BaseParticle(PN_stdfloat lifespan, bool alive) :
21 _age(0.0f), _lifespan(lifespan), _alive(alive), _index(0){
22 }
23
24 /**
25 * Copy Constructor
26 */
27 BaseParticle::
28 BaseParticle(const BaseParticle &copy) :
29 _age(copy._age),
30 _lifespan(copy._lifespan),
31 _alive(copy._alive),
32 _index(copy._index) {
33 }
34
35 /**
36 * Default Destructor
37 */
38 BaseParticle::
39 ~BaseParticle() {
40 }
41
42 /**
43 * for spriteParticleRenderer
44 */
45 PN_stdfloat BaseParticle::
46 get_theta() const {
47 return 0.0f;
48 }
49
50 /**
51 * Write a string representation of this instance to <out>.
52 */
53 void BaseParticle::
54 output(std::ostream &out) const {
55 #ifndef NDEBUG //[
56 out<<"BaseParticle";
57 #endif //] NDEBUG
58 }
59
60 /**
61 * Write a string representation of this instance to <out>.
62 */
63 void BaseParticle::
64 write(std::ostream &out, int indent) const {
65 #ifndef NDEBUG //[
66 out.width(indent); out<<""; out<<"BaseParticle:\n";
67 out.width(indent+2); out<<""; out<<"_age "<<_age<<"\n";
68 out.width(indent+2); out<<""; out<<"_lifespan "<<_lifespan<<"\n";
69 out.width(indent+2); out<<""; out<<"_alive "<<_alive<<"\n";
70 out.width(indent+2); out<<""; out<<"_index "<<_index<<"\n";
71 PhysicsObject::write(out, indent+2);
72 #endif //] NDEBUG
73 }
baseParticle.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
BaseParticle
An individual, physically-modelable particle abstract base class.
Definition: baseParticle.h:23
BaseParticle::write
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
Definition: baseParticle.cxx:64
BaseParticle::get_theta
virtual PN_stdfloat get_theta() const
for spriteParticleRenderer
Definition: baseParticle.cxx:46
BaseParticle::output
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
Definition: baseParticle.cxx:54
PhysicsObject::write
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
Definition: physicsObject.cxx:163
indent
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition: indent.cxx:20