mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
Merge branch 'master' of https://github.com/worklist/hifi into ick
This commit is contained in:
commit
a7ade142fd
10 changed files with 60 additions and 82 deletions
|
@ -106,7 +106,7 @@ void AvatarMixer::run() {
|
|||
sockaddr nodeAddress = {};
|
||||
ssize_t receivedBytes = 0;
|
||||
|
||||
unsigned char* packetData = new unsigned char[MAX_PACKET_SIZE];
|
||||
unsigned char packetData[MAX_PACKET_SIZE];
|
||||
|
||||
QUuid nodeUUID;
|
||||
Node* avatarNode = NULL;
|
||||
|
|
|
@ -2736,32 +2736,6 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) {
|
|||
// disable specular lighting for ground and voxels
|
||||
glMaterialfv(GL_FRONT, GL_SPECULAR, NO_SPECULAR_COLOR);
|
||||
|
||||
//draw a grid ground plane....
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::GroundPlane)) {
|
||||
PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
|
||||
"Application::displaySide() ... ground plane...");
|
||||
|
||||
// draw grass plane with fog
|
||||
glEnable(GL_FOG);
|
||||
glEnable(GL_NORMALIZE);
|
||||
const float FOG_COLOR[] = { 1.0f, 1.0f, 1.0f, 1.0f };
|
||||
glFogfv(GL_FOG_COLOR, FOG_COLOR);
|
||||
glFogi(GL_FOG_MODE, GL_EXP2);
|
||||
glFogf(GL_FOG_DENSITY, 0.025f);
|
||||
glPushMatrix();
|
||||
const float GRASS_PLANE_SIZE = 256.0f;
|
||||
glTranslatef(-GRASS_PLANE_SIZE * 0.5f, -0.01f, GRASS_PLANE_SIZE * 0.5f);
|
||||
glScalef(GRASS_PLANE_SIZE, 1.0f, GRASS_PLANE_SIZE);
|
||||
glRotatef(-90.0f, 1.0f, 0.0f, 0.0f);
|
||||
glColor3ub(70, 134, 74);
|
||||
const int GRASS_DIVISIONS = 40;
|
||||
_geometryCache.renderSquare(GRASS_DIVISIONS, GRASS_DIVISIONS);
|
||||
glPopMatrix();
|
||||
glDisable(GL_FOG);
|
||||
glDisable(GL_NORMALIZE);
|
||||
|
||||
//renderGroundPlaneGrid(EDGE_SIZE_GROUND_PLANE, _audio.getCollisionSoundMagnitude());
|
||||
}
|
||||
// Draw Cloud Particles
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::ParticleCloud)) {
|
||||
_cloud.render();
|
||||
|
|
|
@ -249,7 +249,6 @@ Menu::Menu() :
|
|||
|
||||
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Stars, Qt::Key_Asterisk, true);
|
||||
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Atmosphere, Qt::SHIFT | Qt::Key_A, true);
|
||||
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::GroundPlane, 0, true);
|
||||
addActionToQMenuAndActionHash(renderOptionsMenu,
|
||||
MenuOption::GlowMode,
|
||||
0,
|
||||
|
|
|
@ -177,7 +177,6 @@ namespace MenuOption {
|
|||
const QString KillLocalVoxels = "Kill Local Voxels";
|
||||
const QString GoHome = "Go Home";
|
||||
const QString Gravity = "Use Gravity";
|
||||
const QString GroundPlane = "Ground Plane";
|
||||
const QString ParticleCloud = "Particle Cloud";
|
||||
const QString Log = "Log";
|
||||
const QString Login = "Login";
|
||||
|
|
|
@ -413,39 +413,6 @@ void renderCollisionOverlay(int width, int height, float magnitude) {
|
|||
}
|
||||
}
|
||||
|
||||
void renderGroundPlaneGrid(float size, float impact) {
|
||||
float IMPACT_SOUND_MAGNITUDE_FOR_RECOLOR = 1.f;
|
||||
glLineWidth(2.0);
|
||||
glm::vec4 impactColor(1, 0, 0, 1);
|
||||
glm::vec3 lineColor(0.4, 0.5, 0.3);
|
||||
glm::vec4 surfaceColor(0.5, 0.5, 0.5, 0.4);
|
||||
|
||||
glColor3fv(&lineColor.x);
|
||||
for (float x = 0; x <= size; x++) {
|
||||
glBegin(GL_LINES);
|
||||
glVertex3f(x, 0, 0);
|
||||
glVertex3f(x, 0, size);
|
||||
glVertex3f(0, 0, x);
|
||||
glVertex3f(size, 0, x);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
// Draw the floor, colored for recent impact
|
||||
glm::vec4 floorColor;
|
||||
if (impact > IMPACT_SOUND_MAGNITUDE_FOR_RECOLOR) {
|
||||
floorColor = impact * impactColor + (1.f - impact) * surfaceColor;
|
||||
} else {
|
||||
floorColor = surfaceColor;
|
||||
}
|
||||
glColor4fv(&floorColor.x);
|
||||
glBegin(GL_QUADS);
|
||||
glVertex3f(0, 0, 0);
|
||||
glVertex3f(size, 0, 0);
|
||||
glVertex3f(size, 0, size);
|
||||
glVertex3f(0, 0, size);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
void renderMouseVoxelGrid(const float& mouseVoxelX, const float& mouseVoxelY, const float& mouseVoxelZ, const float& mouseVoxelS) {
|
||||
glm::vec3 origin = glm::vec3(mouseVoxelX, mouseVoxelY, mouseVoxelZ);
|
||||
|
||||
|
|
|
@ -61,8 +61,6 @@ glm::quat extractRotation(const glm::mat4& matrix, bool assumeOrthogonal = false
|
|||
|
||||
double diffclock(timeval *clock1,timeval *clock2);
|
||||
|
||||
void renderGroundPlaneGrid(float size, float impact);
|
||||
|
||||
void renderMouseVoxelGrid(const float& mouseVoxelX, const float& mouseVoxelY, const float& mouseVoxelZ, const float& mouseVoxelS);
|
||||
|
||||
void renderNudgeGrid(float voxelX, float voxelY, float voxelZ, float voxelS, float voxelPrecision);
|
||||
|
|
|
@ -84,16 +84,16 @@ void RearMirrorTools::displayIcon(QRect bounds, int left, int top, GLuint textur
|
|||
glBindTexture(GL_TEXTURE_2D, textureId);
|
||||
glBegin(GL_QUADS);
|
||||
{
|
||||
glTexCoord2f(0, 0);
|
||||
glTexCoord2f(0, 1);
|
||||
glVertex2f(left, top);
|
||||
|
||||
glTexCoord2f(1, 0);
|
||||
glTexCoord2f(1, 1);
|
||||
glVertex2f(ICON_SIZE + left, top);
|
||||
|
||||
glTexCoord2f(1, 1);
|
||||
glTexCoord2f(1, 0);
|
||||
glVertex2f(ICON_SIZE + left, twp);
|
||||
|
||||
glTexCoord2f(0, 1);
|
||||
glTexCoord2f(0, 0);
|
||||
glVertex2f(left, twp);
|
||||
}
|
||||
glEnd();
|
||||
|
|
|
@ -767,7 +767,7 @@ void* removeSilentNodes(void *args) {
|
|||
uint64_t checkTimeUsecs = 0;
|
||||
int sleepTime = 0;
|
||||
|
||||
while (!silentNodeThreadStopFlag) {
|
||||
while (!::silentNodeThreadStopFlag) {
|
||||
|
||||
checkTimeUsecs = usecTimestampNow();
|
||||
|
||||
|
@ -802,13 +802,23 @@ void* removeSilentNodes(void *args) {
|
|||
}
|
||||
|
||||
void NodeList::startSilentNodeRemovalThread() {
|
||||
pthread_create(&removeSilentNodesThread, NULL, removeSilentNodes, (void*) this);
|
||||
if (!::silentNodeThreadStopFlag) {
|
||||
pthread_create(&removeSilentNodesThread, NULL, removeSilentNodes, (void*) this);
|
||||
} else {
|
||||
qDebug("Refusing to start silent node removal thread from previously failed join.\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void NodeList::stopSilentNodeRemovalThread() {
|
||||
silentNodeThreadStopFlag = true;
|
||||
pthread_join(removeSilentNodesThread, NULL);
|
||||
::silentNodeThreadStopFlag = true;
|
||||
int joinResult = pthread_join(removeSilentNodesThread, NULL);
|
||||
|
||||
if (joinResult == 0) {
|
||||
::silentNodeThreadStopFlag = false;
|
||||
} else {
|
||||
qDebug("Silent node removal thread join failed with %d. Will not restart.\n", joinResult);
|
||||
}
|
||||
}
|
||||
|
||||
const QString QSETTINGS_GROUP_NAME = "NodeList";
|
||||
|
|
|
@ -315,14 +315,14 @@ void VoxelServer::run() {
|
|||
qDebug("dumpVoxelsOnMove=%s\n", debug::valueOf(_dumpVoxelsOnMove));
|
||||
|
||||
// should we send environments? Default is yes, but this command line suppresses sending
|
||||
const char* DONT_SEND_ENVIRONMENTS = "--dontSendEnvironments";
|
||||
bool dontSendEnvironments = getCmdOption(_argc, _argv, DONT_SEND_ENVIRONMENTS);
|
||||
const char* SEND_ENVIRONMENTS = "--sendEnvironments";
|
||||
bool dontSendEnvironments = !getCmdOption(_argc, _argv, SEND_ENVIRONMENTS);
|
||||
if (dontSendEnvironments) {
|
||||
qDebug("Sending environments suppressed...\n");
|
||||
_sendEnvironments = false;
|
||||
} else {
|
||||
// should we send environments? Default is yes, but this command line suppresses sending
|
||||
const char* MINIMAL_ENVIRONMENT = "--MinimalEnvironment";
|
||||
const char* MINIMAL_ENVIRONMENT = "--minimalEnvironment";
|
||||
_sendMinimalEnvironment = getCmdOption(_argc, _argv, MINIMAL_ENVIRONMENT);
|
||||
qDebug("Using Minimal Environment=%s\n", debug::valueOf(_sendMinimalEnvironment));
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
#include <SharedUtil.h>
|
||||
#include <SceneUtils.h>
|
||||
#include <JurisdictionMap.h>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
VoxelTree myTree;
|
||||
|
||||
|
@ -233,9 +235,44 @@ void processFillSVOFile(const char* fillSVOFile) {
|
|||
}
|
||||
|
||||
|
||||
int old_main(int argc, const char * argv[])
|
||||
int main(int argc, const char * argv[])
|
||||
{
|
||||
qInstallMessageHandler(sharedMessageHandler);
|
||||
|
||||
|
||||
const char* GET_OCTCODE = "--getOctCode";
|
||||
const char* octcodeParams = getCmdOption(argc, argv, GET_OCTCODE);
|
||||
if (octcodeParams) {
|
||||
|
||||
QString octcodeParamsString(octcodeParams);
|
||||
QStringList octcodeParamsList = octcodeParamsString.split(QString(","));
|
||||
|
||||
enum { X_AT, Y_AT, Z_AT, S_AT, EXPECTED_PARAMS };
|
||||
if (octcodeParamsList.size() == EXPECTED_PARAMS) {
|
||||
QString xStr = octcodeParamsList.at(X_AT);
|
||||
QString yStr = octcodeParamsList.at(Y_AT);
|
||||
QString zStr = octcodeParamsList.at(Z_AT);
|
||||
QString sStr = octcodeParamsList.at(S_AT);
|
||||
|
||||
float x = xStr.toFloat()/TREE_SCALE; // 0.14745788574219;
|
||||
float y = yStr.toFloat()/TREE_SCALE; // 0.01502178955078;
|
||||
float z = zStr.toFloat()/TREE_SCALE; // 0.56540045166016;
|
||||
float s = sStr.toFloat()/TREE_SCALE; // 0.015625;
|
||||
|
||||
qDebug() << "Get Octal Code for:\n";
|
||||
qDebug() << " x:" << xStr << " [" << x << "] \n";
|
||||
qDebug() << " y:" << yStr << " [" << y << "] \n";
|
||||
qDebug() << " z:" << zStr << " [" << z << "] \n";
|
||||
qDebug() << " s:" << sStr << " [" << s << "] \n";
|
||||
|
||||
unsigned char* octalCode = pointToVoxel(x, y, z, s);
|
||||
QString octalCodeStr = octalCodeToHexString(octalCode);
|
||||
qDebug() << "octal code: " << octalCodeStr << "\n";
|
||||
|
||||
} else {
|
||||
qDebug() << "Unexpected number of parameters for getOctCode\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Handles taking and SVO and splitting it into multiple SVOs based on
|
||||
// jurisdiction details
|
||||
|
@ -361,9 +398,3 @@ void unitTest(VoxelTree * tree) {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, const char * argv[]) {
|
||||
unitTest(&myTree);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue