mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 19:36:45 +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++) {
|
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
|
// only send to the NodeTypes that are serverType
|
||||||
if (node->getActiveSocket() != NULL && node->getType() == serverType) {
|
if (node->getActiveSocket() != NULL && node->getType() == serverType) {
|
||||||
totalServers++;
|
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
|
// get the server bounds for this server
|
||||||
QUuid nodeUUID = node->getUUID();
|
QUuid nodeUUID = node->getUUID();
|
||||||
|
|
||||||
|
|
|
@ -27,16 +27,33 @@ void ParticleTreeRenderer::renderElement(OctreeElement* element) {
|
||||||
|
|
||||||
uint16_t numberOfParticles = particles.size();
|
uint16_t numberOfParticles = particles.size();
|
||||||
|
|
||||||
glPointSize(20.0f);
|
bool drawAsSphere = true;
|
||||||
glBegin(GL_POINTS);
|
|
||||||
|
if (!drawAsSphere) {
|
||||||
|
glPointSize(20.0f);
|
||||||
|
glBegin(GL_POINTS);
|
||||||
|
}
|
||||||
|
|
||||||
for (uint16_t i = 0; i < numberOfParticles; i++) {
|
for (uint16_t i = 0; i < numberOfParticles; i++) {
|
||||||
const Particle& particle = particles[i];
|
const Particle& particle = particles[i];
|
||||||
// render particle aspoints
|
// render particle aspoints
|
||||||
glm::vec3 position = particle.getPosition() * (float)TREE_SCALE;
|
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