Panda3D
|
00001 // Filename: discEmitter.h 00002 // Created by: charles (22Jun00) 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 #ifndef DISCEMITTER_H 00016 #define DISCEMITTER_H 00017 00018 #include "baseParticleEmitter.h" 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Class : DiscEmitter 00022 // Description : Describes a planar disc region from which particles 00023 // are generated 00024 //////////////////////////////////////////////////////////////////// 00025 class EXPCL_PANDAPHYSICS DiscEmitter : public BaseParticleEmitter { 00026 PUBLISHED: 00027 DiscEmitter(); 00028 DiscEmitter(const DiscEmitter ©); 00029 virtual ~DiscEmitter(); 00030 00031 virtual BaseParticleEmitter *make_copy(); 00032 00033 INLINE void set_radius(float r); 00034 INLINE void set_outer_angle(float o_angle); 00035 INLINE void set_inner_angle(float i_angle); 00036 INLINE void set_outer_magnitude(float o_mag); 00037 INLINE void set_inner_magnitude(float i_mag); 00038 INLINE void set_cubic_lerping(bool clerp); 00039 00040 INLINE float get_radius() const; 00041 INLINE float get_outer_angle() const; 00042 INLINE float get_inner_angle() const; 00043 INLINE float get_outer_magnitude() const; 00044 INLINE float get_inner_magnitude() const; 00045 INLINE bool get_cubic_lerping() const; 00046 00047 virtual void output(ostream &out) const; 00048 virtual void write(ostream &out, int indent=0) const; 00049 00050 private: 00051 float _radius; 00052 00053 // CUSTOM EMISSION PARAMETERS 00054 float _inner_aoe; 00055 float _outer_aoe; 00056 float _inner_magnitude; 00057 float _outer_magnitude; 00058 bool _cubic_lerping; 00059 00060 /////////////////////////////// 00061 // scratch variables that carry over from position calc to velocity calc 00062 float _distance_from_center; 00063 float _sinf_theta; 00064 float _cosf_theta; 00065 /////////////////////////////// 00066 00067 virtual void assign_initial_position(LPoint3f& pos); 00068 virtual void assign_initial_velocity(LVector3f& vel); 00069 }; 00070 00071 #include "discEmitter.I" 00072 00073 #endif // DISCEMITTER_H