mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 08:03:34 +02:00
Merge remote-tracking branch 'upstream/master' into particles
This commit is contained in:
commit
f8392c0843
7 changed files with 23 additions and 18 deletions
|
@ -75,8 +75,6 @@ using namespace std;
|
|||
static char STAR_FILE[] = "http://s3-us-west-1.amazonaws.com/highfidelity/stars.txt";
|
||||
static char STAR_CACHE_FILE[] = "cachedStars.txt";
|
||||
|
||||
static const bool TESTING_PARTICLE_SYSTEM = true;
|
||||
|
||||
static const int BANDWIDTH_METER_CLICK_MAX_DRAG_LENGTH = 6; // farther dragged clicks are ignored
|
||||
|
||||
const glm::vec3 START_LOCATION(4.f, 0.f, 5.f); // Where one's own node begins in the world
|
||||
|
@ -407,7 +405,7 @@ void Application::paintGL() {
|
|||
|
||||
} else if (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON) {
|
||||
_myCamera.setTightness(0.0f); // In first person, camera follows head exactly without delay
|
||||
_myCamera.setTargetPosition(_myAvatar.getUprightHeadPosition());
|
||||
_myCamera.setTargetPosition(_myAvatar.getUprightEyeLevelPosition());
|
||||
_myCamera.setTargetRotation(_myAvatar.getHead().getCameraOrientation());
|
||||
|
||||
} else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {
|
||||
|
@ -1502,11 +1500,11 @@ bool Application::sendVoxelsOperation(VoxelNode* node, void* extraData) {
|
|||
int usecToSleep = CLIENT_TO_SERVER_VOXEL_SEND_INTERVAL_USECS - elapsed;
|
||||
if (usecToSleep > 0) {
|
||||
qDebug("sendVoxelsOperation: packet: %d bytes:%lld elapsed %lld usecs, sleeping for %d usecs!\n",
|
||||
args->packetsSent, args->bytesSent, elapsed, usecToSleep);
|
||||
args->packetsSent, (long long int)args->bytesSent, (long long int)elapsed, usecToSleep);
|
||||
usleep(usecToSleep);
|
||||
} else {
|
||||
qDebug("sendVoxelsOperation: packet: %d bytes:%lld elapsed %lld usecs, no need to sleep!\n",
|
||||
args->packetsSent, args->bytesSent, elapsed);
|
||||
args->packetsSent, (long long int)args->bytesSent, (long long int)elapsed);
|
||||
}
|
||||
args->lastSendTime = now;
|
||||
}
|
||||
|
@ -1691,7 +1689,7 @@ void Application::pasteVoxels() {
|
|||
controlledBroadcastToNodes(args.messageBuffer, args.bufferInUse, & NODE_TYPE_VOXEL_SERVER, 1);
|
||||
qDebug("sending packet: %d\n", ++args.packetsSent);
|
||||
args.bytesSent += args.bufferInUse;
|
||||
qDebug("total bytes sent: %lld\n", args.bytesSent);
|
||||
qDebug("total bytes sent: %lld\n", (long long int)args.bytesSent);
|
||||
}
|
||||
|
||||
if (calculatedOctCode) {
|
||||
|
@ -1756,6 +1754,8 @@ void Application::initMenu() {
|
|||
_renderLookatOn->setChecked(false);
|
||||
(_renderLookatIndicatorOn = renderMenu->addAction("Lookat Indicator"))->setCheckable(true);
|
||||
_renderLookatIndicatorOn->setChecked(true);
|
||||
(_renderParticleSystemOn = renderMenu->addAction("Particle System"))->setCheckable(true);
|
||||
_renderParticleSystemOn->setChecked(true);
|
||||
(_manualFirstPerson = renderMenu->addAction(
|
||||
"First Person", this, SLOT(setRenderFirstPerson(bool)), Qt::Key_P))->setCheckable(true);
|
||||
(_manualThirdPerson = renderMenu->addAction(
|
||||
|
@ -2265,7 +2265,7 @@ void Application::update(float deltaTime) {
|
|||
_audio.eventuallyAnalyzePing();
|
||||
#endif
|
||||
|
||||
if (TESTING_PARTICLE_SYSTEM) {
|
||||
if (_renderParticleSystemOn->isChecked()) {
|
||||
updateParticleSystem(deltaTime);
|
||||
}
|
||||
}
|
||||
|
@ -2714,7 +2714,6 @@ void Application::displaySide(Camera& whichCamera) {
|
|||
_myAvatar.getHead().setLookAtPosition(_myCamera.getPosition());
|
||||
}
|
||||
_myAvatar.render(_lookingInMirror->isChecked(), _renderAvatarBalls->isChecked());
|
||||
_myAvatar.setDisplayingLookatVectors(_renderLookatOn->isChecked());
|
||||
|
||||
if (_renderLookatIndicatorOn->isChecked() && _isLookingAtOtherAvatar) {
|
||||
renderLookatIndicator(_lookatOtherPosition, whichCamera);
|
||||
|
|
|
@ -267,6 +267,7 @@ private:
|
|||
QAction* _renderFrameTimerOn; // Whether to show onscreen text overlay with stats
|
||||
QAction* _renderLookatOn; // Whether to show lookat vectors from avatar eyes if looking at something
|
||||
QAction* _renderLookatIndicatorOn;
|
||||
QAction* _renderParticleSystemOn;
|
||||
QAction* _manualFirstPerson; // Whether to force first-person mode
|
||||
QAction* _manualThirdPerson; // Whether to force third-person mode
|
||||
QAction* _logOn; // Whether to show on-screen log
|
||||
|
|
|
@ -370,7 +370,11 @@ glm::vec3 Avatar::getUprightHeadPosition() const {
|
|||
return _position + getWorldAlignedOrientation() * glm::vec3(0.0f, _pelvisToHeadLength, 0.0f);
|
||||
}
|
||||
|
||||
|
||||
glm::vec3 Avatar::getUprightEyeLevelPosition() const {
|
||||
const float EYE_UP_OFFSET = 0.36f;
|
||||
glm::vec3 up = getWorldAlignedOrientation() * IDENTITY_UP;
|
||||
return _position + up * _scale * BODY_BALL_RADIUS_HEAD_BASE * EYE_UP_OFFSET + glm::vec3(0.0f, _pelvisToHeadLength, 0.0f);
|
||||
}
|
||||
|
||||
void Avatar::updateThrust(float deltaTime, Transmitter * transmitter) {
|
||||
//
|
||||
|
|
|
@ -171,6 +171,7 @@ public:
|
|||
glm::vec3 getGravity () const { return _gravity; }
|
||||
|
||||
glm::vec3 getUprightHeadPosition() const;
|
||||
glm::vec3 getUprightEyeLevelPosition() const;
|
||||
|
||||
AvatarVoxelSystem* getVoxels() { return &_voxels; }
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ static Closure cmakeBuild(srcDir, instCommand) {
|
|||
installCommand instCommand
|
||||
preloadScript ''
|
||||
cmakeArgs ''
|
||||
projectCmakePath '/usr/bin/cmake'
|
||||
projectCmakePath '/usr/local/bin/cmake'
|
||||
cleanBuild 'false'
|
||||
cleanInstallDir 'false'
|
||||
builderImpl ''
|
||||
|
@ -138,4 +138,4 @@ parameterizedJob.with {
|
|||
(project / publishers / 'hudson.plugins.postbuildtask.PostbuildTask' /
|
||||
tasks / 'hudson.plugins.postbuildtask.TaskProperties' / script).setValue(curlCommand)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ PerfStat::~PerfStat() {
|
|||
}
|
||||
|
||||
if (wantDebugOut) {
|
||||
qDebug("PerfStats: %s elapsed:%f average:%lf count:%ld total:%lf ut:%d us:%d ue:%d t:%ld s:%ld e:%ld\n",
|
||||
qDebug("PerfStats: %s elapsed:%f average:%lf count:%ld total:%lf ut:%ld us:%ld ue:%ld t:%ld s:%ld e:%ld\n",
|
||||
this->group.c_str(),elapsed,average,count,totalTime,
|
||||
(end.tv_usec-start.tv_usec),start.tv_usec,end.tv_usec,
|
||||
(end.tv_sec-start.tv_sec),start.tv_sec,end.tv_sec
|
||||
|
|
|
@ -378,10 +378,10 @@ int VoxelSceneStats::unpackFromMessage(unsigned char* sourceBuffer, int availabl
|
|||
void VoxelSceneStats::printDebugDetails() {
|
||||
qDebug("\n------------------------------\n");
|
||||
qDebug("VoxelSceneStats:\n");
|
||||
qDebug(" start : %llu \n", _start);
|
||||
qDebug(" end : %llu \n", _end);
|
||||
qDebug(" elapsed : %llu \n", _elapsed);
|
||||
qDebug(" encoding : %llu \n", _totalEncodeTime);
|
||||
qDebug(" start : %llu \n", (long long unsigned int)_start);
|
||||
qDebug(" end : %llu \n", (long long unsigned int)_end);
|
||||
qDebug(" elapsed : %llu \n", (long long unsigned int)_elapsed);
|
||||
qDebug(" encoding : %llu \n", (long long unsigned int)_totalEncodeTime);
|
||||
qDebug("\n");
|
||||
qDebug(" full scene: %s\n", debug::valueOf(_isFullScene));
|
||||
qDebug(" moving: %s\n", debug::valueOf(_isMoving));
|
||||
|
@ -457,12 +457,12 @@ char* VoxelSceneStats::getItemValue(int item) {
|
|||
calcAverageFPS = (float)USECS_PER_SECOND / (float)elapsedAverage;
|
||||
|
||||
sprintf(_itemValueBuffer, "%llu usecs (%d fps) Average: %.0f usecs (%d fps)",
|
||||
_elapsed, calcFPS, elapsedAverage, calcAverageFPS);
|
||||
(long long unsigned int)_elapsed, calcFPS, elapsedAverage, calcAverageFPS);
|
||||
break;
|
||||
}
|
||||
case ITEM_ENCODE:
|
||||
calcFPS = (float)USECS_PER_SECOND / (float)_totalEncodeTime;
|
||||
sprintf(_itemValueBuffer, "%llu usecs (%d fps)", _totalEncodeTime, calcFPS);
|
||||
sprintf(_itemValueBuffer, "%llu usecs (%d fps)", (long long unsigned int)_totalEncodeTime, calcFPS);
|
||||
break;
|
||||
case ITEM_PACKETS: {
|
||||
float elapsedSecs = ((float)_elapsed / (float)USECS_PER_SECOND);
|
||||
|
|
Loading…
Reference in a new issue