Panda3D
baseParticle.cxx
1 // Filename: baseParticle.cxx
2 // Created by: charles (14Jun00)
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 "baseParticle.h"
16 
17 ////////////////////////////////////////////////////////////////////
18 // Function : BaseParticle
19 // Access : Public
20 // Description : Default Constructor
21 ////////////////////////////////////////////////////////////////////
22 BaseParticle::
23 BaseParticle(PN_stdfloat lifespan, bool alive) :
24  _age(0.0f), _lifespan(lifespan), _alive(alive), _index(0){
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function : BaseParticle
29 // Access : Public
30 // Description : Copy Constructor
31 ////////////////////////////////////////////////////////////////////
32 BaseParticle::
33 BaseParticle(const BaseParticle &copy) :
34  _age(copy._age),
35  _lifespan(copy._lifespan),
36  _alive(copy._alive),
37  _index(copy._index) {
38 }
39 
40 ////////////////////////////////////////////////////////////////////
41 // Function : ~BaseParticle
42 // Access : Public
43 // Description : Default Destructor
44 ////////////////////////////////////////////////////////////////////
45 BaseParticle::
46 ~BaseParticle() {
47 }
48 
49 ////////////////////////////////////////////////////////////////////
50 // Function : get_theta
51 // Access : Public
52 // Description : for spriteParticleRenderer
53 ////////////////////////////////////////////////////////////////////
54 PN_stdfloat BaseParticle::
55 get_theta() const {
56  return 0.0f;
57 }
58 
59 ////////////////////////////////////////////////////////////////////
60 // Function : output
61 // Access : Public
62 // Description : Write a string representation of this instance to
63 // <out>.
64 ////////////////////////////////////////////////////////////////////
65 void BaseParticle::
66 output(ostream &out) const {
67  #ifndef NDEBUG //[
68  out<<"BaseParticle";
69  #endif //] NDEBUG
70 }
71 
72 ////////////////////////////////////////////////////////////////////
73 // Function : write
74 // Access : Public
75 // Description : Write a string representation of this instance to
76 // <out>.
77 ////////////////////////////////////////////////////////////////////
78 void BaseParticle::
79 write(ostream &out, int indent) const {
80  #ifndef NDEBUG //[
81  out.width(indent); out<<""; out<<"BaseParticle:\n";
82  out.width(indent+2); out<<""; out<<"_age "<<_age<<"\n";
83  out.width(indent+2); out<<""; out<<"_lifespan "<<_lifespan<<"\n";
84  out.width(indent+2); out<<""; out<<"_alive "<<_alive<<"\n";
85  out.width(indent+2); out<<""; out<<"_index "<<_index<<"\n";
86  out.width(indent+2); out<<""; out<<"_last_position "<<_last_position<<"\n";
87  PhysicsObject::write(out, indent+2);
88  #endif //] NDEBUG
89 }
90 
virtual void write(ostream &out, unsigned int indent=0) const
Write a string representation of this instance to <out>.
virtual void output(ostream &out) const
Write a string representation of this instance to <out>.
virtual PN_stdfloat get_theta() const
for spriteParticleRenderer
An individual, physically-modelable particle abstract base class.
Definition: baseParticle.h:26
virtual void write(ostream &out, int indent=0) const
Write a string representation of this instance to <out>.