14 #ifndef SPRITEPARTICLERENDERER_H 15 #define SPRITEPARTICLERENDERER_H 49 aspect_ratio(copy.aspect_ratio) {
78 void set_source_info(
const std::string &tex) {
79 _source_type = ST_texture;
83 void set_source_info(
const std::string &model,
const std::string &node) {
84 _source_type = ST_from_node;
85 _source_model = model;
89 SourceType get_source_type()
const {
93 std::string get_tex_source()
const {
97 std::string get_model_source()
const {
101 std::string get_node_source()
const {
105 int get_num_frames()
const {
106 return textures.size();
111 textures.push_back(t);
112 this->ll.push_back(ll);
113 this->ur.push_back(ur);
124 void set_ll(
const int n, LTexCoord c) {
128 void set_ur(
const int n, LTexCoord c) {
132 Texture *get_frame(
const int n)
const {
136 LTexCoord get_ll(
const int n)
const {
140 LTexCoord get_ur(
const int n)
const {
147 SourceType _source_type;
148 std::string _source_tex,_source_model,_source_node;
164 void set_from_node(
const NodePath &node_path,
bool size_from_texels =
false);
165 void set_from_node(
const NodePath &node_path,
const std::string &model,
const std::string &node,
bool size_from_texels =
false);
166 void add_from_node(
const NodePath &node_path,
bool size_from_texels =
false,
bool resize =
false);
167 void add_from_node(
const NodePath &node_path,
const std::string &model,
const std::string &node,
bool size_from_texels =
false,
bool resize =
false);
169 INLINE
void set_texture(
Texture *tex, PN_stdfloat texels_per_unit = 1.0f);
170 INLINE
void add_texture(
Texture *tex, PN_stdfloat texels_per_unit = 1.0f,
bool resize =
false);
171 INLINE
void remove_animation(
const int n);
172 INLINE
void set_ll_uv(
const LTexCoord &ll_uv);
173 INLINE
void set_ll_uv(
const LTexCoord &ll_uv,
const int anim,
const int frame);
174 INLINE
void set_ur_uv(
const LTexCoord &ur_uv);
175 INLINE
void set_ur_uv(
const LTexCoord &ur_uv,
const int anim,
const int frame);
176 INLINE
void set_size(PN_stdfloat width, PN_stdfloat height);
177 INLINE
void set_color(
const LColor &color);
178 INLINE
void set_x_scale_flag(
bool animate_x_ratio);
179 INLINE
void set_y_scale_flag(
bool animate_y_ratio);
180 INLINE
void set_anim_angle_flag(
bool animate_theta);
181 INLINE
void set_initial_x_scale(PN_stdfloat initial_x_scale);
182 INLINE
void set_final_x_scale(PN_stdfloat final_x_scale);
183 INLINE
void set_initial_y_scale(PN_stdfloat initial_y_scale);
184 INLINE
void set_final_y_scale(PN_stdfloat final_y_scale);
185 INLINE
void set_nonanimated_theta(PN_stdfloat theta);
186 INLINE
void set_alpha_blend_method(ParticleRendererBlendMethod bm);
187 INLINE
void set_alpha_disable(
bool ad);
188 INLINE
void set_animate_frames_enable(
bool an);
189 INLINE
void set_animate_frames_rate(PN_stdfloat r);
190 INLINE
void set_animate_frames_index(
int i);
192 INLINE
Texture *get_texture()
const;
193 INLINE
Texture *get_texture(
const int anim,
const int frame)
const;
194 INLINE
int get_num_anims()
const;
195 INLINE
SpriteAnim *get_anim(
const int n)
const;
196 MAKE_SEQ(get_anims, get_num_anims, get_anim);
199 INLINE LTexCoord get_ll_uv()
const;
200 INLINE LTexCoord get_ll_uv(
const int anim,
const int frame)
const;
201 INLINE LTexCoord get_ur_uv()
const;
202 INLINE LTexCoord get_ur_uv(
const int anim,
const int frame)
const;
203 INLINE PN_stdfloat get_width()
const;
204 INLINE PN_stdfloat get_height()
const;
205 INLINE LColor get_color()
const;
206 INLINE
bool get_x_scale_flag()
const;
207 INLINE
bool get_y_scale_flag()
const;
208 INLINE
bool get_anim_angle_flag()
const;
209 INLINE PN_stdfloat get_initial_x_scale()
const;
210 INLINE PN_stdfloat get_final_x_scale()
const;
211 INLINE PN_stdfloat get_initial_y_scale()
const;
212 INLINE PN_stdfloat get_final_y_scale()
const;
213 INLINE PN_stdfloat get_nonanimated_theta()
const;
214 INLINE ParticleRendererBlendMethod get_alpha_blend_method()
const;
215 INLINE
bool get_alpha_disable()
const;
216 INLINE
bool get_animate_frames_enable()
const;
217 INLINE PN_stdfloat get_animate_frames_rate()
const;
218 INLINE
int get_animate_frames_index()
const;
220 virtual void output(std::ostream &out)
const;
221 virtual void write(std::ostream &out,
int indent_level = 0)
const;
235 PN_stdfloat _initial_x_scale;
236 PN_stdfloat _final_x_scale;
237 PN_stdfloat _initial_y_scale;
238 PN_stdfloat _final_y_scale;
240 PN_stdfloat _base_y_scale;
241 PN_stdfloat _aspect_ratio;
242 PN_stdfloat _animate_frames_rate;
243 int _animate_frames_index;
245 bool _animate_x_ratio;
246 bool _animate_y_ratio;
249 bool _animate_frames;
250 bool _animation_removed;
252 ParticleRendererBlendMethod _blend_method;
260 virtual void birth_particle(
int index);
261 virtual void kill_particle(
int index);
262 virtual void init_geoms();
265 virtual void resize_pool(
int new_size);
268 vector_int _anim_size;
270 vector_int _birth_list;
277 #endif // SPRITEPARTICLERENDERER_H Renders a particle system with high-speed nasty trick sprites.
Helper class used by SpriteParticleRenderer to keep track of its textures and their respective UVs an...
This object provides a high-level interface for quickly writing a sequence of numeric values from a v...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
Defines a series of disconnected points.
void clear()
Resets the GeomVertexWriter to the initial state.
A body on which physics will be applied.
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A lightweight class that represents a single element that may be timed and/or counted via stats.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Pure virtual particle renderer base class.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
A container for geometry primitives.
High level class for color interpolation.
Manages a list of Texture objects, as returned by TexturePool::find_all_textures().
get_num_textures
Returns the number of Textures in the collection.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for all things that want to be reference-counted.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Helper class used by SpriteParticleRenderer to keep track of the various GeomVertexWriters associated...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
get_texture
Returns the nth Texture in the collection.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a set of zero or more NodePaths.