mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 06:53:59 +02:00
make particles spheres for now
This commit is contained in:
parent
2783770e2b
commit
d0944b0278
2 changed files with 22 additions and 15 deletions
|
@ -2633,20 +2633,10 @@ void Application::queryOctree(NODE_TYPE serverType, PACKET_TYPE packetType) {
|
|||
|
||||
for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) {
|
||||
|
||||
/**
|
||||
qDebug() << "Query... " << *node << "\n";
|
||||
qDebug(" node->getActiveSocket()=%p\n",node->getActiveSocket());
|
||||
qDebug(" node->getType()=%c\n",node->getType());
|
||||
qDebug(" serverType=%c\n",serverType);
|
||||
/**/
|
||||
|
||||
// only send to the NodeTypes that are serverType
|
||||
if (node->getActiveSocket() != NULL && node->getType() == serverType) {
|
||||
totalServers++;
|
||||
|
||||
//qDebug("LINE:%d -- Servers: total %d, in view %d, unknown jurisdiction %d \n",
|
||||
// __LINE__, totalServers, inViewServers, unknownJurisdictionServers);
|
||||
|
||||
// get the server bounds for this server
|
||||
QUuid nodeUUID = node->getUUID();
|
||||
|
||||
|
|
|
@ -27,16 +27,33 @@ void ParticleTreeRenderer::renderElement(OctreeElement* element) {
|
|||
|
||||
uint16_t numberOfParticles = particles.size();
|
||||
|
||||
glPointSize(20.0f);
|
||||
glBegin(GL_POINTS);
|
||||
bool drawAsSphere = true;
|
||||
|
||||
if (!drawAsSphere) {
|
||||
glPointSize(20.0f);
|
||||
glBegin(GL_POINTS);
|
||||
}
|
||||
|
||||
for (uint16_t i = 0; i < numberOfParticles; i++) {
|
||||
const Particle& particle = particles[i];
|
||||
// render particle aspoints
|
||||
glm::vec3 position = particle.getPosition() * (float)TREE_SCALE;
|
||||
|
||||
printf("glVertex3f(%f, %f, %f)\n", position.x, position.y, position.z);
|
||||
glColor3ub(particle.getColor()[RED_INDEX],particle.getColor()[GREEN_INDEX],particle.getColor()[BLUE_INDEX]);
|
||||
|
||||
glVertex3f(position.x, position.y, position.z);
|
||||
//printf("particle at... (%f, %f, %f)\n", position.x, position.y, position.z);
|
||||
|
||||
if (drawAsSphere) {
|
||||
float sphereRadius = particle.getRadius() * (float)TREE_SCALE;
|
||||
glPushMatrix();
|
||||
glTranslatef(position.x, position.y, position.z);
|
||||
glutSolidSphere(sphereRadius, 15, 15);
|
||||
glPopMatrix();
|
||||
} else {
|
||||
glVertex3f(position.x, position.y, position.z);
|
||||
}
|
||||
}
|
||||
if (!drawAsSphere) {
|
||||
glEnd();
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue