mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
fix particles some more again
This commit is contained in:
parent
ae9d219d77
commit
b67c7e41e7
@ -162,21 +162,25 @@ init_geoms() {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void SparkleParticleRenderer::
|
void SparkleParticleRenderer::
|
||||||
render(pvector< PT(PhysicsObject) >& po_vector, int ttl_particles) {
|
render(pvector< PT(PhysicsObject) >& po_vector, int ttl_particles) {
|
||||||
|
if (!ttl_particles) {
|
||||||
if (!ttl_particles)
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
BaseParticle *cur_particle;
|
BaseParticle *cur_particle;
|
||||||
|
|
||||||
int remaining_particles = ttl_particles;
|
int remaining_particles = ttl_particles;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
Vertexf *cur_vert = &_vertex_array[0];
|
Vertexf *cur_vert = NULL;
|
||||||
Colorf *cur_color = &_color_array[0];
|
Colorf *cur_color = NULL;
|
||||||
qpGeomVertexWriter vertex(_vdata, InternalName::get_vertex());
|
qpGeomVertexWriter vertex(_vdata, InternalName::get_vertex());
|
||||||
qpGeomVertexWriter color(_vdata, InternalName::get_color());
|
qpGeomVertexWriter color(_vdata, InternalName::get_color());
|
||||||
if (use_qpgeom) {
|
if (use_qpgeom) {
|
||||||
_lines->clear_vertices();
|
_lines->clear_vertices();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
cur_vert = &_vertex_array[0];
|
||||||
|
cur_color = &_color_array[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
// init the aabb
|
// init the aabb
|
||||||
@ -189,8 +193,9 @@ render(pvector< PT(PhysicsObject) >& po_vector, int ttl_particles) {
|
|||||||
for (i = 0; i < (int)po_vector.size(); i++) {
|
for (i = 0; i < (int)po_vector.size(); i++) {
|
||||||
cur_particle = (BaseParticle *) po_vector[i].p();
|
cur_particle = (BaseParticle *) po_vector[i].p();
|
||||||
|
|
||||||
if (cur_particle->get_alive() == false)
|
if (cur_particle->get_alive() == false) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
LPoint3f position = cur_particle->get_position();
|
LPoint3f position = cur_particle->get_position();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user