Panda3D
|
00001 // Filename: orientedParticleFactory.cxx 00002 // Created by: charles (05Jul00) 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 "orientedParticleFactory.h" 00016 #include "orientedParticle.h" 00017 00018 //////////////////////////////////////////////////////////////////// 00019 // Function : OrientedParticleFactory 00020 // Access : Public 00021 // Description : Constructor 00022 //////////////////////////////////////////////////////////////////// 00023 OrientedParticleFactory:: 00024 OrientedParticleFactory() : 00025 BaseParticleFactory() { 00026 } 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Function : OrientedParticleFactory 00030 // Access : Public 00031 // Description : copy Constructor 00032 //////////////////////////////////////////////////////////////////// 00033 OrientedParticleFactory:: 00034 OrientedParticleFactory(const OrientedParticleFactory ©) : 00035 BaseParticleFactory(copy) { 00036 _initial_orientation = copy._initial_orientation; 00037 _final_orientation = copy._final_orientation; 00038 } 00039 00040 //////////////////////////////////////////////////////////////////// 00041 // Function : ~OrientedParticleFactory 00042 // Access : public 00043 // Description : destructor 00044 //////////////////////////////////////////////////////////////////// 00045 OrientedParticleFactory:: 00046 ~OrientedParticleFactory() { 00047 } 00048 00049 //////////////////////////////////////////////////////////////////// 00050 // Function : populate_child_particle 00051 // Access : private 00052 // Description : child spawn 00053 //////////////////////////////////////////////////////////////////// 00054 void OrientedParticleFactory:: 00055 populate_child_particle(BaseParticle *bp) const { 00056 bp->set_orientation(_initial_orientation); 00057 } 00058 00059 //////////////////////////////////////////////////////////////////// 00060 // Function : alloc_particle 00061 // Access : public 00062 // Description : child particle generation function 00063 //////////////////////////////////////////////////////////////////// 00064 BaseParticle *OrientedParticleFactory:: 00065 alloc_particle() const { 00066 return new OrientedParticle; 00067 } 00068 00069 //////////////////////////////////////////////////////////////////// 00070 // Function : output 00071 // Access : Public 00072 // Description : Write a string representation of this instance to 00073 // <out>. 00074 //////////////////////////////////////////////////////////////////// 00075 void OrientedParticleFactory:: 00076 output(ostream &out) const { 00077 #ifndef NDEBUG //[ 00078 out<<"OrientedParticleFactory"; 00079 #endif //] NDEBUG 00080 } 00081 00082 //////////////////////////////////////////////////////////////////// 00083 // Function : write 00084 // Access : Public 00085 // Description : Write a string representation of this instance to 00086 // <out>. 00087 //////////////////////////////////////////////////////////////////// 00088 void OrientedParticleFactory:: 00089 write(ostream &out, int indent) const { 00090 #ifndef NDEBUG //[ 00091 out.width(indent); out<<""; out<<"OrientedParticleFactory:\n"; 00092 BaseParticleFactory::write(out, indent+2); 00093 #endif //] NDEBUG 00094 }