Panda3D
Loading...
Searching...
No Matches
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 */
19BaseParticle::
20BaseParticle(PN_stdfloat lifespan, bool alive) :
21 _age(0.0f), _lifespan(lifespan), _alive(alive), _index(0){
22}
23
24/**
25 * Copy Constructor
26 */
27BaseParticle::
28BaseParticle(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 */
38BaseParticle::
39~BaseParticle() {
40}
41
42/**
43 * for spriteParticleRenderer
44 */
45PN_stdfloat BaseParticle::
46get_theta() const {
47 return 0.0f;
48}
49
50/**
51 * Write a string representation of this instance to <out>.
52 */
54output(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 */
64write(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";
72 #endif //] NDEBUG
73}
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An individual, physically-modelable particle abstract base class.
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
virtual PN_stdfloat get_theta() const
for spriteParticleRenderer
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition indent.cxx:20