Panda3D

baseParticle.cxx

00001 // Filename: baseParticle.cxx
00002 // Created by:  charles (14Jun00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #include "baseParticle.h"
00016 
00017 ////////////////////////////////////////////////////////////////////
00018 //    Function : BaseParticle
00019 //      Access : Public
00020 // Description : Default Constructor
00021 ////////////////////////////////////////////////////////////////////
00022 BaseParticle::
00023 BaseParticle(PN_stdfloat lifespan, bool alive) :
00024   _age(0.0f), _lifespan(lifespan), _alive(alive), _index(0){
00025 }
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //    Function : BaseParticle
00029 //      Access : Public
00030 // Description : Copy Constructor
00031 ////////////////////////////////////////////////////////////////////
00032 BaseParticle::
00033 BaseParticle(const BaseParticle &copy) :
00034   _age(copy._age),
00035   _lifespan(copy._lifespan),
00036   _alive(copy._alive),
00037   _index(copy._index) {
00038 }
00039 
00040 ////////////////////////////////////////////////////////////////////
00041 //    Function : ~BaseParticle
00042 //      Access : Public
00043 // Description : Default Destructor
00044 ////////////////////////////////////////////////////////////////////
00045 BaseParticle::
00046 ~BaseParticle() {
00047 }
00048 
00049 ////////////////////////////////////////////////////////////////////
00050 //    Function : get_theta
00051 //      Access : Public
00052 // Description : for spriteParticleRenderer
00053 ////////////////////////////////////////////////////////////////////
00054 PN_stdfloat BaseParticle::
00055 get_theta() const {
00056   return 0.0f;
00057 }
00058 
00059 ////////////////////////////////////////////////////////////////////
00060 //     Function : output
00061 //       Access : Public
00062 //  Description : Write a string representation of this instance to
00063 //                <out>.
00064 ////////////////////////////////////////////////////////////////////
00065 void BaseParticle::
00066 output(ostream &out) const {
00067   #ifndef NDEBUG //[
00068   out<<"BaseParticle";
00069   #endif //] NDEBUG
00070 }
00071 
00072 ////////////////////////////////////////////////////////////////////
00073 //     Function : write
00074 //       Access : Public
00075 //  Description : Write a string representation of this instance to
00076 //                <out>.
00077 ////////////////////////////////////////////////////////////////////
00078 void BaseParticle::
00079 write(ostream &out, int indent) const {
00080   #ifndef NDEBUG //[
00081   out.width(indent); out<<""; out<<"BaseParticle:\n";
00082   out.width(indent+2); out<<""; out<<"_age "<<_age<<"\n";
00083   out.width(indent+2); out<<""; out<<"_lifespan "<<_lifespan<<"\n";
00084   out.width(indent+2); out<<""; out<<"_alive "<<_alive<<"\n";
00085   out.width(indent+2); out<<""; out<<"_index "<<_index<<"\n";
00086   out.width(indent+2); out<<""; out<<"_last_position "<<_last_position<<"\n";
00087   PhysicsObject::write(out, indent+2);
00088   #endif //] NDEBUG
00089 }
00090 
 All Classes Functions Variables Enumerations