put avatars and embedded-webserver and entities logging into their own QLoggingCategory

This commit is contained in:
Seth Alves 2015-04-06 16:22:54 -07:00
parent 257d66441a
commit d4461f1ecb
30 changed files with 566 additions and 458 deletions

View file

@ -26,6 +26,7 @@
#include <StreamUtils.h> #include <StreamUtils.h>
#include <UUID.h> #include <UUID.h>
#include "AvatarLogging.h"
#include "AvatarData.h" #include "AvatarData.h"
quint64 DEFAULT_FILTERED_LOG_EXPIRY = 2 * USECS_PER_SECOND; quint64 DEFAULT_FILTERED_LOG_EXPIRY = 2 * USECS_PER_SECOND;
@ -118,7 +119,7 @@ void AvatarData::setClampedTargetScale(float targetScale, bool overideReferentia
targetScale = glm::clamp(targetScale, MIN_AVATAR_SCALE, MAX_AVATAR_SCALE); targetScale = glm::clamp(targetScale, MIN_AVATAR_SCALE, MAX_AVATAR_SCALE);
setTargetScale(targetScale, overideReferential); setTargetScale(targetScale, overideReferential);
qDebug() << "Changed scale to " << _targetScale; qCDebug(avatars) << "Changed scale to " << _targetScale;
} }
glm::vec3 AvatarData::getHandPosition() const { glm::vec3 AvatarData::getHandPosition() const {
@ -304,7 +305,7 @@ int AvatarData::parseDataAtOffset(const QByteArray& packet, int offset) {
int maxAvailableSize = packet.size() - offset; int maxAvailableSize = packet.size() - offset;
if (minPossibleSize > maxAvailableSize) { if (minPossibleSize > maxAvailableSize) {
if (shouldLogError(now)) { if (shouldLogError(now)) {
qDebug() << "Malformed AvatarData packet at the start; " qCDebug(avatars) << "Malformed AvatarData packet at the start; "
<< " displayName = '" << _displayName << "'" << " displayName = '" << _displayName << "'"
<< " minPossibleSize = " << minPossibleSize << " minPossibleSize = " << minPossibleSize
<< " maxAvailableSize = " << maxAvailableSize; << " maxAvailableSize = " << maxAvailableSize;
@ -321,7 +322,7 @@ int AvatarData::parseDataAtOffset(const QByteArray& packet, int offset) {
if (glm::isnan(position.x) || glm::isnan(position.y) || glm::isnan(position.z)) { if (glm::isnan(position.x) || glm::isnan(position.y) || glm::isnan(position.z)) {
if (shouldLogError(now)) { if (shouldLogError(now)) {
qDebug() << "Discard nan AvatarData::position; displayName = '" << _displayName << "'"; qCDebug(avatars) << "Discard nan AvatarData::position; displayName = '" << _displayName << "'";
} }
return maxAvailableSize; return maxAvailableSize;
} }
@ -334,7 +335,7 @@ int AvatarData::parseDataAtOffset(const QByteArray& packet, int offset) {
sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t*) sourceBuffer, &roll); sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t*) sourceBuffer, &roll);
if (glm::isnan(yaw) || glm::isnan(pitch) || glm::isnan(roll)) { if (glm::isnan(yaw) || glm::isnan(pitch) || glm::isnan(roll)) {
if (shouldLogError(now)) { if (shouldLogError(now)) {
qDebug() << "Discard nan AvatarData::yaw,pitch,roll; displayName = '" << _displayName << "'"; qCDebug(avatars) << "Discard nan AvatarData::yaw,pitch,roll; displayName = '" << _displayName << "'";
} }
return maxAvailableSize; return maxAvailableSize;
} }
@ -350,7 +351,7 @@ int AvatarData::parseDataAtOffset(const QByteArray& packet, int offset) {
sourceBuffer += unpackFloatRatioFromTwoByte(sourceBuffer, scale); sourceBuffer += unpackFloatRatioFromTwoByte(sourceBuffer, scale);
if (glm::isnan(scale)) { if (glm::isnan(scale)) {
if (shouldLogError(now)) { if (shouldLogError(now)) {
qDebug() << "Discard nan AvatarData::scale; displayName = '" << _displayName << "'"; qCDebug(avatars) << "Discard nan AvatarData::scale; displayName = '" << _displayName << "'";
} }
return maxAvailableSize; return maxAvailableSize;
} }
@ -365,7 +366,7 @@ int AvatarData::parseDataAtOffset(const QByteArray& packet, int offset) {
sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t*) sourceBuffer, &headRoll); sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t*) sourceBuffer, &headRoll);
if (glm::isnan(headYaw) || glm::isnan(headPitch) || glm::isnan(headRoll)) { if (glm::isnan(headYaw) || glm::isnan(headPitch) || glm::isnan(headRoll)) {
if (shouldLogError(now)) { if (shouldLogError(now)) {
qDebug() << "Discard nan AvatarData::headYaw,headPitch,headRoll; displayName = '" << _displayName << "'"; qCDebug(avatars) << "Discard nan AvatarData::headYaw,headPitch,headRoll; displayName = '" << _displayName << "'";
} }
return maxAvailableSize; return maxAvailableSize;
} }
@ -380,7 +381,7 @@ int AvatarData::parseDataAtOffset(const QByteArray& packet, int offset) {
sourceBuffer += sizeof(lookAt); sourceBuffer += sizeof(lookAt);
if (glm::isnan(lookAt.x) || glm::isnan(lookAt.y) || glm::isnan(lookAt.z)) { if (glm::isnan(lookAt.x) || glm::isnan(lookAt.y) || glm::isnan(lookAt.z)) {
if (shouldLogError(now)) { if (shouldLogError(now)) {
qDebug() << "Discard nan AvatarData::lookAt; displayName = '" << _displayName << "'"; qCDebug(avatars) << "Discard nan AvatarData::lookAt; displayName = '" << _displayName << "'";
} }
return maxAvailableSize; return maxAvailableSize;
} }
@ -394,7 +395,7 @@ int AvatarData::parseDataAtOffset(const QByteArray& packet, int offset) {
sourceBuffer += sizeof(float); sourceBuffer += sizeof(float);
if (glm::isnan(audioLoudness)) { if (glm::isnan(audioLoudness)) {
if (shouldLogError(now)) { if (shouldLogError(now)) {
qDebug() << "Discard nan AvatarData::audioLoudness; displayName = '" << _displayName << "'"; qCDebug(avatars) << "Discard nan AvatarData::audioLoudness; displayName = '" << _displayName << "'";
} }
return maxAvailableSize; return maxAvailableSize;
} }
@ -441,7 +442,7 @@ int AvatarData::parseDataAtOffset(const QByteArray& packet, int offset) {
minPossibleSize++; // one byte for blendDataSize minPossibleSize++; // one byte for blendDataSize
if (minPossibleSize > maxAvailableSize) { if (minPossibleSize > maxAvailableSize) {
if (shouldLogError(now)) { if (shouldLogError(now)) {
qDebug() << "Malformed AvatarData packet after BitItems;" qCDebug(avatars) << "Malformed AvatarData packet after BitItems;"
<< " displayName = '" << _displayName << "'" << " displayName = '" << _displayName << "'"
<< " minPossibleSize = " << minPossibleSize << " minPossibleSize = " << minPossibleSize
<< " maxAvailableSize = " << maxAvailableSize; << " maxAvailableSize = " << maxAvailableSize;
@ -464,7 +465,7 @@ int AvatarData::parseDataAtOffset(const QByteArray& packet, int offset) {
if (glm::isnan(leftEyeBlink) || glm::isnan(rightEyeBlink) if (glm::isnan(leftEyeBlink) || glm::isnan(rightEyeBlink)
|| glm::isnan(averageLoudness) || glm::isnan(browAudioLift)) { || glm::isnan(averageLoudness) || glm::isnan(browAudioLift)) {
if (shouldLogError(now)) { if (shouldLogError(now)) {
qDebug() << "Discard nan AvatarData::faceData; displayName = '" << _displayName << "'"; qCDebug(avatars) << "Discard nan AvatarData::faceData; displayName = '" << _displayName << "'";
} }
return maxAvailableSize; return maxAvailableSize;
} }
@ -478,7 +479,7 @@ int AvatarData::parseDataAtOffset(const QByteArray& packet, int offset) {
minPossibleSize += blendDataSize; minPossibleSize += blendDataSize;
if (minPossibleSize > maxAvailableSize) { if (minPossibleSize > maxAvailableSize) {
if (shouldLogError(now)) { if (shouldLogError(now)) {
qDebug() << "Malformed AvatarData packet after Blendshapes;" qCDebug(avatars) << "Malformed AvatarData packet after Blendshapes;"
<< " displayName = '" << _displayName << "'" << " displayName = '" << _displayName << "'"
<< " minPossibleSize = " << minPossibleSize << " minPossibleSize = " << minPossibleSize
<< " maxAvailableSize = " << maxAvailableSize; << " maxAvailableSize = " << maxAvailableSize;
@ -504,7 +505,7 @@ int AvatarData::parseDataAtOffset(const QByteArray& packet, int offset) {
minPossibleSize += bytesOfValidity; minPossibleSize += bytesOfValidity;
if (minPossibleSize > maxAvailableSize) { if (minPossibleSize > maxAvailableSize) {
if (shouldLogError(now)) { if (shouldLogError(now)) {
qDebug() << "Malformed AvatarData packet after JointValidityBits;" qCDebug(avatars) << "Malformed AvatarData packet after JointValidityBits;"
<< " displayName = '" << _displayName << "'" << " displayName = '" << _displayName << "'"
<< " minPossibleSize = " << minPossibleSize << " minPossibleSize = " << minPossibleSize
<< " maxAvailableSize = " << maxAvailableSize; << " maxAvailableSize = " << maxAvailableSize;
@ -535,7 +536,7 @@ int AvatarData::parseDataAtOffset(const QByteArray& packet, int offset) {
minPossibleSize += numValidJoints * COMPONENTS_PER_QUATERNION * sizeof(uint16_t); minPossibleSize += numValidJoints * COMPONENTS_PER_QUATERNION * sizeof(uint16_t);
if (minPossibleSize > maxAvailableSize) { if (minPossibleSize > maxAvailableSize) {
if (shouldLogError(now)) { if (shouldLogError(now)) {
qDebug() << "Malformed AvatarData packet after JointData;" qCDebug(avatars) << "Malformed AvatarData packet after JointData;"
<< " displayName = '" << _displayName << "'" << " displayName = '" << _displayName << "'"
<< " minPossibleSize = " << minPossibleSize << " minPossibleSize = " << minPossibleSize
<< " maxAvailableSize = " << maxAvailableSize; << " maxAvailableSize = " << maxAvailableSize;
@ -915,13 +916,13 @@ bool AvatarData::hasBillboardChangedAfterParsing(const QByteArray& packet) {
void AvatarData::setFaceModelURL(const QUrl& faceModelURL) { void AvatarData::setFaceModelURL(const QUrl& faceModelURL) {
_faceModelURL = faceModelURL; _faceModelURL = faceModelURL;
qDebug() << "Changing face model for avatar to" << _faceModelURL.toString(); qCDebug(avatars) << "Changing face model for avatar to" << _faceModelURL.toString();
} }
void AvatarData::setSkeletonModelURL(const QUrl& skeletonModelURL) { void AvatarData::setSkeletonModelURL(const QUrl& skeletonModelURL) {
_skeletonModelURL = skeletonModelURL.isEmpty() ? DEFAULT_BODY_MODEL_URL : skeletonModelURL; _skeletonModelURL = skeletonModelURL.isEmpty() ? DEFAULT_BODY_MODEL_URL : skeletonModelURL;
qDebug() << "Changing skeleton model for avatar to" << _skeletonModelURL.toString(); qCDebug(avatars) << "Changing skeleton model for avatar to" << _skeletonModelURL.toString();
updateJointMappings(); updateJointMappings();
} }
@ -929,7 +930,7 @@ void AvatarData::setSkeletonModelURL(const QUrl& skeletonModelURL) {
void AvatarData::setDisplayName(const QString& displayName) { void AvatarData::setDisplayName(const QString& displayName) {
_displayName = displayName; _displayName = displayName;
qDebug() << "Changing display name for avatar to" << displayName; qCDebug(avatars) << "Changing display name for avatar to" << displayName;
} }
QVector<AttachmentData> AvatarData::getAttachmentData() const { QVector<AttachmentData> AvatarData::getAttachmentData() const {
@ -1010,14 +1011,14 @@ void AvatarData::detachAll(const QString& modelURL, const QString& jointName) {
void AvatarData::setBillboard(const QByteArray& billboard) { void AvatarData::setBillboard(const QByteArray& billboard) {
_billboard = billboard; _billboard = billboard;
qDebug() << "Changing billboard for avatar."; qCDebug(avatars) << "Changing billboard for avatar.";
} }
void AvatarData::setBillboardFromURL(const QString &billboardURL) { void AvatarData::setBillboardFromURL(const QString &billboardURL) {
_billboardURL = billboardURL; _billboardURL = billboardURL;
qDebug() << "Changing billboard for avatar to PNG at" << qPrintable(billboardURL); qCDebug(avatars) << "Changing billboard for avatar to PNG at" << qPrintable(billboardURL);
QNetworkRequest billboardRequest; QNetworkRequest billboardRequest;
billboardRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT); billboardRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT);

View file

@ -12,6 +12,7 @@
#include <NodeList.h> #include <NodeList.h>
#include <PacketHeaders.h> #include <PacketHeaders.h>
#include "AvatarLogging.h"
#include "AvatarHashMap.h" #include "AvatarHashMap.h"
AvatarHashMap::AvatarHashMap() { AvatarHashMap::AvatarHashMap() {
@ -20,7 +21,7 @@ AvatarHashMap::AvatarHashMap() {
AvatarHash::iterator AvatarHashMap::erase(const AvatarHash::iterator& iterator) { AvatarHash::iterator AvatarHashMap::erase(const AvatarHash::iterator& iterator) {
qDebug() << "Removing Avatar with UUID" << iterator.key() << "from AvatarHashMap."; qCDebug(avatars) << "Removing Avatar with UUID" << iterator.key() << "from AvatarHashMap.";
return _avatarHash.erase(iterator); return _avatarHash.erase(iterator);
} }
@ -84,7 +85,7 @@ AvatarSharedPointer AvatarHashMap::matchingOrNewAvatar(const QUuid& sessionUUID,
// insert the new avatar into our hash // insert the new avatar into our hash
matchingAvatar = newSharedAvatar(); matchingAvatar = newSharedAvatar();
qDebug() << "Adding avatar with sessionUUID " << sessionUUID << "to AvatarHashMap."; qCDebug(avatars) << "Adding avatar with sessionUUID " << sessionUUID << "to AvatarHashMap.";
matchingAvatar->setSessionUUID(sessionUUID); matchingAvatar->setSessionUUID(sessionUUID);
matchingAvatar->setOwningAvatarMixer(mixerWeakPointer); matchingAvatar->setOwningAvatarMixer(mixerWeakPointer);
@ -180,4 +181,4 @@ void AvatarHashMap::processKillAvatar(const QByteArray& datagram) {
void AvatarHashMap::sessionUUIDChanged(const QUuid& sessionUUID, const QUuid& oldUUID) { void AvatarHashMap::sessionUUIDChanged(const QUuid& sessionUUID, const QUuid& oldUUID) {
_lastOwnerSessionUUID = oldUUID; _lastOwnerSessionUUID = oldUUID;
} }

View file

@ -0,0 +1,14 @@
//
// AvatarLogging.cpp
// libraries/avatars/src
//
// Created by Seth Alves on 4/6/15.
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "AvatarLogging.h"
Q_LOGGING_CATEGORY(avatars, "hifi.avatars")

View file

@ -0,0 +1,14 @@
//
// AvatarLogging.h
// libraries/avatars/src
//
// Created by Seth Alves on 4/6/15.
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(avatars)

View file

@ -15,6 +15,7 @@
#include <StreamUtils.h> #include <StreamUtils.h>
#include "AvatarData.h" #include "AvatarData.h"
#include "AvatarLogging.h"
#include "Player.h" #include "Player.h"
static const int INVALID_FRAME = -1; static const int INVALID_FRAME = -1;
@ -90,35 +91,35 @@ void Player::startPlaying() {
bool wantDebug = false; bool wantDebug = false;
if (wantDebug) { if (wantDebug) {
qDebug() << "Player::startPlaying(): Recording Context"; qCDebug(avatars) << "Player::startPlaying(): Recording Context";
qDebug() << "Domain:" << _currentContext.domain; qCDebug(avatars) << "Domain:" << _currentContext.domain;
qDebug() << "Position:" << _currentContext.position; qCDebug(avatars) << "Position:" << _currentContext.position;
qDebug() << "Orientation:" << _currentContext.orientation; qCDebug(avatars) << "Orientation:" << _currentContext.orientation;
qDebug() << "Scale:" << _currentContext.scale; qCDebug(avatars) << "Scale:" << _currentContext.scale;
qDebug() << "Head URL:" << _currentContext.headModel; qCDebug(avatars) << "Head URL:" << _currentContext.headModel;
qDebug() << "Skeleton URL:" << _currentContext.skeletonModel; qCDebug(avatars) << "Skeleton URL:" << _currentContext.skeletonModel;
qDebug() << "Display Name:" << _currentContext.displayName; qCDebug(avatars) << "Display Name:" << _currentContext.displayName;
qDebug() << "Num Attachments:" << _currentContext.attachments.size(); qCDebug(avatars) << "Num Attachments:" << _currentContext.attachments.size();
for (int i = 0; i < _currentContext.attachments.size(); ++i) { for (int i = 0; i < _currentContext.attachments.size(); ++i) {
qDebug() << "Model URL:" << _currentContext.attachments[i].modelURL; qCDebug(avatars) << "Model URL:" << _currentContext.attachments[i].modelURL;
qDebug() << "Joint Name:" << _currentContext.attachments[i].jointName; qCDebug(avatars) << "Joint Name:" << _currentContext.attachments[i].jointName;
qDebug() << "Translation:" << _currentContext.attachments[i].translation; qCDebug(avatars) << "Translation:" << _currentContext.attachments[i].translation;
qDebug() << "Rotation:" << _currentContext.attachments[i].rotation; qCDebug(avatars) << "Rotation:" << _currentContext.attachments[i].rotation;
qDebug() << "Scale:" << _currentContext.attachments[i].scale; qCDebug(avatars) << "Scale:" << _currentContext.attachments[i].scale;
} }
} }
// Fake faceshift connection // Fake faceshift connection
_avatar->setForceFaceTrackerConnected(true); _avatar->setForceFaceTrackerConnected(true);
qDebug() << "Recorder::startPlaying()"; qCDebug(avatars) << "Recorder::startPlaying()";
setupAudioThread(); setupAudioThread();
_currentFrame = 0; _currentFrame = 0;
_timerOffset = 0; _timerOffset = 0;
_timer.start(); _timer.start();
} else { } else {
qDebug() << "Recorder::startPlaying(): Unpause"; qCDebug(avatars) << "Recorder::startPlaying(): Unpause";
setupAudioThread(); setupAudioThread();
_timer.start(); _timer.start();
@ -152,7 +153,7 @@ void Player::stopPlaying() {
_avatar->setSkeletonModelURL(_currentContext.skeletonModel); _avatar->setSkeletonModelURL(_currentContext.skeletonModel);
} }
qDebug() << "Recorder::stopPlaying()"; qCDebug(avatars) << "Recorder::stopPlaying()";
} }
void Player::pausePlayer() { void Player::pausePlayer() {
@ -161,7 +162,7 @@ void Player::pausePlayer() {
cleanupAudioThread(); cleanupAudioThread();
_pausedFrame = _currentFrame; _pausedFrame = _currentFrame;
qDebug() << "Recorder::pausePlayer()"; qCDebug(avatars) << "Recorder::pausePlayer()";
} }
void Player::setupAudioThread() { void Player::setupAudioThread() {
@ -292,7 +293,7 @@ void Player::play() {
_frameInterpolationFactor); _frameInterpolationFactor);
head->setLookAtPosition(context->position + context->orientation * lookAt); head->setLookAtPosition(context->position + context->orientation * lookAt);
} else { } else {
qDebug() << "WARNING: Player couldn't find head data."; qCDebug(avatars) << "WARNING: Player couldn't find head data.";
} }
_options.position = _avatar->getPosition(); _options.position = _avatar->getPosition();
@ -359,7 +360,7 @@ void Player::setVolume(float volume) {
if (_injector) { if (_injector) {
_injector->setOptions(_options); _injector->setOptions(_options);
} }
qDebug() << "New volume: " << volume; qCDebug(avatars) << "New volume: " << volume;
} }
void Player::setAudioOffset(int audioOffset) { void Player::setAudioOffset(int audioOffset) {
@ -410,7 +411,7 @@ bool Player::computeCurrentFrame() {
if (_frameInterpolationFactor < 0.0f || _frameInterpolationFactor > 1.0f) { if (_frameInterpolationFactor < 0.0f || _frameInterpolationFactor > 1.0f) {
_frameInterpolationFactor = 0.0f; _frameInterpolationFactor = 0.0f;
qDebug() << "Invalid frame interpolation value: overriding"; qCDebug(avatars) << "Invalid frame interpolation value: overriding";
} }
return true; return true;
} }

View file

@ -15,6 +15,7 @@
#include <StreamUtils.h> #include <StreamUtils.h>
#include "AvatarData.h" #include "AvatarData.h"
#include "AvatarLogging.h"
#include "Recorder.h" #include "Recorder.h"
Recorder::Recorder(AvatarData* avatar) : Recorder::Recorder(AvatarData* avatar) :
@ -37,7 +38,7 @@ qint64 Recorder::elapsed() const {
} }
void Recorder::startRecording() { void Recorder::startRecording() {
qDebug() << "Recorder::startRecording()"; qCDebug(avatars) << "Recorder::startRecording()";
_recording->clear(); _recording->clear();
RecordingContext& context = _recording->getContext(); RecordingContext& context = _recording->getContext();
@ -55,23 +56,23 @@ void Recorder::startRecording() {
bool wantDebug = false; bool wantDebug = false;
if (wantDebug) { if (wantDebug) {
qDebug() << "Recorder::startRecording(): Recording Context"; qCDebug(avatars) << "Recorder::startRecording(): Recording Context";
qDebug() << "Global timestamp:" << context.globalTimestamp; qCDebug(avatars) << "Global timestamp:" << context.globalTimestamp;
qDebug() << "Domain:" << context.domain; qCDebug(avatars) << "Domain:" << context.domain;
qDebug() << "Position:" << context.position; qCDebug(avatars) << "Position:" << context.position;
qDebug() << "Orientation:" << context.orientation; qCDebug(avatars) << "Orientation:" << context.orientation;
qDebug() << "Scale:" << context.scale; qCDebug(avatars) << "Scale:" << context.scale;
qDebug() << "Head URL:" << context.headModel; qCDebug(avatars) << "Head URL:" << context.headModel;
qDebug() << "Skeleton URL:" << context.skeletonModel; qCDebug(avatars) << "Skeleton URL:" << context.skeletonModel;
qDebug() << "Display Name:" << context.displayName; qCDebug(avatars) << "Display Name:" << context.displayName;
qDebug() << "Num Attachments:" << context.attachments.size(); qCDebug(avatars) << "Num Attachments:" << context.attachments.size();
for (int i = 0; i < context.attachments.size(); ++i) { for (int i = 0; i < context.attachments.size(); ++i) {
qDebug() << "Model URL:" << context.attachments[i].modelURL; qCDebug(avatars) << "Model URL:" << context.attachments[i].modelURL;
qDebug() << "Joint Name:" << context.attachments[i].jointName; qCDebug(avatars) << "Joint Name:" << context.attachments[i].jointName;
qDebug() << "Translation:" << context.attachments[i].translation; qCDebug(avatars) << "Translation:" << context.attachments[i].translation;
qDebug() << "Rotation:" << context.attachments[i].rotation; qCDebug(avatars) << "Rotation:" << context.attachments[i].rotation;
qDebug() << "Scale:" << context.attachments[i].scale; qCDebug(avatars) << "Scale:" << context.attachments[i].scale;
} }
} }
@ -80,15 +81,15 @@ void Recorder::startRecording() {
} }
void Recorder::stopRecording() { void Recorder::stopRecording() {
qDebug() << "Recorder::stopRecording()"; qCDebug(avatars) << "Recorder::stopRecording()";
_timer.invalidate(); _timer.invalidate();
qDebug().nospace() << "Recorded " << _recording->getFrameNumber() << " during " << _recording->getLength() << " msec (" << _recording->getFrameNumber() / (_recording->getLength() / 1000.0f) << " fps)"; qCDebug(avatars).nospace() << "Recorded " << _recording->getFrameNumber() << " during " << _recording->getLength() << " msec (" << _recording->getFrameNumber() / (_recording->getLength() / 1000.0f) << " fps)";
} }
void Recorder::saveToFile(const QString& file) { void Recorder::saveToFile(const QString& file) {
if (_recording->isEmpty()) { if (_recording->isEmpty()) {
qDebug() << "Cannot save recording to file, recording is empty."; qCDebug(avatars) << "Cannot save recording to file, recording is empty.";
} }
writeRecordingToFile(_recording, file); writeRecordingToFile(_recording, file);
@ -120,16 +121,16 @@ void Recorder::record() {
bool wantDebug = false; bool wantDebug = false;
if (wantDebug) { if (wantDebug) {
qDebug() << "Recording frame #" << _recording->getFrameNumber(); qCDebug(avatars) << "Recording frame #" << _recording->getFrameNumber();
qDebug() << "Blendshapes:" << frame.getBlendshapeCoefficients().size(); qCDebug(avatars) << "Blendshapes:" << frame.getBlendshapeCoefficients().size();
qDebug() << "JointRotations:" << frame.getJointRotations().size(); qCDebug(avatars) << "JointRotations:" << frame.getJointRotations().size();
qDebug() << "Translation:" << frame.getTranslation(); qCDebug(avatars) << "Translation:" << frame.getTranslation();
qDebug() << "Rotation:" << frame.getRotation(); qCDebug(avatars) << "Rotation:" << frame.getRotation();
qDebug() << "Scale:" << frame.getScale(); qCDebug(avatars) << "Scale:" << frame.getScale();
qDebug() << "Head rotation:" << frame.getHeadRotation(); qCDebug(avatars) << "Head rotation:" << frame.getHeadRotation();
qDebug() << "Lean Forward:" << frame.getLeanForward(); qCDebug(avatars) << "Lean Forward:" << frame.getLeanForward();
qDebug() << "Lean Sideways:" << frame.getLeanSideways(); qCDebug(avatars) << "Lean Sideways:" << frame.getLeanSideways();
qDebug() << "LookAtPosition:" << frame.getLookAtPosition(); qCDebug(avatars) << "LookAtPosition:" << frame.getLookAtPosition();
} }
_recording->addFrame(_timer.elapsed(), frame); _recording->addFrame(_timer.elapsed(), frame);

View file

@ -24,6 +24,7 @@
#include <QPair> #include <QPair>
#include "AvatarData.h" #include "AvatarData.h"
#include "AvatarLogging.h"
#include "Recording.h" #include "Recording.h"
// HFR file format magic number (Inspired by PNG) // HFR file format magic number (Inspired by PNG)
@ -128,18 +129,18 @@ bool readFloat(QDataStream& stream, float& value, int radix) {
void writeRecordingToFile(RecordingPointer recording, const QString& filename) { void writeRecordingToFile(RecordingPointer recording, const QString& filename) {
if (!recording || recording->getFrameNumber() < 1) { if (!recording || recording->getFrameNumber() < 1) {
qDebug() << "Can't save empty recording"; qCDebug(avatars) << "Can't save empty recording";
return; return;
} }
QElapsedTimer timer; QElapsedTimer timer;
QFile file(filename); QFile file(filename);
if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate)){ if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate)){
qDebug() << "Couldn't open " << filename; qCDebug(avatars) << "Couldn't open " << filename;
return; return;
} }
timer.start(); timer.start();
qDebug() << "Writing recording to " << filename << "."; qCDebug(avatars) << "Writing recording to " << filename << ".";
QDataStream fileStream(&file); QDataStream fileStream(&file);
@ -333,38 +334,38 @@ void writeRecordingToFile(RecordingPointer recording, const QString& filename) {
bool wantDebug = true; bool wantDebug = true;
if (wantDebug) { if (wantDebug) {
qDebug() << "[DEBUG] WRITE recording"; qCDebug(avatars) << "[DEBUG] WRITE recording";
qDebug() << "Header:"; qCDebug(avatars) << "Header:";
qDebug() << "File Format version:" << VERSION; qCDebug(avatars) << "File Format version:" << VERSION;
qDebug() << "Data length:" << dataLength; qCDebug(avatars) << "Data length:" << dataLength;
qDebug() << "Data offset:" << dataOffset; qCDebug(avatars) << "Data offset:" << dataOffset;
qDebug() << "CRC-16:" << crc16; qCDebug(avatars) << "CRC-16:" << crc16;
qDebug() << "Context block:"; qCDebug(avatars) << "Context block:";
qDebug() << "Global timestamp:" << context.globalTimestamp; qCDebug(avatars) << "Global timestamp:" << context.globalTimestamp;
qDebug() << "Domain:" << context.domain; qCDebug(avatars) << "Domain:" << context.domain;
qDebug() << "Position:" << context.position; qCDebug(avatars) << "Position:" << context.position;
qDebug() << "Orientation:" << context.orientation; qCDebug(avatars) << "Orientation:" << context.orientation;
qDebug() << "Scale:" << context.scale; qCDebug(avatars) << "Scale:" << context.scale;
qDebug() << "Head Model:" << context.headModel; qCDebug(avatars) << "Head Model:" << context.headModel;
qDebug() << "Skeleton Model:" << context.skeletonModel; qCDebug(avatars) << "Skeleton Model:" << context.skeletonModel;
qDebug() << "Display Name:" << context.displayName; qCDebug(avatars) << "Display Name:" << context.displayName;
qDebug() << "Num Attachments:" << context.attachments.size(); qCDebug(avatars) << "Num Attachments:" << context.attachments.size();
for (int i = 0; i < context.attachments.size(); ++i) { for (int i = 0; i < context.attachments.size(); ++i) {
qDebug() << "Model URL:" << context.attachments[i].modelURL; qCDebug(avatars) << "Model URL:" << context.attachments[i].modelURL;
qDebug() << "Joint Name:" << context.attachments[i].jointName; qCDebug(avatars) << "Joint Name:" << context.attachments[i].jointName;
qDebug() << "Translation:" << context.attachments[i].translation; qCDebug(avatars) << "Translation:" << context.attachments[i].translation;
qDebug() << "Rotation:" << context.attachments[i].rotation; qCDebug(avatars) << "Rotation:" << context.attachments[i].rotation;
qDebug() << "Scale:" << context.attachments[i].scale; qCDebug(avatars) << "Scale:" << context.attachments[i].scale;
} }
qDebug() << "Recording:"; qCDebug(avatars) << "Recording:";
qDebug() << "Total frames:" << recording->getFrameNumber(); qCDebug(avatars) << "Total frames:" << recording->getFrameNumber();
qDebug() << "Audio array:" << recording->getAudioData().size(); qCDebug(avatars) << "Audio array:" << recording->getAudioData().size();
} }
qint64 checksumTime = timer.elapsed(); qint64 checksumTime = timer.elapsed();
qDebug() << "Wrote" << file.size() << "bytes in" << writingTime + checksumTime << "ms. (" << checksumTime << "ms for checksum)"; qCDebug(avatars) << "Wrote" << file.size() << "bytes in" << writingTime + checksumTime << "ms. (" << checksumTime << "ms for checksum)";
} }
RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString& filename) { RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString& filename) {
@ -377,7 +378,7 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString
// Return if data unavailable // Return if data unavailable
if (url.scheme() == "http" || url.scheme() == "https" || url.scheme() == "ftp") { if (url.scheme() == "http" || url.scheme() == "https" || url.scheme() == "ftp") {
// Download file if necessary // Download file if necessary
qDebug() << "Downloading recording at" << url; qCDebug(avatars) << "Downloading recording at" << url;
QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance(); QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
QNetworkRequest networkRequest = QNetworkRequest(url); QNetworkRequest networkRequest = QNetworkRequest(url);
networkRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT); networkRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT);
@ -386,20 +387,20 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit())); QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec(); // wait for file loop.exec(); // wait for file
if (reply->error() != QNetworkReply::NoError) { if (reply->error() != QNetworkReply::NoError) {
qDebug() << "Error while downloading recording: " << reply->error(); qCDebug(avatars) << "Error while downloading recording: " << reply->error();
reply->deleteLater(); reply->deleteLater();
return recording; return recording;
} }
byteArray = reply->readAll(); byteArray = reply->readAll();
reply->deleteLater(); reply->deleteLater();
// print debug + restart timer // print debug + restart timer
qDebug() << "Downloaded " << byteArray.size() << " bytes in " << timer.restart() << " ms."; qCDebug(avatars) << "Downloaded " << byteArray.size() << " bytes in " << timer.restart() << " ms.";
} else { } else {
// If local file, just read it. // If local file, just read it.
qDebug() << "Reading recording from " << filename << "."; qCDebug(avatars) << "Reading recording from " << filename << ".";
QFile file(filename); QFile file(filename);
if (!file.open(QIODevice::ReadOnly)){ if (!file.open(QIODevice::ReadOnly)){
qDebug() << "Could not open local file: " << url; qCDebug(avatars) << "Could not open local file: " << url;
return recording; return recording;
} }
byteArray = file.readAll(); byteArray = file.readAll();
@ -407,11 +408,11 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString
} }
if (filename.endsWith(".rec") || filename.endsWith(".REC")) { if (filename.endsWith(".rec") || filename.endsWith(".REC")) {
qDebug() << "Old .rec format"; qCDebug(avatars) << "Old .rec format";
readRecordingFromRecFile(recording, filename, byteArray); readRecordingFromRecFile(recording, filename, byteArray);
return recording; return recording;
} else if (!filename.endsWith(".hfr") && !filename.endsWith(".HFR")) { } else if (!filename.endsWith(".hfr") && !filename.endsWith(".HFR")) {
qDebug() << "File extension not recognized"; qCDebug(avatars) << "File extension not recognized";
} }
// Reset the recording passed in the arguments // Reset the recording passed in the arguments
@ -424,7 +425,7 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString
// HEADER // HEADER
QByteArray magicNumber(MAGIC_NUMBER, MAGIC_NUMBER_SIZE); QByteArray magicNumber(MAGIC_NUMBER, MAGIC_NUMBER_SIZE);
if (!byteArray.startsWith(magicNumber)) { if (!byteArray.startsWith(magicNumber)) {
qDebug() << "ERROR: This is not a .HFR file. (Magic Number incorrect)"; qCDebug(avatars) << "ERROR: This is not a .HFR file. (Magic Number incorrect)";
return recording; return recording;
} }
fileStream.skipRawData(MAGIC_NUMBER_SIZE); fileStream.skipRawData(MAGIC_NUMBER_SIZE);
@ -432,7 +433,7 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString
QPair<quint8, quint8> version; QPair<quint8, quint8> version;
fileStream >> version; // File format version fileStream >> version; // File format version
if (version != VERSION && version != QPair<quint8, quint8>(0,1)) { if (version != VERSION && version != QPair<quint8, quint8>(0,1)) {
qDebug() << "ERROR: This file format version is not supported."; qCDebug(avatars) << "ERROR: This file format version is not supported.";
return recording; return recording;
} }
@ -447,7 +448,7 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString
// Check checksum // Check checksum
quint16 computedCRC16 = qChecksum(byteArray.constData() + dataOffset, dataLength); quint16 computedCRC16 = qChecksum(byteArray.constData() + dataOffset, dataLength);
if (computedCRC16 != crc16) { if (computedCRC16 != crc16) {
qDebug() << "Checksum does not match. Bailling!"; qCDebug(avatars) << "Checksum does not match. Bailling!";
recording.clear(); recording.clear();
return recording; return recording;
} }
@ -465,13 +466,13 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString
fileStream >> context.domain; fileStream >> context.domain;
// Position // Position
if (!readVec3(fileStream, context.position)) { if (!readVec3(fileStream, context.position)) {
qDebug() << "Couldn't read file correctly. (Invalid vec3)"; qCDebug(avatars) << "Couldn't read file correctly. (Invalid vec3)";
recording.clear(); recording.clear();
return recording; return recording;
} }
// Orientation // Orientation
if (!readQuat(fileStream, context.orientation)) { if (!readQuat(fileStream, context.orientation)) {
qDebug() << "Couldn't read file correctly. (Invalid quat)"; qCDebug(avatars) << "Couldn't read file correctly. (Invalid quat)";
recording.clear(); recording.clear();
return recording; return recording;
} }
@ -502,12 +503,12 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString
fileStream >> data.jointName; fileStream >> data.jointName;
// Translation // Translation
if (!readVec3(fileStream, data.translation)) { if (!readVec3(fileStream, data.translation)) {
qDebug() << "Couldn't read attachment correctly. (Invalid vec3)"; qCDebug(avatars) << "Couldn't read attachment correctly. (Invalid vec3)";
continue; continue;
} }
// Rotation // Rotation
if (!readQuat(fileStream, data.rotation)) { if (!readQuat(fileStream, data.rotation)) {
qDebug() << "Couldn't read attachment correctly. (Invalid quat)"; qCDebug(avatars) << "Couldn't read attachment correctly. (Invalid quat)";
continue; continue;
} }
@ -610,38 +611,38 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString
bool wantDebug = true; bool wantDebug = true;
if (wantDebug) { if (wantDebug) {
qDebug() << "[DEBUG] READ recording"; qCDebug(avatars) << "[DEBUG] READ recording";
qDebug() << "Header:"; qCDebug(avatars) << "Header:";
qDebug() << "File Format version:" << VERSION; qCDebug(avatars) << "File Format version:" << VERSION;
qDebug() << "Data length:" << dataLength; qCDebug(avatars) << "Data length:" << dataLength;
qDebug() << "Data offset:" << dataOffset; qCDebug(avatars) << "Data offset:" << dataOffset;
qDebug() << "CRC-16:" << crc16; qCDebug(avatars) << "CRC-16:" << crc16;
qDebug() << "Context block:"; qCDebug(avatars) << "Context block:";
qDebug() << "Global timestamp:" << context.globalTimestamp; qCDebug(avatars) << "Global timestamp:" << context.globalTimestamp;
qDebug() << "Domain:" << context.domain; qCDebug(avatars) << "Domain:" << context.domain;
qDebug() << "Position:" << context.position; qCDebug(avatars) << "Position:" << context.position;
qDebug() << "Orientation:" << context.orientation; qCDebug(avatars) << "Orientation:" << context.orientation;
qDebug() << "Scale:" << context.scale; qCDebug(avatars) << "Scale:" << context.scale;
qDebug() << "Head Model:" << context.headModel; qCDebug(avatars) << "Head Model:" << context.headModel;
qDebug() << "Skeleton Model:" << context.skeletonModel; qCDebug(avatars) << "Skeleton Model:" << context.skeletonModel;
qDebug() << "Display Name:" << context.displayName; qCDebug(avatars) << "Display Name:" << context.displayName;
qDebug() << "Num Attachments:" << numAttachments; qCDebug(avatars) << "Num Attachments:" << numAttachments;
for (int i = 0; i < numAttachments; ++i) { for (int i = 0; i < numAttachments; ++i) {
qDebug() << "Model URL:" << context.attachments[i].modelURL; qCDebug(avatars) << "Model URL:" << context.attachments[i].modelURL;
qDebug() << "Joint Name:" << context.attachments[i].jointName; qCDebug(avatars) << "Joint Name:" << context.attachments[i].jointName;
qDebug() << "Translation:" << context.attachments[i].translation; qCDebug(avatars) << "Translation:" << context.attachments[i].translation;
qDebug() << "Rotation:" << context.attachments[i].rotation; qCDebug(avatars) << "Rotation:" << context.attachments[i].rotation;
qDebug() << "Scale:" << context.attachments[i].scale; qCDebug(avatars) << "Scale:" << context.attachments[i].scale;
} }
qDebug() << "Recording:"; qCDebug(avatars) << "Recording:";
qDebug() << "Total frames:" << recording->getFrameNumber(); qCDebug(avatars) << "Total frames:" << recording->getFrameNumber();
qDebug() << "Audio array:" << recording->getAudioData().size(); qCDebug(avatars) << "Audio array:" << recording->getAudioData().size();
} }
qDebug() << "Read " << byteArray.size() << " bytes in " << timer.elapsed() << " ms."; qCDebug(avatars) << "Read " << byteArray.size() << " bytes in " << timer.elapsed() << " ms.";
return recording; return recording;
} }
@ -787,7 +788,7 @@ RecordingPointer readRecordingFromRecFile(RecordingPointer recording, const QStr
recording->addAudioPacket(audioArray); recording->addAudioPacket(audioArray);
qDebug() << "Read " << byteArray.size() << " bytes in " << timer.elapsed() << " ms."; qCDebug(avatars) << "Read " << byteArray.size() << " bytes in " << timer.elapsed() << " ms.";
// Set new filename // Set new filename
QString newFilename = filename; QString newFilename = filename;
@ -802,6 +803,6 @@ RecordingPointer readRecordingFromRecFile(RecordingPointer recording, const QStr
// Set recording to new format // Set recording to new format
writeRecordingToFile(recording, newFilename); writeRecordingToFile(recording, newFilename);
qDebug() << "Recording has been successfully converted at" << newFilename; qCDebug(avatars) << "Recording has been successfully converted at" << newFilename;
return recording; return recording;
} }

View file

@ -12,6 +12,7 @@
#include <GLMHelpers.h> #include <GLMHelpers.h>
#include "AvatarData.h" #include "AvatarData.h"
#include "AvatarLogging.h"
#include "Referential.h" #include "Referential.h"
Referential::Referential(Type type, AvatarData* avatar) : Referential::Referential(Type type, AvatarData* avatar) :
@ -62,7 +63,7 @@ int Referential::unpackReferential(const unsigned char* sourceBuffer) {
_isValid = (bytesRead == expectedSize); _isValid = (bytesRead == expectedSize);
if (!_isValid) { if (!_isValid) {
// Will occur if the new instance unpacking is of the wrong type // Will occur if the new instance unpacking is of the wrong type
qDebug() << "[ERROR] Referential extra data overflow"; qCDebug(avatars) << "[ERROR] Referential extra data overflow";
} }
sourceBuffer += expectedSize; sourceBuffer += expectedSize;
return sourceBuffer - startPosition; return sourceBuffer - startPosition;

View file

@ -0,0 +1,14 @@
//
// EmbeddedWebserverLogging.cpp
// libraries/embedded-webserver/src
//
// Created by Seth Alves on 4/6/15.
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "EmbeddedWebserverLogging.h"
Q_LOGGING_CATEGORY(embeddedwebserver, "hifi.embeddedwebserver")

View file

@ -0,0 +1,14 @@
//
// EmbeddedWebserverLogging.h
// libraries/embedded-webserver/src
//
// Created by Seth Alves on 4/6/15.
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(embeddedwebserver)

View file

@ -15,6 +15,7 @@
#include <QTcpSocket> #include <QTcpSocket>
#include "HTTPConnection.h" #include "HTTPConnection.h"
#include "EmbeddedWebserverLogging.h"
#include "HTTPManager.h" #include "HTTPManager.h"
const char* HTTPConnection::StatusCode200 = "200 OK"; const char* HTTPConnection::StatusCode200 = "200 OK";
@ -45,7 +46,7 @@ HTTPConnection::~HTTPConnection() {
// log the destruction // log the destruction
if (_socket->error() != QAbstractSocket::UnknownSocketError if (_socket->error() != QAbstractSocket::UnknownSocketError
&& _socket->error() != QAbstractSocket::RemoteHostClosedError) { && _socket->error() != QAbstractSocket::RemoteHostClosedError) {
qDebug() << _socket->errorString() << "-" << _socket->error(); qCDebug(embeddedwebserver) << _socket->errorString() << "-" << _socket->error();
} }
} }

View file

@ -16,6 +16,7 @@
#include <QtNetwork/QTcpSocket> #include <QtNetwork/QTcpSocket>
#include "HTTPConnection.h" #include "HTTPConnection.h"
#include "EmbeddedWebserverLogging.h"
#include "HTTPManager.h" #include "HTTPManager.h"
HTTPManager::HTTPManager(quint16 port, const QString& documentRoot, HTTPRequestHandler* requestHandler, QObject* parent) : HTTPManager::HTTPManager(quint16 port, const QString& documentRoot, HTTPRequestHandler* requestHandler, QObject* parent) :
@ -25,7 +26,7 @@ HTTPManager::HTTPManager(quint16 port, const QString& documentRoot, HTTPRequestH
{ {
// start listening on the passed port // start listening on the passed port
if (!listen(QHostAddress("0.0.0.0"), port)) { if (!listen(QHostAddress("0.0.0.0"), port)) {
qDebug() << "Failed to open HTTP server socket:" << errorString(); qCDebug(embeddedwebserver) << "Failed to open HTTP server socket:" << errorString();
return; return;
} }
} }
@ -127,7 +128,7 @@ bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QUrl& url,
replacementString = QString(includedFile.readAll()); replacementString = QString(includedFile.readAll());
} else { } else {
qDebug() << "SSI include directive referenced a missing file:" << includeFilePath; qCDebug(embeddedwebserver) << "SSI include directive referenced a missing file:" << includeFilePath;
} }
// replace the match with the contents of the file, or an empty string if the file was not found // replace the match with the contents of the file, or an empty string if the file was not found
@ -155,4 +156,4 @@ bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QUrl& url,
bool HTTPManager::requestHandledByRequestHandler(HTTPConnection* connection, const QUrl& url) { bool HTTPManager::requestHandledByRequestHandler(HTTPConnection* connection, const QUrl& url) {
return _requestHandler && _requestHandler->handleHTTPRequest(connection, url); return _requestHandler && _requestHandler->handleHTTPRequest(connection, url);
} }

View file

@ -9,6 +9,7 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
// //
#include "EmbeddedWebserverLogging.h"
#include "HTTPSConnection.h" #include "HTTPSConnection.h"
HTTPSConnection::HTTPSConnection(QSslSocket* sslSocket, HTTPSManager* parentManager) : HTTPSConnection::HTTPSConnection(QSslSocket* sslSocket, HTTPSManager* parentManager) :
@ -19,5 +20,5 @@ HTTPSConnection::HTTPSConnection(QSslSocket* sslSocket, HTTPSManager* parentMana
} }
void HTTPSConnection::handleSSLErrors(const QList<QSslError>& errors) { void HTTPSConnection::handleSSLErrors(const QList<QSslError>& errors) {
qDebug() << "SSL errors:" << errors; qCDebug(embeddedwebserver) << "SSL errors:" << errors;
} }

View file

@ -16,6 +16,7 @@
#include "BoxEntityItem.h" #include "BoxEntityItem.h"
#include "EntityTree.h" #include "EntityTree.h"
#include "EntitiesLogging.h"
#include "EntityTreeElement.h" #include "EntityTreeElement.h"
@ -55,7 +56,7 @@ bool BoxEntityItem::setProperties(const EntityItemProperties& properties) {
if (wantDebug) { if (wantDebug) {
uint64_t now = usecTimestampNow(); uint64_t now = usecTimestampNow();
int elapsed = now - getLastEdited(); int elapsed = now - getLastEdited();
qDebug() << "BoxEntityItem::setProperties() AFTER update... edited AGO=" << elapsed << qCDebug(entities) << "BoxEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
"now=" << now << " getLastEdited()=" << getLastEdited(); "now=" << now << " getLastEdited()=" << getLastEdited();
} }
setLastEdited(properties._lastEdited); setLastEdited(properties._lastEdited);
@ -98,10 +99,10 @@ void BoxEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBitst
void BoxEntityItem::debugDump() const { void BoxEntityItem::debugDump() const {
quint64 now = usecTimestampNow(); quint64 now = usecTimestampNow();
qDebug() << " BOX EntityItem id:" << getEntityItemID() << "---------------------------------------------"; qCDebug(entities) << " BOX EntityItem id:" << getEntityItemID() << "---------------------------------------------";
qDebug() << " color:" << _color[0] << "," << _color[1] << "," << _color[2]; qCDebug(entities) << " color:" << _color[0] << "," << _color[1] << "," << _color[2];
qDebug() << " position:" << debugTreeVector(_position); qCDebug(entities) << " position:" << debugTreeVector(_position);
qDebug() << " dimensions:" << debugTreeVector(_dimensions); qCDebug(entities) << " dimensions:" << debugTreeVector(_dimensions);
qDebug() << " getLastEdited:" << debugTime(getLastEdited(), now); qCDebug(entities) << " getLastEdited:" << debugTime(getLastEdited(), now);
} }

View file

@ -13,6 +13,7 @@
#include "EntityTree.h" #include "EntityTree.h"
#include "EntityTreeElement.h" #include "EntityTreeElement.h"
#include "EntitiesLogging.h"
#include "DeleteEntityOperator.h" #include "DeleteEntityOperator.h"
DeleteEntityOperator::DeleteEntityOperator(EntityTree* tree, const EntityItemID& searchEntityID) : DeleteEntityOperator::DeleteEntityOperator(EntityTree* tree, const EntityItemID& searchEntityID) :
@ -43,7 +44,7 @@ void DeleteEntityOperator::addEntityIDToDeleteList(const EntityItemID& searchEnt
details.entity = details.containingElement->getEntityWithEntityItemID(searchEntityID); details.entity = details.containingElement->getEntityWithEntityItemID(searchEntityID);
if (!details.entity) { if (!details.entity) {
//assert(false); //assert(false);
qDebug() << "that's UNEXPECTED, we got a _containingElement, but couldn't find the oldEntity!"; qCDebug(entities) << "that's UNEXPECTED, we got a _containingElement, but couldn't find the oldEntity!";
} else { } else {
details.cube = details.containingElement->getAACube(); details.cube = details.containingElement->getAACube();
_entitiesToDelete << details; _entitiesToDelete << details;

View file

@ -0,0 +1,14 @@
//
// EntitiesLogging.cpp
// libraries/entities/src
//
// Created by Seth Alves on 4/6/15.
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "EntitiesLogging.h"
Q_LOGGING_CATEGORY(entities, "hifi.entities")

View file

@ -0,0 +1,14 @@
//
// EntitiesLogging.h
// libraries/entities/src
//
// Created by Seth Alves on 4/6/15.
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(entities)

View file

@ -14,6 +14,7 @@
#include <OctalCode.h> #include <OctalCode.h>
#include <PacketHeaders.h> #include <PacketHeaders.h>
#include "EntityEditPacketSender.h" #include "EntityEditPacketSender.h"
#include "EntitiesLogging.h"
#include "EntityItem.h" #include "EntityItem.h"
@ -37,9 +38,9 @@ void EntityEditPacketSender::queueEditEntityMessage(PacketType type, EntityItemI
if (EntityItemProperties::encodeEntityEditPacket(type, modelID, properties, &bufferOut[0], _maxPacketSize, sizeOut)) { if (EntityItemProperties::encodeEntityEditPacket(type, modelID, properties, &bufferOut[0], _maxPacketSize, sizeOut)) {
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
qDebug() << "calling queueOctreeEditMessage()..."; qCDebug(entities) << "calling queueOctreeEditMessage()...";
qDebug() << " id:" << modelID; qCDebug(entities) << " id:" << modelID;
qDebug() << " properties:" << properties; qCDebug(entities) << " properties:" << properties;
#endif #endif
queueOctreeEditMessage(type, bufferOut, sizeOut); queueOctreeEditMessage(type, bufferOut, sizeOut);
} }

View file

@ -20,6 +20,7 @@
#include "EntityScriptingInterface.h" #include "EntityScriptingInterface.h"
#include "EntityItem.h" #include "EntityItem.h"
#include "EntitiesLogging.h"
#include "EntityTree.h" #include "EntityTree.h"
bool EntityItem::_sendPhysicsUpdates = true; bool EntityItem::_sendPhysicsUpdates = true;
@ -169,7 +170,7 @@ OctreeElement::AppendState EntityItem::appendEntityData(OctreePacketData* packet
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
float editedAgo = getEditedAgo(); float editedAgo = getEditedAgo();
QString agoAsString = formatSecondsElapsed(editedAgo); QString agoAsString = formatSecondsElapsed(editedAgo);
qDebug() << "Writing entity " << getEntityItemID() << " to buffer, lastEdited =" << lastEdited qCDebug(entities) << "Writing entity " << getEntityItemID() << " to buffer, lastEdited =" << lastEdited
<< " ago=" << editedAgo << "seconds - " << agoAsString; << " ago=" << editedAgo << "seconds - " << agoAsString;
#endif #endif
@ -309,7 +310,7 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
// NOTE: This shouldn't happen. The only versions of the bit stream that didn't support split mtu buffers should // NOTE: This shouldn't happen. The only versions of the bit stream that didn't support split mtu buffers should
// be handled by the model subclass and shouldn't call this routine. // be handled by the model subclass and shouldn't call this routine.
qDebug() << "EntityItem::readEntityDataFromBuffer()... " qCDebug(entities) << "EntityItem::readEntityDataFromBuffer()... "
"ERROR CASE...args.bitstreamVersion < VERSION_ENTITIES_SUPPORT_SPLIT_MTU"; "ERROR CASE...args.bitstreamVersion < VERSION_ENTITIES_SUPPORT_SPLIT_MTU";
return 0; return 0;
} }
@ -373,15 +374,15 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
float editedAgo = getEditedAgo(); float editedAgo = getEditedAgo();
QString agoAsString = formatSecondsElapsed(editedAgo); QString agoAsString = formatSecondsElapsed(editedAgo);
QString ageAsString = formatSecondsElapsed(getAge()); QString ageAsString = formatSecondsElapsed(getAge());
qDebug() << "------------------------------------------"; qCDebug(entities) << "------------------------------------------";
qDebug() << "Loading entity " << getEntityItemID() << " from buffer..."; qCDebug(entities) << "Loading entity " << getEntityItemID() << " from buffer...";
qDebug() << "------------------------------------------"; qCDebug(entities) << "------------------------------------------";
debugDump(); debugDump();
qDebug() << "------------------------------------------"; qCDebug(entities) << "------------------------------------------";
qDebug() << " _created =" << _created; qCDebug(entities) << " _created =" << _created;
qDebug() << " age=" << getAge() << "seconds - " << ageAsString; qCDebug(entities) << " age=" << getAge() << "seconds - " << ageAsString;
qDebug() << " lastEdited =" << lastEdited; qCDebug(entities) << " lastEdited =" << lastEdited;
qDebug() << " ago=" << editedAgo << "seconds - " << agoAsString; qCDebug(entities) << " ago=" << editedAgo << "seconds - " << agoAsString;
#endif #endif
quint64 lastEditedFromBuffer = 0; quint64 lastEditedFromBuffer = 0;
@ -400,16 +401,16 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
bool fromSameServerEdit = (lastEditedFromBuffer == _lastEditedFromRemoteInRemoteTime); bool fromSameServerEdit = (lastEditedFromBuffer == _lastEditedFromRemoteInRemoteTime);
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
qDebug() << "data from server **************** "; qCDebug(entities) << "data from server **************** ";
qDebug() << " entityItemID:" << getEntityItemID(); qCDebug(entities) << " entityItemID:" << getEntityItemID();
qDebug() << " now:" << now; qCDebug(entities) << " now:" << now;
qDebug() << " getLastEdited:" << debugTime(getLastEdited(), now); qCDebug(entities) << " getLastEdited:" << debugTime(getLastEdited(), now);
qDebug() << " lastEditedFromBuffer:" << debugTime(lastEditedFromBuffer, now); qCDebug(entities) << " lastEditedFromBuffer:" << debugTime(lastEditedFromBuffer, now);
qDebug() << " clockSkew:" << debugTimeOnly(clockSkew); qCDebug(entities) << " clockSkew:" << debugTimeOnly(clockSkew);
qDebug() << " lastEditedFromBufferAdjusted:" << debugTime(lastEditedFromBufferAdjusted, now); qCDebug(entities) << " lastEditedFromBufferAdjusted:" << debugTime(lastEditedFromBufferAdjusted, now);
qDebug() << " _lastEditedFromRemote:" << debugTime(_lastEditedFromRemote, now); qCDebug(entities) << " _lastEditedFromRemote:" << debugTime(_lastEditedFromRemote, now);
qDebug() << " _lastEditedFromRemoteInRemoteTime:" << debugTime(_lastEditedFromRemoteInRemoteTime, now); qCDebug(entities) << " _lastEditedFromRemoteInRemoteTime:" << debugTime(_lastEditedFromRemoteInRemoteTime, now);
qDebug() << " fromSameServerEdit:" << fromSameServerEdit; qCDebug(entities) << " fromSameServerEdit:" << fromSameServerEdit;
#endif #endif
bool ignoreServerPacket = false; // assume we'll use this server packet bool ignoreServerPacket = false; // assume we'll use this server packet
@ -434,13 +435,13 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
if (ignoreServerPacket) { if (ignoreServerPacket) {
overwriteLocalData = false; overwriteLocalData = false;
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
qDebug() << "IGNORING old data from server!!! ****************"; qCDebug(entities) << "IGNORING old data from server!!! ****************";
debugDump(); debugDump();
#endif #endif
} else { } else {
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
qDebug() << "USING NEW data from server!!! ****************"; qCDebug(entities) << "USING NEW data from server!!! ****************";
debugDump(); debugDump();
#endif #endif
@ -461,9 +462,9 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
if (overwriteLocalData) { if (overwriteLocalData) {
_lastUpdated = lastEditedFromBufferAdjusted + updateDelta; // don't adjust for clock skew since we already did that _lastUpdated = lastEditedFromBufferAdjusted + updateDelta; // don't adjust for clock skew since we already did that
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
qDebug() << " _lastUpdated:" << debugTime(_lastUpdated, now); qCDebug(entities) << " _lastUpdated:" << debugTime(_lastUpdated, now);
qDebug() << " _lastEdited:" << debugTime(_lastEdited, now); qCDebug(entities) << " _lastEdited:" << debugTime(_lastEdited, now);
qDebug() << " lastEditedFromBufferAdjusted:" << debugTime(lastEditedFromBufferAdjusted, now); qCDebug(entities) << " lastEditedFromBufferAdjusted:" << debugTime(lastEditedFromBufferAdjusted, now);
#endif #endif
} }
encodedUpdateDelta = updateDeltaCoder; // determine true length encodedUpdateDelta = updateDeltaCoder; // determine true length
@ -479,9 +480,9 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
if (overwriteLocalData) { if (overwriteLocalData) {
_lastSimulated = lastEditedFromBufferAdjusted + simulatedDelta; // don't adjust for clock skew since we already did that _lastSimulated = lastEditedFromBufferAdjusted + simulatedDelta; // don't adjust for clock skew since we already did that
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
qDebug() << " _lastSimulated:" << debugTime(_lastSimulated, now); qCDebug(entities) << " _lastSimulated:" << debugTime(_lastSimulated, now);
qDebug() << " _lastEdited:" << debugTime(_lastEdited, now); qCDebug(entities) << " _lastEdited:" << debugTime(_lastEdited, now);
qDebug() << " lastEditedFromBufferAdjusted:" << debugTime(lastEditedFromBufferAdjusted, now); qCDebug(entities) << " lastEditedFromBufferAdjusted:" << debugTime(lastEditedFromBufferAdjusted, now);
#endif #endif
} }
encodedSimulatedDelta = simulatedDeltaCoder; // determine true length encodedSimulatedDelta = simulatedDeltaCoder; // determine true length
@ -491,10 +492,10 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
if (overwriteLocalData) { if (overwriteLocalData) {
qDebug() << "EntityItem::readEntityDataFromBuffer()... changed entity:" << getEntityItemID(); qCDebug(entities) << "EntityItem::readEntityDataFromBuffer()... changed entity:" << getEntityItemID();
qDebug() << " getLastEdited:" << debugTime(getLastEdited(), now); qCDebug(entities) << " getLastEdited:" << debugTime(getLastEdited(), now);
qDebug() << " getLastSimulated:" << debugTime(getLastSimulated(), now); qCDebug(entities) << " getLastSimulated:" << debugTime(getLastSimulated(), now);
qDebug() << " getLastUpdated:" << debugTime(getLastUpdated(), now); qCDebug(entities) << " getLastUpdated:" << debugTime(getLastUpdated(), now);
} }
#endif #endif
@ -584,7 +585,7 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
MIN_TIME_SKIP, MAX_TIME_SKIP); MIN_TIME_SKIP, MAX_TIME_SKIP);
if (skipTimeForward > 0.0f) { if (skipTimeForward > 0.0f) {
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
qDebug() << "skipTimeForward:" << skipTimeForward; qCDebug(entities) << "skipTimeForward:" << skipTimeForward;
#endif #endif
simulateKinematicMotion(skipTimeForward); simulateKinematicMotion(skipTimeForward);
} }
@ -595,10 +596,10 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
} }
void EntityItem::debugDump() const { void EntityItem::debugDump() const {
qDebug() << "EntityItem id:" << getEntityItemID(); qCDebug(entities) << "EntityItem id:" << getEntityItemID();
qDebug(" edited ago:%f", getEditedAgo()); qCDebug(entities, " edited ago:%f", getEditedAgo());
qDebug(" position:%f,%f,%f", _position.x, _position.y, _position.z); qCDebug(entities, " position:%f,%f,%f", _position.x, _position.y, _position.z);
qDebug() << " dimensions:" << _dimensions; qCDebug(entities) << " dimensions:" << _dimensions;
} }
// adjust any internal timestamps to fix clock skew for this server // adjust any internal timestamps to fix clock skew for this server
@ -614,10 +615,10 @@ void EntityItem::adjustEditPacketForClockSkew(unsigned char* editPacketBuffer, s
quint64 lastEditedInServerTime = lastEditedInLocalTime + clockSkew; quint64 lastEditedInServerTime = lastEditedInLocalTime + clockSkew;
memcpy(dataAt, &lastEditedInServerTime, sizeof(lastEditedInServerTime)); memcpy(dataAt, &lastEditedInServerTime, sizeof(lastEditedInServerTime));
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
qDebug("EntityItem::adjustEditPacketForClockSkew()..."); qCDebug(entities, "EntityItem::adjustEditPacketForClockSkew()...");
qDebug() << " lastEditedInLocalTime: " << lastEditedInLocalTime; qCDebug(entities) << " lastEditedInLocalTime: " << lastEditedInLocalTime;
qDebug() << " clockSkew: " << clockSkew; qCDebug(entities) << " clockSkew: " << clockSkew;
qDebug() << " lastEditedInServerTime: " << lastEditedInServerTime; qCDebug(entities) << " lastEditedInServerTime: " << lastEditedInServerTime;
#endif #endif
} }
@ -663,39 +664,39 @@ void EntityItem::simulate(const quint64& now) {
float timeElapsed = (float)(now - _lastSimulated) / (float)(USECS_PER_SECOND); float timeElapsed = (float)(now - _lastSimulated) / (float)(USECS_PER_SECOND);
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
qDebug() << "********** EntityItem::simulate()"; qCDebug(entities) << "********** EntityItem::simulate()";
qDebug() << " entity ID=" << getEntityItemID(); qCDebug(entities) << " entity ID=" << getEntityItemID();
qDebug() << " now=" << now; qCDebug(entities) << " now=" << now;
qDebug() << " _lastSimulated=" << _lastSimulated; qCDebug(entities) << " _lastSimulated=" << _lastSimulated;
qDebug() << " timeElapsed=" << timeElapsed; qCDebug(entities) << " timeElapsed=" << timeElapsed;
qDebug() << " hasVelocity=" << hasVelocity(); qCDebug(entities) << " hasVelocity=" << hasVelocity();
qDebug() << " hasGravity=" << hasGravity(); qCDebug(entities) << " hasGravity=" << hasGravity();
qDebug() << " hasAngularVelocity=" << hasAngularVelocity(); qCDebug(entities) << " hasAngularVelocity=" << hasAngularVelocity();
qDebug() << " getAngularVelocity=" << getAngularVelocity(); qCDebug(entities) << " getAngularVelocity=" << getAngularVelocity();
qDebug() << " isMortal=" << isMortal(); qCDebug(entities) << " isMortal=" << isMortal();
qDebug() << " getAge()=" << getAge(); qCDebug(entities) << " getAge()=" << getAge();
qDebug() << " getLifetime()=" << getLifetime(); qCDebug(entities) << " getLifetime()=" << getLifetime();
if (hasVelocity() || hasGravity()) { if (hasVelocity() || hasGravity()) {
qDebug() << " MOVING...="; qCDebug(entities) << " MOVING...=";
qDebug() << " hasVelocity=" << hasVelocity(); qCDebug(entities) << " hasVelocity=" << hasVelocity();
qDebug() << " hasGravity=" << hasGravity(); qCDebug(entities) << " hasGravity=" << hasGravity();
qDebug() << " hasAngularVelocity=" << hasAngularVelocity(); qCDebug(entities) << " hasAngularVelocity=" << hasAngularVelocity();
qDebug() << " getAngularVelocity=" << getAngularVelocity(); qCDebug(entities) << " getAngularVelocity=" << getAngularVelocity();
} }
if (hasAngularVelocity()) { if (hasAngularVelocity()) {
qDebug() << " CHANGING...="; qCDebug(entities) << " CHANGING...=";
qDebug() << " hasAngularVelocity=" << hasAngularVelocity(); qCDebug(entities) << " hasAngularVelocity=" << hasAngularVelocity();
qDebug() << " getAngularVelocity=" << getAngularVelocity(); qCDebug(entities) << " getAngularVelocity=" << getAngularVelocity();
} }
if (isMortal()) { if (isMortal()) {
qDebug() << " MORTAL...="; qCDebug(entities) << " MORTAL...=";
qDebug() << " isMortal=" << isMortal(); qCDebug(entities) << " isMortal=" << isMortal();
qDebug() << " getAge()=" << getAge(); qCDebug(entities) << " getAge()=" << getAge();
qDebug() << " getLifetime()=" << getLifetime(); qCDebug(entities) << " getLifetime()=" << getLifetime();
} }
qDebug() << " ********** EntityItem::simulate() .... SETTING _lastSimulated=" << _lastSimulated; qCDebug(entities) << " ********** EntityItem::simulate() .... SETTING _lastSimulated=" << _lastSimulated;
#endif #endif
simulateKinematicMotion(timeElapsed); simulateKinematicMotion(timeElapsed);
@ -708,8 +709,8 @@ void EntityItem::simulateKinematicMotion(float timeElapsed) {
if (_angularDamping > 0.0f) { if (_angularDamping > 0.0f) {
_angularVelocity *= powf(1.0f - _angularDamping, timeElapsed); _angularVelocity *= powf(1.0f - _angularDamping, timeElapsed);
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
qDebug() << " angularDamping :" << _angularDamping; qCDebug(entities) << " angularDamping :" << _angularDamping;
qDebug() << " newAngularVelocity:" << _angularVelocity; qCDebug(entities) << " newAngularVelocity:" << _angularVelocity;
#endif #endif
} }
@ -747,10 +748,10 @@ void EntityItem::simulateKinematicMotion(float timeElapsed) {
if (_damping > 0.0f) { if (_damping > 0.0f) {
velocity *= powf(1.0f - _damping, timeElapsed); velocity *= powf(1.0f - _damping, timeElapsed);
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
qDebug() << " damping:" << _damping; qCDebug(entities) << " damping:" << _damping;
qDebug() << " velocity AFTER dampingResistance:" << velocity; qCDebug(entities) << " velocity AFTER dampingResistance:" << velocity;
qDebug() << " glm::length(velocity):" << glm::length(velocity); qCDebug(entities) << " glm::length(velocity):" << glm::length(velocity);
qDebug() << " velocityEspilon :" << ENTITY_ITEM_EPSILON_VELOCITY_LENGTH; qCDebug(entities) << " velocityEspilon :" << ENTITY_ITEM_EPSILON_VELOCITY_LENGTH;
#endif #endif
} }
@ -759,14 +760,14 @@ void EntityItem::simulateKinematicMotion(float timeElapsed) {
glm::vec3 newPosition = position + (velocity * timeElapsed); glm::vec3 newPosition = position + (velocity * timeElapsed);
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
qDebug() << " EntityItem::simulate()...."; qCDebug(entities) << " EntityItem::simulate()....";
qDebug() << " timeElapsed:" << timeElapsed; qCDebug(entities) << " timeElapsed:" << timeElapsed;
qDebug() << " old AACube:" << getMaximumAACube(); qCDebug(entities) << " old AACube:" << getMaximumAACube();
qDebug() << " old position:" << position; qCDebug(entities) << " old position:" << position;
qDebug() << " old velocity:" << velocity; qCDebug(entities) << " old velocity:" << velocity;
qDebug() << " old getAABox:" << getAABox(); qCDebug(entities) << " old getAABox:" << getAABox();
qDebug() << " newPosition:" << newPosition; qCDebug(entities) << " newPosition:" << newPosition;
qDebug() << " glm::distance(newPosition, position):" << glm::distance(newPosition, position); qCDebug(entities) << " glm::distance(newPosition, position):" << glm::distance(newPosition, position);
#endif #endif
position = newPosition; position = newPosition;
@ -791,10 +792,10 @@ void EntityItem::simulateKinematicMotion(float timeElapsed) {
} }
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
qDebug() << " new position:" << position; qCDebug(entities) << " new position:" << position;
qDebug() << " new velocity:" << velocity; qCDebug(entities) << " new velocity:" << velocity;
qDebug() << " new AACube:" << getMaximumAACube(); qCDebug(entities) << " new AACube:" << getMaximumAACube();
qDebug() << " old getAABox:" << getAABox(); qCDebug(entities) << " old getAABox:" << getAABox();
#endif #endif
} }
} }
@ -874,7 +875,7 @@ bool EntityItem::setProperties(const EntityItemProperties& properties) {
uint64_t now = usecTimestampNow(); uint64_t now = usecTimestampNow();
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
int elapsed = now - getLastEdited(); int elapsed = now - getLastEdited();
qDebug() << "EntityItem::setProperties() AFTER update... edited AGO=" << elapsed << qCDebug(entities) << "EntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
"now=" << now << " getLastEdited()=" << getLastEdited(); "now=" << now << " getLastEdited()=" << getLastEdited();
#endif #endif
if (_created != UNKNOWN_CREATED_TIME) { if (_created != UNKNOWN_CREATED_TIME) {

View file

@ -23,6 +23,7 @@
#include "EntityItemPropertiesDefaults.h" #include "EntityItemPropertiesDefaults.h"
#include "ModelEntityItem.h" #include "ModelEntityItem.h"
#include "TextEntityItem.h" #include "TextEntityItem.h"
#include "EntitiesLogging.h"
#include "ParticleEffectEntityItem.h" #include "ParticleEffectEntityItem.h"
@ -153,15 +154,15 @@ QString EntityItemProperties::getAnimationSettings() const {
} }
void EntityItemProperties::debugDump() const { void EntityItemProperties::debugDump() const {
qDebug() << "EntityItemProperties..."; qCDebug(entities) << "EntityItemProperties...";
qDebug() << " _type=" << EntityTypes::getEntityTypeName(_type); qCDebug(entities) << " _type=" << EntityTypes::getEntityTypeName(_type);
qDebug() << " _id=" << _id; qCDebug(entities) << " _id=" << _id;
qDebug() << " _idSet=" << _idSet; qCDebug(entities) << " _idSet=" << _idSet;
qDebug() << " _position=" << _position.x << "," << _position.y << "," << _position.z; qCDebug(entities) << " _position=" << _position.x << "," << _position.y << "," << _position.z;
qDebug() << " _dimensions=" << getDimensions(); qCDebug(entities) << " _dimensions=" << getDimensions();
qDebug() << " _modelURL=" << _modelURL; qCDebug(entities) << " _modelURL=" << _modelURL;
qDebug() << " _collisionModelURL=" << _collisionModelURL; qCDebug(entities) << " _collisionModelURL=" << _collisionModelURL;
qDebug() << " changed properties..."; qCDebug(entities) << " changed properties...";
EntityPropertyFlags props = getChangedProperties(); EntityPropertyFlags props = getChangedProperties();
props.debugDumpBits(); props.debugDumpBits();
} }
@ -643,7 +644,7 @@ bool EntityItemProperties::encodeEntityEditPacket(PacketType command, EntityItem
memcpy(bufferOut, finalizedData, finalizedSize); memcpy(bufferOut, finalizedData, finalizedSize);
sizeOut = finalizedSize; sizeOut = finalizedSize;
} else { } else {
qDebug() << "ERROR - encoded edit message doesn't fit in output buffer."; qCDebug(entities) << "ERROR - encoded edit message doesn't fit in output buffer.";
sizeOut = 0; sizeOut = 0;
success = false; success = false;
} }
@ -838,7 +839,7 @@ bool EntityItemProperties::encodeEraseEntityMessage(const EntityItemID& entityIt
uint16_t numberOfIds = 1; // only one entity ID in this message uint16_t numberOfIds = 1; // only one entity ID in this message
if (maxLength < sizeof(numberOfIds) + NUM_BYTES_RFC4122_UUID) { if (maxLength < sizeof(numberOfIds) + NUM_BYTES_RFC4122_UUID) {
qDebug() << "ERROR - encodeEraseEntityMessage() called with buffer that is too small!"; qCDebug(entities) << "ERROR - encodeEraseEntityMessage() called with buffer that is too small!";
outputLength = 0; outputLength = 0;
return false; return false;
} }

View file

@ -12,6 +12,7 @@
#include <AACube.h> #include <AACube.h>
#include "EntitySimulation.h" #include "EntitySimulation.h"
#include "EntitiesLogging.h"
#include "MovingEntitiesOperator.h" #include "MovingEntitiesOperator.h"
void EntitySimulation::setEntityTree(EntityTree* tree) { void EntitySimulation::setEntityTree(EntityTree* tree) {
@ -94,7 +95,7 @@ void EntitySimulation::sortEntitiesThatMoved() {
// check to see if this movement has sent the entity outside of the domain. // check to see if this movement has sent the entity outside of the domain.
AACube newCube = entity->getMaximumAACube(); AACube newCube = entity->getMaximumAACube();
if (!domainBounds.touches(newCube)) { if (!domainBounds.touches(newCube)) {
qDebug() << "Entity " << entity->getEntityItemID() << " moved out of domain bounds."; qCDebug(entities) << "Entity " << entity->getEntityItemID() << " moved out of domain bounds.";
_entitiesToDelete.insert(entity); _entitiesToDelete.insert(entity);
_mortalEntities.remove(entity); _mortalEntities.remove(entity);
_updateableEntities.remove(entity); _updateableEntities.remove(entity);
@ -154,7 +155,7 @@ void EntitySimulation::entityChanged(EntityItem* entity) {
AACube domainBounds(glm::vec3(0.0f,0.0f,0.0f), (float)TREE_SCALE); AACube domainBounds(glm::vec3(0.0f,0.0f,0.0f), (float)TREE_SCALE);
AACube newCube = entity->getMaximumAACube(); AACube newCube = entity->getMaximumAACube();
if (!domainBounds.touches(newCube)) { if (!domainBounds.touches(newCube)) {
qDebug() << "Entity " << entity->getEntityItemID() << " moved out of domain bounds."; qCDebug(entities) << "Entity " << entity->getEntityItemID() << " moved out of domain bounds.";
_entitiesToDelete.insert(entity); _entitiesToDelete.insert(entity);
_mortalEntities.remove(entity); _mortalEntities.remove(entity);
_updateableEntities.remove(entity); _updateableEntities.remove(entity);

View file

@ -21,6 +21,7 @@
#include "MovingEntitiesOperator.h" #include "MovingEntitiesOperator.h"
#include "UpdateEntityOperator.h" #include "UpdateEntityOperator.h"
#include "QVariantGLM.h" #include "QVariantGLM.h"
#include "EntitiesLogging.h"
#include "RecurseOctreeToMapOperator.h" #include "RecurseOctreeToMapOperator.h"
EntityTree::EntityTree(bool shouldReaverage) : EntityTree::EntityTree(bool shouldReaverage) :
@ -103,13 +104,13 @@ void EntityTree::postAddEntity(EntityItem* entity) {
bool EntityTree::updateEntity(const EntityItemID& entityID, const EntityItemProperties& properties, bool allowLockChange) { bool EntityTree::updateEntity(const EntityItemID& entityID, const EntityItemProperties& properties, bool allowLockChange) {
EntityTreeElement* containingElement = getContainingElement(entityID); EntityTreeElement* containingElement = getContainingElement(entityID);
if (!containingElement) { if (!containingElement) {
qDebug() << "UNEXPECTED!!!! EntityTree::updateEntity() entityID doesn't exist!!! entityID=" << entityID; qCDebug(entities) << "UNEXPECTED!!!! EntityTree::updateEntity() entityID doesn't exist!!! entityID=" << entityID;
return false; return false;
} }
EntityItem* existingEntity = containingElement->getEntityWithEntityItemID(entityID); EntityItem* existingEntity = containingElement->getEntityWithEntityItemID(entityID);
if (!existingEntity) { if (!existingEntity) {
qDebug() << "UNEXPECTED!!!! don't call updateEntity() on entity items that don't exist. entityID=" << entityID; qCDebug(entities) << "UNEXPECTED!!!! don't call updateEntity() on entity items that don't exist. entityID=" << entityID;
return false; return false;
} }
@ -119,7 +120,7 @@ bool EntityTree::updateEntity(const EntityItemID& entityID, const EntityItemProp
bool EntityTree::updateEntity(EntityItem* entity, const EntityItemProperties& properties, bool allowLockChange) { bool EntityTree::updateEntity(EntityItem* entity, const EntityItemProperties& properties, bool allowLockChange) {
EntityTreeElement* containingElement = getContainingElement(entity->getEntityItemID()); EntityTreeElement* containingElement = getContainingElement(entity->getEntityItemID());
if (!containingElement) { if (!containingElement) {
qDebug() << "UNEXPECTED!!!! EntityTree::updateEntity() entity-->element lookup failed!!! entityID=" qCDebug(entities) << "UNEXPECTED!!!! EntityTree::updateEntity() entity-->element lookup failed!!! entityID="
<< entity->getEntityItemID(); << entity->getEntityItemID();
return false; return false;
} }
@ -130,7 +131,7 @@ bool EntityTree::updateEntityWithElement(EntityItem* entity, const EntityItemPro
EntityTreeElement* containingElement, bool allowLockChange) { EntityTreeElement* containingElement, bool allowLockChange) {
if (!allowLockChange && (entity->getLocked() != properties.getLocked())) { if (!allowLockChange && (entity->getLocked() != properties.getLocked())) {
qDebug() << "Refusing disallowed lock adjustment."; qCDebug(entities) << "Refusing disallowed lock adjustment.";
return false; return false;
} }
@ -177,7 +178,7 @@ bool EntityTree::updateEntityWithElement(EntityItem* entity, const EntityItemPro
// TODO: this final containingElement check should eventually be removed (or wrapped in an #ifdef DEBUG). // TODO: this final containingElement check should eventually be removed (or wrapped in an #ifdef DEBUG).
containingElement = getContainingElement(entity->getEntityItemID()); containingElement = getContainingElement(entity->getEntityItemID());
if (!containingElement) { if (!containingElement) {
qDebug() << "UNEXPECTED!!!! after updateEntity() we no longer have a containing element??? entityID=" qCDebug(entities) << "UNEXPECTED!!!! after updateEntity() we no longer have a containing element??? entityID="
<< entity->getEntityItemID(); << entity->getEntityItemID();
return false; return false;
} }
@ -193,7 +194,7 @@ EntityItem* EntityTree::addEntity(const EntityItemID& entityID, const EntityItem
bool recordCreationTime = false; bool recordCreationTime = false;
if (!entityID.isKnownID) { if (!entityID.isKnownID) {
if (getIsServer()) { if (getIsServer()) {
qDebug() << "UNEXPECTED!!! ----- EntityTree::addEntity()... (getIsSever() && !entityID.isKnownID)"; qCDebug(entities) << "UNEXPECTED!!! ----- EntityTree::addEntity()... (getIsSever() && !entityID.isKnownID)";
return result; return result;
} }
if (properties.getCreated() == UNKNOWN_CREATED_TIME) { if (properties.getCreated() == UNKNOWN_CREATED_TIME) {
@ -206,7 +207,7 @@ EntityItem* EntityTree::addEntity(const EntityItemID& entityID, const EntityItem
// You should not call this on existing entities that are already part of the tree! Call updateEntity() // You should not call this on existing entities that are already part of the tree! Call updateEntity()
EntityTreeElement* containingElement = getContainingElement(entityID); EntityTreeElement* containingElement = getContainingElement(entityID);
if (containingElement) { if (containingElement) {
qDebug() << "UNEXPECTED!!! ----- don't call addEntity() on existing entity items. entityID=" << entityID qCDebug(entities) << "UNEXPECTED!!! ----- don't call addEntity() on existing entity items. entityID=" << entityID
<< "containingElement=" << containingElement; << "containingElement=" << containingElement;
return result; return result;
} }
@ -251,7 +252,7 @@ void EntityTree::deleteEntity(const EntityItemID& entityID, bool force, bool ign
EntityTreeElement* containingElement = getContainingElement(entityID); EntityTreeElement* containingElement = getContainingElement(entityID);
if (!containingElement) { if (!containingElement) {
if (!ignoreWarnings) { if (!ignoreWarnings) {
qDebug() << "UNEXPECTED!!!! EntityTree::deleteEntity() entityID doesn't exist!!! entityID=" << entityID; qCDebug(entities) << "UNEXPECTED!!!! EntityTree::deleteEntity() entityID doesn't exist!!! entityID=" << entityID;
} }
return; return;
} }
@ -259,7 +260,7 @@ void EntityTree::deleteEntity(const EntityItemID& entityID, bool force, bool ign
EntityItem* existingEntity = containingElement->getEntityWithEntityItemID(entityID); EntityItem* existingEntity = containingElement->getEntityWithEntityItemID(entityID);
if (!existingEntity) { if (!existingEntity) {
if (!ignoreWarnings) { if (!ignoreWarnings) {
qDebug() << "UNEXPECTED!!!! don't call EntityTree::deleteEntity() on entity items that don't exist. " qCDebug(entities) << "UNEXPECTED!!!! don't call EntityTree::deleteEntity() on entity items that don't exist. "
"entityID=" << entityID; "entityID=" << entityID;
} }
return; return;
@ -267,7 +268,7 @@ void EntityTree::deleteEntity(const EntityItemID& entityID, bool force, bool ign
if (existingEntity->getLocked() && !force) { if (existingEntity->getLocked() && !force) {
if (!ignoreWarnings) { if (!ignoreWarnings) {
qDebug() << "ERROR! EntityTree::deleteEntity() trying to delete locked entity. entityID=" << entityID; qCDebug(entities) << "ERROR! EntityTree::deleteEntity() trying to delete locked entity. entityID=" << entityID;
} }
return; return;
} }
@ -288,7 +289,7 @@ void EntityTree::deleteEntities(QSet<EntityItemID> entityIDs, bool force, bool i
EntityTreeElement* containingElement = getContainingElement(entityID); EntityTreeElement* containingElement = getContainingElement(entityID);
if (!containingElement) { if (!containingElement) {
if (!ignoreWarnings) { if (!ignoreWarnings) {
qDebug() << "UNEXPECTED!!!! EntityTree::deleteEntities() entityID doesn't exist!!! entityID=" << entityID; qCDebug(entities) << "UNEXPECTED!!!! EntityTree::deleteEntities() entityID doesn't exist!!! entityID=" << entityID;
} }
continue; continue;
} }
@ -296,7 +297,7 @@ void EntityTree::deleteEntities(QSet<EntityItemID> entityIDs, bool force, bool i
EntityItem* existingEntity = containingElement->getEntityWithEntityItemID(entityID); EntityItem* existingEntity = containingElement->getEntityWithEntityItemID(entityID);
if (!existingEntity) { if (!existingEntity) {
if (!ignoreWarnings) { if (!ignoreWarnings) {
qDebug() << "UNEXPECTED!!!! don't call EntityTree::deleteEntities() on entity items that don't exist. " qCDebug(entities) << "UNEXPECTED!!!! don't call EntityTree::deleteEntities() on entity items that don't exist. "
"entityID=" << entityID; "entityID=" << entityID;
} }
continue; continue;
@ -304,7 +305,7 @@ void EntityTree::deleteEntities(QSet<EntityItemID> entityIDs, bool force, bool i
if (existingEntity->getLocked() && !force) { if (existingEntity->getLocked() && !force) {
if (!ignoreWarnings) { if (!ignoreWarnings) {
qDebug() << "ERROR! EntityTree::deleteEntities() trying to delete locked entity. entityID=" << entityID; qCDebug(entities) << "ERROR! EntityTree::deleteEntities() trying to delete locked entity. entityID=" << entityID;
} }
continue; continue;
} }
@ -376,7 +377,7 @@ void EntityTree::processRemovedEntities(const DeleteEntityOperator& theOperator)
void EntityTree::handleAddEntityResponse(const QByteArray& packet) { void EntityTree::handleAddEntityResponse(const QByteArray& packet) {
if (!getIsClient()) { if (!getIsClient()) {
qDebug() << "UNEXPECTED!!! EntityTree::handleAddEntityResponse() with !getIsClient() ***"; qCDebug(entities) << "UNEXPECTED!!! EntityTree::handleAddEntityResponse() with !getIsClient() ***";
return; return;
} }
@ -602,12 +603,12 @@ EntityItem* EntityTree::findEntityByEntityItemID(const EntityItemID& entityID) /
EntityItemID EntityTree::assignEntityID(const EntityItemID& entityItemID) { EntityItemID EntityTree::assignEntityID(const EntityItemID& entityItemID) {
if (!getIsServer()) { if (!getIsServer()) {
qDebug() << "UNEXPECTED!!! assignEntityID should only be called on a server tree. entityItemID:" << entityItemID; qCDebug(entities) << "UNEXPECTED!!! assignEntityID should only be called on a server tree. entityItemID:" << entityItemID;
return entityItemID; return entityItemID;
} }
if (getContainingElement(entityItemID)) { if (getContainingElement(entityItemID)) {
qDebug() << "UNEXPECTED!!! don't call assignEntityID() for existing entityIDs. entityItemID:" << entityItemID; qCDebug(entities) << "UNEXPECTED!!! don't call assignEntityID() for existing entityIDs. entityItemID:" << entityItemID;
return entityItemID; return entityItemID;
} }
@ -619,7 +620,7 @@ int EntityTree::processEditPacketData(PacketType packetType, const unsigned char
const unsigned char* editData, int maxLength, const SharedNodePointer& senderNode) { const unsigned char* editData, int maxLength, const SharedNodePointer& senderNode) {
if (!getIsServer()) { if (!getIsServer()) {
qDebug() << "UNEXPECTED!!! processEditPacketData() should only be called on a server tree."; qCDebug(entities) << "UNEXPECTED!!! processEditPacketData() should only be called on a server tree.";
return 0; return 0;
} }
@ -650,35 +651,35 @@ int EntityTree::processEditPacketData(PacketType packetType, const unsigned char
// if the EntityItem exists, then update it // if the EntityItem exists, then update it
if (existingEntity) { if (existingEntity) {
if (wantEditLogging()) { if (wantEditLogging()) {
qDebug() << "User [" << senderNode->getUUID() << "] editing entity. ID:" << entityItemID; qCDebug(entities) << "User [" << senderNode->getUUID() << "] editing entity. ID:" << entityItemID;
qDebug() << " properties:" << properties; qCDebug(entities) << " properties:" << properties;
} }
updateEntity(entityItemID, properties, senderNode->getCanAdjustLocks()); updateEntity(entityItemID, properties, senderNode->getCanAdjustLocks());
existingEntity->markAsChangedOnServer(); existingEntity->markAsChangedOnServer();
} else { } else {
qDebug() << "User attempted to edit an unknown entity. ID:" << entityItemID; qCDebug(entities) << "User attempted to edit an unknown entity. ID:" << entityItemID;
} }
} else { } else {
if (senderNode->getCanRez()) { if (senderNode->getCanRez()) {
// this is a new entity... assign a new entityID // this is a new entity... assign a new entityID
entityItemID = assignEntityID(entityItemID); entityItemID = assignEntityID(entityItemID);
if (wantEditLogging()) { if (wantEditLogging()) {
qDebug() << "User [" << senderNode->getUUID() << "] adding entity."; qCDebug(entities) << "User [" << senderNode->getUUID() << "] adding entity.";
qDebug() << " properties:" << properties; qCDebug(entities) << " properties:" << properties;
} }
EntityItem* newEntity = addEntity(entityItemID, properties); EntityItem* newEntity = addEntity(entityItemID, properties);
if (newEntity) { if (newEntity) {
newEntity->markAsChangedOnServer(); newEntity->markAsChangedOnServer();
notifyNewlyCreatedEntity(*newEntity, senderNode); notifyNewlyCreatedEntity(*newEntity, senderNode);
if (wantEditLogging()) { if (wantEditLogging()) {
qDebug() << "User [" << senderNode->getUUID() << "] added entity. ID:" qCDebug(entities) << "User [" << senderNode->getUUID() << "] added entity. ID:"
<< newEntity->getEntityItemID(); << newEntity->getEntityItemID();
qDebug() << " properties:" << properties; qCDebug(entities) << " properties:" << properties;
} }
} }
} else { } else {
qDebug() << "User without 'rez rights' [" << senderNode->getUUID() << "] attempted to add an entity."; qCDebug(entities) << "User without 'rez rights' [" << senderNode->getUUID() << "] attempted to add an entity.";
} }
} }
} }
@ -909,7 +910,7 @@ int EntityTree::processEraseMessage(const QByteArray& dataByteArray, const Share
for (size_t i = 0; i < numberOfIds; i++) { for (size_t i = 0; i < numberOfIds; i++) {
if (processedBytes + NUM_BYTES_RFC4122_UUID > packetLength) { if (processedBytes + NUM_BYTES_RFC4122_UUID > packetLength) {
qDebug() << "EntityTree::processEraseMessage().... bailing because not enough bytes in buffer"; qCDebug(entities) << "EntityTree::processEraseMessage().... bailing because not enough bytes in buffer";
break; // bail to prevent buffer overflow break; // bail to prevent buffer overflow
} }
@ -922,7 +923,7 @@ int EntityTree::processEraseMessage(const QByteArray& dataByteArray, const Share
entityItemIDsToDelete << entityItemID; entityItemIDsToDelete << entityItemID;
if (wantEditLogging()) { if (wantEditLogging()) {
qDebug() << "User [" << sourceNode->getUUID() << "] deleting entity. ID:" << entityItemID; qCDebug(entities) << "User [" << sourceNode->getUUID() << "] deleting entity. ID:" << entityItemID;
} }
} }
@ -953,7 +954,7 @@ int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, cons
if (processedBytes + NUM_BYTES_RFC4122_UUID > packetLength) { if (processedBytes + NUM_BYTES_RFC4122_UUID > packetLength) {
qDebug() << "EntityTree::processEraseMessageDetails().... bailing because not enough bytes in buffer"; qCDebug(entities) << "EntityTree::processEraseMessageDetails().... bailing because not enough bytes in buffer";
break; // bail to prevent buffer overflow break; // bail to prevent buffer overflow
} }
@ -966,7 +967,7 @@ int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, cons
entityItemIDsToDelete << entityItemID; entityItemIDsToDelete << entityItemID;
if (wantEditLogging()) { if (wantEditLogging()) {
qDebug() << "User [" << sourceNode->getUUID() << "] deleting entity. ID:" << entityItemID; qCDebug(entities) << "User [" << sourceNode->getUUID() << "] deleting entity. ID:" << entityItemID;
} }
} }
@ -999,17 +1000,17 @@ EntityTreeElement* EntityTree::getContainingElement(const EntityItemID& entityIt
void EntityTree::resetContainingElement(const EntityItemID& entityItemID, EntityTreeElement* element) { void EntityTree::resetContainingElement(const EntityItemID& entityItemID, EntityTreeElement* element) {
if (entityItemID.id == UNKNOWN_ENTITY_ID) { if (entityItemID.id == UNKNOWN_ENTITY_ID) {
//assert(entityItemID.id != UNKNOWN_ENTITY_ID); //assert(entityItemID.id != UNKNOWN_ENTITY_ID);
qDebug() << "UNEXPECTED! resetContainingElement() called with UNKNOWN_ENTITY_ID. entityItemID:" << entityItemID; qCDebug(entities) << "UNEXPECTED! resetContainingElement() called with UNKNOWN_ENTITY_ID. entityItemID:" << entityItemID;
return; return;
} }
if (entityItemID.creatorTokenID == UNKNOWN_ENTITY_TOKEN) { if (entityItemID.creatorTokenID == UNKNOWN_ENTITY_TOKEN) {
//assert(entityItemID.creatorTokenID != UNKNOWN_ENTITY_TOKEN); //assert(entityItemID.creatorTokenID != UNKNOWN_ENTITY_TOKEN);
qDebug() << "UNEXPECTED! resetContainingElement() called with UNKNOWN_ENTITY_TOKEN. entityItemID:" << entityItemID; qCDebug(entities) << "UNEXPECTED! resetContainingElement() called with UNKNOWN_ENTITY_TOKEN. entityItemID:" << entityItemID;
return; return;
} }
if (!element) { if (!element) {
//assert(element); //assert(element);
qDebug() << "UNEXPECTED! resetContainingElement() called with NULL element. entityItemID:" << entityItemID; qCDebug(entities) << "UNEXPECTED! resetContainingElement() called with NULL element. entityItemID:" << entityItemID;
return; return;
} }
@ -1042,13 +1043,13 @@ void EntityTree::setContainingElement(const EntityItemID& entityItemID, EntityTr
} }
void EntityTree::debugDumpMap() { void EntityTree::debugDumpMap() {
qDebug() << "EntityTree::debugDumpMap() --------------------------"; qCDebug(entities) << "EntityTree::debugDumpMap() --------------------------";
QHashIterator<EntityItemID, EntityTreeElement*> i(_entityToElementMap); QHashIterator<EntityItemID, EntityTreeElement*> i(_entityToElementMap);
while (i.hasNext()) { while (i.hasNext()) {
i.next(); i.next();
qDebug() << i.key() << ": " << i.value(); qCDebug(entities) << i.key() << ": " << i.value();
} }
qDebug() << "-----------------------------------------------------"; qCDebug(entities) << "-----------------------------------------------------";
} }
class DebugOperator : public RecurseOctreeOperator { class DebugOperator : public RecurseOctreeOperator {
@ -1059,7 +1060,7 @@ public:
bool DebugOperator::preRecursion(OctreeElement* element) { bool DebugOperator::preRecursion(OctreeElement* element) {
EntityTreeElement* entityTreeElement = static_cast<EntityTreeElement*>(element); EntityTreeElement* entityTreeElement = static_cast<EntityTreeElement*>(element);
qDebug() << "EntityTreeElement [" << entityTreeElement << "]"; qCDebug(entities) << "EntityTreeElement [" << entityTreeElement << "]";
entityTreeElement->debugDump(); entityTreeElement->debugDump();
return true; return true;
} }
@ -1157,7 +1158,7 @@ bool EntityTree::readFromMap(QVariantMap& map) {
EntityItem* entity = addEntity(entityItemID, properties); EntityItem* entity = addEntity(entityItemID, properties);
if (!entity) { if (!entity) {
qDebug() << "adding Entity failed:" << entityItemID << entity->getType(); qCDebug(entities) << "adding Entity failed:" << entityItemID << entity->getType();
} }
} }

View file

@ -15,6 +15,7 @@
#include <GeometryUtil.h> #include <GeometryUtil.h>
#include "EntityTree.h" #include "EntityTree.h"
#include "EntitiesLogging.h"
#include "EntityTreeElement.h" #include "EntityTreeElement.h"
EntityTreeElement::EntityTreeElement(unsigned char* octalCode) : OctreeElement(), _entityItems(NULL) { EntityTreeElement::EntityTreeElement(unsigned char* octalCode) : OctreeElement(), _entityItems(NULL) {
@ -49,8 +50,8 @@ EntityTreeElement* EntityTreeElement::addChildAtIndex(int index) {
} }
void EntityTreeElement::debugExtraEncodeData(EncodeBitstreamParams& params) const { void EntityTreeElement::debugExtraEncodeData(EncodeBitstreamParams& params) const {
qDebug() << "EntityTreeElement::debugExtraEncodeData()... "; qCDebug(entities) << "EntityTreeElement::debugExtraEncodeData()... ";
qDebug() << " element:" << _cube; qCDebug(entities) << " element:" << _cube;
OctreeElementExtraEncodeData* extraEncodeData = params.extraEncodeData; OctreeElementExtraEncodeData* extraEncodeData = params.extraEncodeData;
assert(extraEncodeData); // EntityTrees always require extra encode data on their encoding passes assert(extraEncodeData); // EntityTrees always require extra encode data on their encoding passes
@ -58,9 +59,9 @@ void EntityTreeElement::debugExtraEncodeData(EncodeBitstreamParams& params) cons
if (extraEncodeData->contains(this)) { if (extraEncodeData->contains(this)) {
EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData
= static_cast<EntityTreeElementExtraEncodeData*>(extraEncodeData->value(this)); = static_cast<EntityTreeElementExtraEncodeData*>(extraEncodeData->value(this));
qDebug() << " encode data:" << entityTreeElementExtraEncodeData; qCDebug(entities) << " encode data:" << entityTreeElementExtraEncodeData;
} else { } else {
qDebug() << " encode data: MISSING!!"; qCDebug(entities) << " encode data: MISSING!!";
} }
} }
@ -159,7 +160,7 @@ void EntityTreeElement::elementEncodeComplete(EncodeBitstreamParams& params, Oct
const bool wantDebug = false; const bool wantDebug = false;
if (wantDebug) { if (wantDebug) {
qDebug() << "EntityTreeElement::elementEncodeComplete() element:" << _cube; qCDebug(entities) << "EntityTreeElement::elementEncodeComplete() element:" << _cube;
} }
OctreeElementExtraEncodeData* extraEncodeData = params.extraEncodeData; OctreeElementExtraEncodeData* extraEncodeData = params.extraEncodeData;
@ -194,15 +195,15 @@ void EntityTreeElement::elementEncodeComplete(EncodeBitstreamParams& params, Oct
= static_cast<EntityTreeElementExtraEncodeData*>(extraEncodeData->value(childElement)); = static_cast<EntityTreeElementExtraEncodeData*>(extraEncodeData->value(childElement));
if (wantDebug) { if (wantDebug) {
qDebug() << "checking child: " << childElement->_cube; qCDebug(entities) << "checking child: " << childElement->_cube;
qDebug() << " childElement->isLeaf():" << childElement->isLeaf(); qCDebug(entities) << " childElement->isLeaf():" << childElement->isLeaf();
qDebug() << " childExtraEncodeData->elementCompleted:" << childExtraEncodeData->elementCompleted; qCDebug(entities) << " childExtraEncodeData->elementCompleted:" << childExtraEncodeData->elementCompleted;
qDebug() << " childExtraEncodeData->subtreeCompleted:" << childExtraEncodeData->subtreeCompleted; qCDebug(entities) << " childExtraEncodeData->subtreeCompleted:" << childExtraEncodeData->subtreeCompleted;
} }
if (childElement->isLeaf() && childExtraEncodeData->elementCompleted) { if (childElement->isLeaf() && childExtraEncodeData->elementCompleted) {
if (wantDebug) { if (wantDebug) {
qDebug() << " CHILD IS LEAF -- AND CHILD ELEMENT DATA COMPLETED!!!"; qCDebug(entities) << " CHILD IS LEAF -- AND CHILD ELEMENT DATA COMPLETED!!!";
} }
childExtraEncodeData->subtreeCompleted = true; childExtraEncodeData->subtreeCompleted = true;
} }
@ -215,19 +216,19 @@ void EntityTreeElement::elementEncodeComplete(EncodeBitstreamParams& params, Oct
} }
if (wantDebug) { if (wantDebug) {
qDebug() << "for this element: " << _cube; qCDebug(entities) << "for this element: " << _cube;
qDebug() << " WAS elementCompleted:" << thisExtraEncodeData->elementCompleted; qCDebug(entities) << " WAS elementCompleted:" << thisExtraEncodeData->elementCompleted;
qDebug() << " WAS subtreeCompleted:" << thisExtraEncodeData->subtreeCompleted; qCDebug(entities) << " WAS subtreeCompleted:" << thisExtraEncodeData->subtreeCompleted;
} }
thisExtraEncodeData->subtreeCompleted = !someChildTreeNotComplete; thisExtraEncodeData->subtreeCompleted = !someChildTreeNotComplete;
if (wantDebug) { if (wantDebug) {
qDebug() << " NOW elementCompleted:" << thisExtraEncodeData->elementCompleted; qCDebug(entities) << " NOW elementCompleted:" << thisExtraEncodeData->elementCompleted;
qDebug() << " NOW subtreeCompleted:" << thisExtraEncodeData->subtreeCompleted; qCDebug(entities) << " NOW subtreeCompleted:" << thisExtraEncodeData->subtreeCompleted;
if (thisExtraEncodeData->subtreeCompleted) { if (thisExtraEncodeData->subtreeCompleted) {
qDebug() << " YEAH!!!!! >>>>>>>>>>>>>> NOW subtreeCompleted:" << thisExtraEncodeData->subtreeCompleted; qCDebug(entities) << " YEAH!!!!! >>>>>>>>>>>>>> NOW subtreeCompleted:" << thisExtraEncodeData->subtreeCompleted;
} }
} }
} }
@ -821,19 +822,19 @@ bool EntityTreeElement::pruneChildren() {
void EntityTreeElement::debugDump() { void EntityTreeElement::debugDump() {
qDebug() << "EntityTreeElement..."; qCDebug(entities) << "EntityTreeElement...";
qDebug() << " cube:" << _cube; qCDebug(entities) << " cube:" << _cube;
qDebug() << " has child elements:" << getChildCount(); qCDebug(entities) << " has child elements:" << getChildCount();
if (_entityItems->size()) { if (_entityItems->size()) {
qDebug() << " has entities:" << _entityItems->size(); qCDebug(entities) << " has entities:" << _entityItems->size();
qDebug() << "--------------------------------------------------"; qCDebug(entities) << "--------------------------------------------------";
for (uint16_t i = 0; i < _entityItems->size(); i++) { for (uint16_t i = 0; i < _entityItems->size(); i++) {
EntityItem* entity = (*_entityItems)[i]; EntityItem* entity = (*_entityItems)[i];
entity->debugDump(); entity->debugDump();
} }
qDebug() << "--------------------------------------------------"; qCDebug(entities) << "--------------------------------------------------";
} else { } else {
qDebug() << " NO entities!"; qCDebug(entities) << " NO entities!";
} }
} }

View file

@ -17,6 +17,7 @@
#include "EntityItemID.h" #include "EntityItemID.h"
#include "EntityTree.h" #include "EntityTree.h"
#include "EntityTreeElement.h" #include "EntityTreeElement.h"
#include "EntitiesLogging.h"
#include "LightEntityItem.h" #include "LightEntityItem.h"
bool LightEntityItem::_lightsArePickable = false; bool LightEntityItem::_lightsArePickable = false;
@ -107,7 +108,7 @@ bool LightEntityItem::setProperties(const EntityItemProperties& properties) {
if (wantDebug) { if (wantDebug) {
uint64_t now = usecTimestampNow(); uint64_t now = usecTimestampNow();
int elapsed = now - getLastEdited(); int elapsed = now - getLastEdited();
qDebug() << "LightEntityItem::setProperties() AFTER update... edited AGO=" << elapsed << qCDebug(entities) << "LightEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
"now=" << now << " getLastEdited()=" << getLastEdited(); "now=" << now << " getLastEdited()=" << getLastEdited();
} }
setLastEdited(properties.getLastEdited()); setLastEdited(properties.getLastEdited());

View file

@ -16,8 +16,9 @@
#include "EntityTree.h" #include "EntityTree.h"
#include "EntityTreeElement.h" #include "EntityTreeElement.h"
#include "ModelEntityItem.h" #include "EntitiesLogging.h"
#include "ResourceCache.h" #include "ResourceCache.h"
#include "ModelEntityItem.h"
const QString ModelEntityItem::DEFAULT_MODEL_URL = QString(""); const QString ModelEntityItem::DEFAULT_MODEL_URL = QString("");
const QString ModelEntityItem::DEFAULT_COLLISION_MODEL_URL = QString(""); const QString ModelEntityItem::DEFAULT_COLLISION_MODEL_URL = QString("");
@ -78,7 +79,7 @@ bool ModelEntityItem::setProperties(const EntityItemProperties& properties) {
if (wantDebug) { if (wantDebug) {
uint64_t now = usecTimestampNow(); uint64_t now = usecTimestampNow();
int elapsed = now - getLastEdited(); int elapsed = now - getLastEdited();
qDebug() << "ModelEntityItem::setProperties() AFTER update... edited AGO=" << elapsed << qCDebug(entities) << "ModelEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
"now=" << now << " getLastEdited()=" << getLastEdited(); "now=" << now << " getLastEdited()=" << getLastEdited();
} }
setLastEdited(properties._lastEdited); setLastEdited(properties._lastEdited);
@ -266,12 +267,12 @@ void ModelEntityItem::update(const quint64& now) {
} }
void ModelEntityItem::debugDump() const { void ModelEntityItem::debugDump() const {
qDebug() << "ModelEntityItem id:" << getEntityItemID(); qCDebug(entities) << "ModelEntityItem id:" << getEntityItemID();
qDebug() << " edited ago:" << getEditedAgo(); qCDebug(entities) << " edited ago:" << getEditedAgo();
qDebug() << " position:" << getPosition(); qCDebug(entities) << " position:" << getPosition();
qDebug() << " dimensions:" << getDimensions(); qCDebug(entities) << " dimensions:" << getDimensions();
qDebug() << " model URL:" << getModelURL(); qCDebug(entities) << " model URL:" << getModelURL();
qDebug() << " collision model URL:" << getCollisionModelURL(); qCDebug(entities) << " collision model URL:" << getCollisionModelURL();
} }
void ModelEntityItem::updateShapeType(ShapeType type) { void ModelEntityItem::updateShapeType(ShapeType type) {
@ -296,11 +297,11 @@ void ModelEntityItem::setAnimationURL(const QString& url) {
void ModelEntityItem::setAnimationFrameIndex(float value) { void ModelEntityItem::setAnimationFrameIndex(float value) {
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
if (isAnimatingSomething()) { if (isAnimatingSomething()) {
qDebug() << "ModelEntityItem::setAnimationFrameIndex()"; qCDebug(entities) << "ModelEntityItem::setAnimationFrameIndex()";
qDebug() << " value:" << value; qCDebug(entities) << " value:" << value;
qDebug() << " was:" << _animationLoop.getFrameIndex(); qCDebug(entities) << " was:" << _animationLoop.getFrameIndex();
qDebug() << " model URL:" << getModelURL(); qCDebug(entities) << " model URL:" << getModelURL();
qDebug() << " animation URL:" << getAnimationURL(); qCDebug(entities) << " animation URL:" << getAnimationURL();
} }
#endif #endif
_animationLoop.setFrameIndex(value); _animationLoop.setFrameIndex(value);
@ -323,12 +324,12 @@ void ModelEntityItem::setAnimationSettings(const QString& value) {
float frameIndex = settingsMap["frameIndex"].toFloat(); float frameIndex = settingsMap["frameIndex"].toFloat();
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
if (isAnimatingSomething()) { if (isAnimatingSomething()) {
qDebug() << "ModelEntityItem::setAnimationSettings() calling setAnimationFrameIndex()..."; qCDebug(entities) << "ModelEntityItem::setAnimationSettings() calling setAnimationFrameIndex()...";
qDebug() << " model URL:" << getModelURL(); qCDebug(entities) << " model URL:" << getModelURL();
qDebug() << " animation URL:" << getAnimationURL(); qCDebug(entities) << " animation URL:" << getAnimationURL();
qDebug() << " settings:" << value; qCDebug(entities) << " settings:" << value;
qDebug() << " settingsMap[frameIndex]:" << settingsMap["frameIndex"]; qCDebug(entities) << " settingsMap[frameIndex]:" << settingsMap["frameIndex"];
qDebug(" frameIndex: %20.5f", frameIndex); qCDebug(entities" frameIndex: %20.5f", frameIndex);
} }
#endif #endif

View file

@ -12,6 +12,7 @@
#include "EntityItem.h" #include "EntityItem.h"
#include "EntityTree.h" #include "EntityTree.h"
#include "EntityTreeElement.h" #include "EntityTreeElement.h"
#include "EntitiesLogging.h"
#include "MovingEntitiesOperator.h" #include "MovingEntitiesOperator.h"
@ -28,19 +29,19 @@ MovingEntitiesOperator::MovingEntitiesOperator(EntityTree* tree) :
MovingEntitiesOperator::~MovingEntitiesOperator() { MovingEntitiesOperator::~MovingEntitiesOperator() {
if (_wantDebug) { if (_wantDebug) {
bool stopExecution = false; bool stopExecution = false;
qDebug() << "MovingEntitiesOperator::~MovingEntitiesOperator() -----------------------------"; qCDebug(entities) << "MovingEntitiesOperator::~MovingEntitiesOperator() -----------------------------";
qDebug() << " _lookingCount:" << _lookingCount; qCDebug(entities) << " _lookingCount:" << _lookingCount;
qDebug() << " _foundOldCount:" << _foundOldCount; qCDebug(entities) << " _foundOldCount:" << _foundOldCount;
qDebug() << " _foundNewCount:" << _foundNewCount; qCDebug(entities) << " _foundNewCount:" << _foundNewCount;
if (_foundOldCount < _lookingCount) { if (_foundOldCount < _lookingCount) {
qDebug() << " FAILURE: **** _foundOldCount < _lookingCount ******"; qCDebug(entities) << " FAILURE: **** _foundOldCount < _lookingCount ******";
stopExecution = true; stopExecution = true;
} }
if (_foundNewCount < _lookingCount) { if (_foundNewCount < _lookingCount) {
qDebug() << " FAILURE: **** _foundNewCount < _lookingCount ******"; qCDebug(entities) << " FAILURE: **** _foundNewCount < _lookingCount ******";
stopExecution = true; stopExecution = true;
} }
qDebug() << "--------------------------------------------------------------------------"; qCDebug(entities) << "--------------------------------------------------------------------------";
if(stopExecution) { if(stopExecution) {
debug(); debug();
assert(false); assert(false);
@ -54,20 +55,20 @@ void MovingEntitiesOperator::addEntityToMoveList(EntityItem* entity, const AACub
AABox newCubeClamped = newCube.clamp(0.0f, (float)TREE_SCALE); AABox newCubeClamped = newCube.clamp(0.0f, (float)TREE_SCALE);
if (_wantDebug) { if (_wantDebug) {
qDebug() << "MovingEntitiesOperator::addEntityToMoveList() -----------------------------"; qCDebug(entities) << "MovingEntitiesOperator::addEntityToMoveList() -----------------------------";
qDebug() << " newCube:" << newCube; qCDebug(entities) << " newCube:" << newCube;
qDebug() << " newCubeClamped:" << newCubeClamped; qCDebug(entities) << " newCubeClamped:" << newCubeClamped;
if (oldContainingElement) { if (oldContainingElement) {
qDebug() << " oldContainingElement:" << oldContainingElement->getAACube(); qCDebug(entities) << " oldContainingElement:" << oldContainingElement->getAACube();
qDebug() << " oldContainingElement->bestFitBounds(newCubeClamped):" qCDebug(entities) << " oldContainingElement->bestFitBounds(newCubeClamped):"
<< oldContainingElement->bestFitBounds(newCubeClamped); << oldContainingElement->bestFitBounds(newCubeClamped);
} else { } else {
qDebug() << " WARNING NO OLD CONTAINING ELEMENT!!!"; qCDebug(entities) << " WARNING NO OLD CONTAINING ELEMENT!!!";
} }
} }
if (!oldContainingElement) { if (!oldContainingElement) {
qDebug() << "UNEXPECTED!!!! attempting to move entity "<< entity->getEntityItemID() qCDebug(entities) << "UNEXPECTED!!!! attempting to move entity "<< entity->getEntityItemID()
<< "that has no containing element. "; << "that has no containing element. ";
return; // bail without adding. return; // bail without adding.
} }
@ -88,22 +89,22 @@ void MovingEntitiesOperator::addEntityToMoveList(EntityItem* entity, const AACub
_lookingCount++; _lookingCount++;
if (_wantDebug) { if (_wantDebug) {
qDebug() << "MovingEntitiesOperator::addEntityToMoveList() -----------------------------"; qCDebug(entities) << "MovingEntitiesOperator::addEntityToMoveList() -----------------------------";
qDebug() << " details.entity:" << details.entity->getEntityItemID(); qCDebug(entities) << " details.entity:" << details.entity->getEntityItemID();
qDebug() << " details.oldContainingElementCube:" << details.oldContainingElementCube; qCDebug(entities) << " details.oldContainingElementCube:" << details.oldContainingElementCube;
qDebug() << " details.newCube:" << details.newCube; qCDebug(entities) << " details.newCube:" << details.newCube;
qDebug() << " details.newCubeClamped:" << details.newCubeClamped; qCDebug(entities) << " details.newCubeClamped:" << details.newCubeClamped;
qDebug() << " _lookingCount:" << _lookingCount; qCDebug(entities) << " _lookingCount:" << _lookingCount;
qDebug() << "--------------------------------------------------------------------------"; qCDebug(entities) << "--------------------------------------------------------------------------";
} }
} else { } else {
if (_wantDebug) { if (_wantDebug) {
qDebug() << " oldContainingElement->bestFitBounds(newCubeClamped) IS BEST FIT... NOTHING TO DO"; qCDebug(entities) << " oldContainingElement->bestFitBounds(newCubeClamped) IS BEST FIT... NOTHING TO DO";
} }
} }
if (_wantDebug) { if (_wantDebug) {
qDebug() << "--------------------------------------------------------------------------"; qCDebug(entities) << "--------------------------------------------------------------------------";
} }
} }
@ -119,15 +120,15 @@ bool MovingEntitiesOperator::shouldRecurseSubTree(OctreeElement* element) {
foreach(const EntityToMoveDetails& details, _entitiesToMove) { foreach(const EntityToMoveDetails& details, _entitiesToMove) {
if (_wantDebug) { if (_wantDebug) {
qDebug() << "MovingEntitiesOperator::shouldRecurseSubTree() details["<< detailIndex <<"]-----------------------------"; qCDebug(entities) << "MovingEntitiesOperator::shouldRecurseSubTree() details["<< detailIndex <<"]-----------------------------";
qDebug() << " element:" << element->getAACube(); qCDebug(entities) << " element:" << element->getAACube();
qDebug() << " details.entity:" << details.entity->getEntityItemID(); qCDebug(entities) << " details.entity:" << details.entity->getEntityItemID();
qDebug() << " details.oldContainingElementCube:" << details.oldContainingElementCube; qCDebug(entities) << " details.oldContainingElementCube:" << details.oldContainingElementCube;
qDebug() << " details.newCube:" << details.newCube; qCDebug(entities) << " details.newCube:" << details.newCube;
qDebug() << " details.newCubeClamped:" << details.newCubeClamped; qCDebug(entities) << " details.newCubeClamped:" << details.newCubeClamped;
qDebug() << " elementCube.contains(details.newCube)" << elementCube.contains(details.newCube); qCDebug(entities) << " elementCube.contains(details.newCube)" << elementCube.contains(details.newCube);
qDebug() << " elementCube.contains(details.newCubeClamped)" << elementCube.contains(details.newCubeClamped); qCDebug(entities) << " elementCube.contains(details.newCubeClamped)" << elementCube.contains(details.newCubeClamped);
qDebug() << "--------------------------------------------------------------------------"; qCDebug(entities) << "--------------------------------------------------------------------------";
} }
if (elementCube.contains(details.oldContainingElementCube) || elementCube.contains(details.newCubeClamped)) { if (elementCube.contains(details.oldContainingElementCube) || elementCube.contains(details.newCubeClamped)) {
@ -163,17 +164,17 @@ bool MovingEntitiesOperator::preRecursion(OctreeElement* element) {
foreach(const EntityToMoveDetails& details, _entitiesToMove) { foreach(const EntityToMoveDetails& details, _entitiesToMove) {
if (_wantDebug) { if (_wantDebug) {
qDebug() << "MovingEntitiesOperator::preRecursion() details["<< detailIndex <<"]-----------------------------"; qCDebug(entities) << "MovingEntitiesOperator::preRecursion() details["<< detailIndex <<"]-----------------------------";
qDebug() << " entityTreeElement:" << entityTreeElement->getAACube(); qCDebug(entities) << " entityTreeElement:" << entityTreeElement->getAACube();
qDebug() << " entityTreeElement->bestFitBounds(details.newCube):" << entityTreeElement->bestFitBounds(details.newCube); qCDebug(entities) << " entityTreeElement->bestFitBounds(details.newCube):" << entityTreeElement->bestFitBounds(details.newCube);
qDebug() << " details.entity:" << details.entity->getEntityItemID(); qCDebug(entities) << " details.entity:" << details.entity->getEntityItemID();
qDebug() << " details.oldContainingElementCube:" << details.oldContainingElementCube; qCDebug(entities) << " details.oldContainingElementCube:" << details.oldContainingElementCube;
qDebug() << " entityTreeElement:" << entityTreeElement; qCDebug(entities) << " entityTreeElement:" << entityTreeElement;
qDebug() << " details.newCube:" << details.newCube; qCDebug(entities) << " details.newCube:" << details.newCube;
qDebug() << " details.newCubeClamped:" << details.newCubeClamped; qCDebug(entities) << " details.newCubeClamped:" << details.newCubeClamped;
qDebug() << " _lookingCount:" << _lookingCount; qCDebug(entities) << " _lookingCount:" << _lookingCount;
qDebug() << " _foundOldCount:" << _foundOldCount; qCDebug(entities) << " _foundOldCount:" << _foundOldCount;
qDebug() << "--------------------------------------------------------------------------"; qCDebug(entities) << "--------------------------------------------------------------------------";
} }
@ -183,10 +184,10 @@ bool MovingEntitiesOperator::preRecursion(OctreeElement* element) {
_foundOldCount++; _foundOldCount++;
//details.oldFound = true; // TODO: would be nice to add this optimization //details.oldFound = true; // TODO: would be nice to add this optimization
if (_wantDebug) { if (_wantDebug) {
qDebug() << "MovingEntitiesOperator::preRecursion() -----------------------------"; qCDebug(entities) << "MovingEntitiesOperator::preRecursion() -----------------------------";
qDebug() << " FOUND OLD - REMOVING"; qCDebug(entities) << " FOUND OLD - REMOVING";
qDebug() << " entityTreeElement == details.oldContainingElement"; qCDebug(entities) << " entityTreeElement == details.oldContainingElement";
qDebug() << "--------------------------------------------------------------------------"; qCDebug(entities) << "--------------------------------------------------------------------------";
} }
} }
@ -205,10 +206,10 @@ bool MovingEntitiesOperator::preRecursion(OctreeElement* element) {
_foundNewCount++; _foundNewCount++;
//details.newFound = true; // TODO: would be nice to add this optimization //details.newFound = true; // TODO: would be nice to add this optimization
if (_wantDebug) { if (_wantDebug) {
qDebug() << "MovingEntitiesOperator::preRecursion() -----------------------------"; qCDebug(entities) << "MovingEntitiesOperator::preRecursion() -----------------------------";
qDebug() << " FOUND NEW - ADDING"; qCDebug(entities) << " FOUND NEW - ADDING";
qDebug() << " entityTreeElement->bestFitBounds(details.newCube)"; qCDebug(entities) << " entityTreeElement->bestFitBounds(details.newCube)";
qDebug() << "--------------------------------------------------------------------------"; qCDebug(entities) << "--------------------------------------------------------------------------";
} }
} }
detailIndex++; detailIndex++;

View file

@ -42,6 +42,7 @@
#include "EntityTree.h" #include "EntityTree.h"
#include "EntityTreeElement.h" #include "EntityTreeElement.h"
#include "EntitiesLogging.h"
#include "ParticleEffectEntityItem.h" #include "ParticleEffectEntityItem.h"
const float ParticleEffectEntityItem::DEFAULT_ANIMATION_FRAME_INDEX = 0.0f; const float ParticleEffectEntityItem::DEFAULT_ANIMATION_FRAME_INDEX = 0.0f;
@ -137,7 +138,7 @@ bool ParticleEffectEntityItem::setProperties(const EntityItemProperties& propert
if (wantDebug) { if (wantDebug) {
uint64_t now = usecTimestampNow(); uint64_t now = usecTimestampNow();
int elapsed = now - getLastEdited(); int elapsed = now - getLastEdited();
qDebug() << "ParticleEffectEntityItem::setProperties() AFTER update... edited AGO=" << elapsed << qCDebug(entities) << "ParticleEffectEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
"now=" << now << " getLastEdited()=" << getLastEdited(); "now=" << now << " getLastEdited()=" << getLastEdited();
} }
setLastEdited(properties.getLastEdited()); setLastEdited(properties.getLastEdited());
@ -278,11 +279,11 @@ void ParticleEffectEntityItem::update(const quint64& now) {
void ParticleEffectEntityItem::debugDump() const { void ParticleEffectEntityItem::debugDump() const {
quint64 now = usecTimestampNow(); quint64 now = usecTimestampNow();
qDebug() << "PA EFFECT EntityItem id:" << getEntityItemID() << "---------------------------------------------"; qCDebug(entities) << "PA EFFECT EntityItem id:" << getEntityItemID() << "---------------------------------------------";
qDebug() << " color:" << _color[0] << "," << _color[1] << "," << _color[2]; qCDebug(entities) << " color:" << _color[0] << "," << _color[1] << "," << _color[2];
qDebug() << " position:" << debugTreeVector(_position); qCDebug(entities) << " position:" << debugTreeVector(_position);
qDebug() << " dimensions:" << debugTreeVector(_dimensions); qCDebug(entities) << " dimensions:" << debugTreeVector(_dimensions);
qDebug() << " getLastEdited:" << debugTime(getLastEdited(), now); qCDebug(entities) << " getLastEdited:" << debugTime(getLastEdited(), now);
} }
void ParticleEffectEntityItem::updateShapeType(ShapeType type) { void ParticleEffectEntityItem::updateShapeType(ShapeType type) {
@ -295,9 +296,9 @@ void ParticleEffectEntityItem::updateShapeType(ShapeType type) {
void ParticleEffectEntityItem::setAnimationFrameIndex(float value) { void ParticleEffectEntityItem::setAnimationFrameIndex(float value) {
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
if (isAnimatingSomething()) { if (isAnimatingSomething()) {
qDebug() << "ParticleEffectEntityItem::setAnimationFrameIndex()"; qCDebug(entities) << "ParticleEffectEntityItem::setAnimationFrameIndex()";
qDebug() << " value:" << value; qCDebug(entities) << " value:" << value;
qDebug() << " was:" << _animationLoop.getFrameIndex(); qCDebug(entities) << " was:" << _animationLoop.getFrameIndex();
} }
#endif #endif
_animationLoop.setFrameIndex(value); _animationLoop.setFrameIndex(value);
@ -320,10 +321,10 @@ void ParticleEffectEntityItem::setAnimationSettings(const QString& value) {
float frameIndex = settingsMap["frameIndex"].toFloat(); float frameIndex = settingsMap["frameIndex"].toFloat();
#ifdef WANT_DEBUG #ifdef WANT_DEBUG
if (isAnimatingSomething()) { if (isAnimatingSomething()) {
qDebug() << "ParticleEffectEntityItem::setAnimationSettings() calling setAnimationFrameIndex()..."; qCDebug(entities) << "ParticleEffectEntityItem::setAnimationSettings() calling setAnimationFrameIndex()...";
qDebug() << " settings:" << value; qCDebug(entities) << " settings:" << value;
qDebug() << " settingsMap[frameIndex]:" << settingsMap["frameIndex"]; qCDebug(entities) << " settingsMap[frameIndex]:" << settingsMap["frameIndex"];
qDebug(" frameIndex: %20.5f", frameIndex); qCDebug(entities" frameIndex: %20.5f", frameIndex);
} }
#endif #endif

View file

@ -19,6 +19,7 @@
#include "EntityTree.h" #include "EntityTree.h"
#include "EntityTreeElement.h" #include "EntityTreeElement.h"
#include "EntitiesLogging.h"
#include "SphereEntityItem.h" #include "SphereEntityItem.h"
@ -51,7 +52,7 @@ bool SphereEntityItem::setProperties(const EntityItemProperties& properties) {
if (wantDebug) { if (wantDebug) {
uint64_t now = usecTimestampNow(); uint64_t now = usecTimestampNow();
int elapsed = now - getLastEdited(); int elapsed = now - getLastEdited();
qDebug() << "SphereEntityItem::setProperties() AFTER update... edited AGO=" << elapsed << qCDebug(entities) << "SphereEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
"now=" << now << " getLastEdited()=" << getLastEdited(); "now=" << now << " getLastEdited()=" << getLastEdited();
} }
setLastEdited(properties.getLastEdited()); setLastEdited(properties.getLastEdited());
@ -120,10 +121,10 @@ bool SphereEntityItem::findDetailedRayIntersection(const glm::vec3& origin, cons
void SphereEntityItem::debugDump() const { void SphereEntityItem::debugDump() const {
quint64 now = usecTimestampNow(); quint64 now = usecTimestampNow();
qDebug() << "SHPERE EntityItem id:" << getEntityItemID() << "---------------------------------------------"; qCDebug(entities) << "SHPERE EntityItem id:" << getEntityItemID() << "---------------------------------------------";
qDebug() << " color:" << _color[0] << "," << _color[1] << "," << _color[2]; qCDebug(entities) << " color:" << _color[0] << "," << _color[1] << "," << _color[2];
qDebug() << " position:" << debugTreeVector(_position); qCDebug(entities) << " position:" << debugTreeVector(_position);
qDebug() << " dimensions:" << debugTreeVector(_dimensions); qCDebug(entities) << " dimensions:" << debugTreeVector(_dimensions);
qDebug() << " getLastEdited:" << debugTime(getLastEdited(), now); qCDebug(entities) << " getLastEdited:" << debugTime(getLastEdited(), now);
} }

View file

@ -19,6 +19,7 @@
#include "EntityTree.h" #include "EntityTree.h"
#include "EntityTreeElement.h" #include "EntityTreeElement.h"
#include "EntitiesLogging.h"
#include "TextEntityItem.h" #include "TextEntityItem.h"
@ -76,7 +77,7 @@ bool TextEntityItem::setProperties(const EntityItemProperties& properties) {
if (wantDebug) { if (wantDebug) {
uint64_t now = usecTimestampNow(); uint64_t now = usecTimestampNow();
int elapsed = now - getLastEdited(); int elapsed = now - getLastEdited();
qDebug() << "TextEntityItem::setProperties() AFTER update... edited AGO=" << elapsed << qCDebug(entities) << "TextEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
"now=" << now << " getLastEdited()=" << getLastEdited(); "now=" << now << " getLastEdited()=" << getLastEdited();
} }
setLastEdited(properties._lastEdited); setLastEdited(properties._lastEdited);

View file

@ -12,6 +12,7 @@
#include "EntityItem.h" #include "EntityItem.h"
#include "EntityTree.h" #include "EntityTree.h"
#include "EntityTreeElement.h" #include "EntityTreeElement.h"
#include "EntitiesLogging.h"
#include "UpdateEntityOperator.h" #include "UpdateEntityOperator.h"
@ -38,7 +39,7 @@ UpdateEntityOperator::UpdateEntityOperator(EntityTree* tree,
assert(_containingElement && _existingEntity); assert(_containingElement && _existingEntity);
if (_wantDebug) { if (_wantDebug) {
qDebug() << "UpdateEntityOperator::UpdateEntityOperator() -----------------------------"; qCDebug(entities) << "UpdateEntityOperator::UpdateEntityOperator() -----------------------------";
} }
// Here we have a choice to make, do we want to "tight fit" the actual minimum for the // Here we have a choice to make, do we want to "tight fit" the actual minimum for the
@ -63,7 +64,7 @@ UpdateEntityOperator::UpdateEntityOperator(EntityTree* tree,
_properties.setDimensions(oldDimensions); _properties.setDimensions(oldDimensions);
if (_wantDebug) { if (_wantDebug) {
qDebug() << " ** setting properties dimensions - had position change, no dimension change **"; qCDebug(entities) << " ** setting properties dimensions - had position change, no dimension change **";
} }
} }
@ -72,7 +73,7 @@ UpdateEntityOperator::UpdateEntityOperator(EntityTree* tree,
_properties.setPosition(oldPosition); _properties.setPosition(oldPosition);
if (_wantDebug) { if (_wantDebug) {
qDebug() << " ** setting properties position - had dimensions change, no position change **"; qCDebug(entities) << " ** setting properties position - had dimensions change, no position change **";
} }
} }
@ -86,7 +87,7 @@ UpdateEntityOperator::UpdateEntityOperator(EntityTree* tree,
oldElementBestFit = _containingElement->bestFitBounds(_oldEntityBox); oldElementBestFit = _containingElement->bestFitBounds(_oldEntityBox);
if (_wantDebug) { if (_wantDebug) {
qDebug() << " ** old Element best fit - no dimensions change, no position change **"; qCDebug(entities) << " ** old Element best fit - no dimensions change, no position change **";
} }
} }
@ -98,7 +99,7 @@ UpdateEntityOperator::UpdateEntityOperator(EntityTree* tree,
_removeOld = true; // our properties are going to move us, so remember this for later processing _removeOld = true; // our properties are going to move us, so remember this for later processing
if (_wantDebug) { if (_wantDebug) {
qDebug() << " **** UNUSUAL CASE **** no changes, but not best fit... consider it a move.... **"; qCDebug(entities) << " **** UNUSUAL CASE **** no changes, but not best fit... consider it a move.... **";
} }
@ -108,9 +109,9 @@ UpdateEntityOperator::UpdateEntityOperator(EntityTree* tree,
_dontMove = true; _dontMove = true;
if (_wantDebug) { if (_wantDebug) {
qDebug() << " **** TYPICAL NO MOVE CASE ****"; qCDebug(entities) << " **** TYPICAL NO MOVE CASE ****";
qDebug() << " _properties.containsBoundsProperties():" << _properties.containsBoundsProperties(); qCDebug(entities) << " _properties.containsBoundsProperties():" << _properties.containsBoundsProperties();
qDebug() << " oldElementBestFit:" << oldElementBestFit; qCDebug(entities) << " oldElementBestFit:" << oldElementBestFit;
} }
} else { } else {
@ -118,7 +119,7 @@ UpdateEntityOperator::UpdateEntityOperator(EntityTree* tree,
_removeOld = true; // our properties are going to move us, so remember this for later processing _removeOld = true; // our properties are going to move us, so remember this for later processing
if (_wantDebug) { if (_wantDebug) {
qDebug() << " **** TYPICAL MOVE CASE ****"; qCDebug(entities) << " **** TYPICAL MOVE CASE ****";
} }
} }
@ -126,13 +127,13 @@ UpdateEntityOperator::UpdateEntityOperator(EntityTree* tree,
if (_wantDebug) { if (_wantDebug) {
qDebug() << " _entityItemID:" << _entityItemID; qCDebug(entities) << " _entityItemID:" << _entityItemID;
qDebug() << " _containingElementCube:" << _containingElementCube; qCDebug(entities) << " _containingElementCube:" << _containingElementCube;
qDebug() << " _oldEntityCube:" << _oldEntityCube; qCDebug(entities) << " _oldEntityCube:" << _oldEntityCube;
qDebug() << " _oldEntityBox:" << _oldEntityBox; qCDebug(entities) << " _oldEntityBox:" << _oldEntityBox;
qDebug() << " _newEntityCube:" << _newEntityCube; qCDebug(entities) << " _newEntityCube:" << _newEntityCube;
qDebug() << " _newEntityBox:" << _newEntityBox; qCDebug(entities) << " _newEntityBox:" << _newEntityBox;
qDebug() << "--------------------------------------------------------------------------"; qCDebug(entities) << "--------------------------------------------------------------------------";
} }
} }
@ -151,12 +152,12 @@ bool UpdateEntityOperator::subTreeContainsOldEntity(OctreeElement* element) {
if (_wantDebug) { if (_wantDebug) {
bool elementContainsOldCube = element->getAACube().contains(_oldEntityCube); bool elementContainsOldCube = element->getAACube().contains(_oldEntityCube);
qDebug() << "UpdateEntityOperator::subTreeContainsOldEntity()...."; qCDebug(entities) << "UpdateEntityOperator::subTreeContainsOldEntity()....";
qDebug() << " element->getAACube()=" << element->getAACube(); qCDebug(entities) << " element->getAACube()=" << element->getAACube();
qDebug() << " _oldEntityCube=" << _oldEntityCube; qCDebug(entities) << " _oldEntityCube=" << _oldEntityCube;
qDebug() << " _oldEntityBox=" << _oldEntityBox; qCDebug(entities) << " _oldEntityBox=" << _oldEntityBox;
qDebug() << " elementContainsOldCube=" << elementContainsOldCube; qCDebug(entities) << " elementContainsOldCube=" << elementContainsOldCube;
qDebug() << " elementContainsOldBox=" << elementContainsOldBox; qCDebug(entities) << " elementContainsOldBox=" << elementContainsOldBox;
} }
return elementContainsOldBox; return elementContainsOldBox;
} }
@ -166,12 +167,12 @@ bool UpdateEntityOperator::subTreeContainsNewEntity(OctreeElement* element) {
if (_wantDebug) { if (_wantDebug) {
bool elementContainsNewCube = element->getAACube().contains(_newEntityCube); bool elementContainsNewCube = element->getAACube().contains(_newEntityCube);
qDebug() << "UpdateEntityOperator::subTreeContainsNewEntity()...."; qCDebug(entities) << "UpdateEntityOperator::subTreeContainsNewEntity()....";
qDebug() << " element->getAACube()=" << element->getAACube(); qCDebug(entities) << " element->getAACube()=" << element->getAACube();
qDebug() << " _newEntityCube=" << _newEntityCube; qCDebug(entities) << " _newEntityCube=" << _newEntityCube;
qDebug() << " _newEntityBox=" << _newEntityBox; qCDebug(entities) << " _newEntityBox=" << _newEntityBox;
qDebug() << " elementContainsNewCube=" << elementContainsNewCube; qCDebug(entities) << " elementContainsNewCube=" << elementContainsNewCube;
qDebug() << " elementContainsNewBox=" << elementContainsNewBox; qCDebug(entities) << " elementContainsNewBox=" << elementContainsNewBox;
} }
return elementContainsNewBox; return elementContainsNewBox;
@ -196,12 +197,12 @@ bool UpdateEntityOperator::preRecursion(OctreeElement* element) {
bool subtreeContainsNew = subTreeContainsNewEntity(element); bool subtreeContainsNew = subTreeContainsNewEntity(element);
if (_wantDebug) { if (_wantDebug) {
qDebug() << "---- UpdateEntityOperator::preRecursion().... ----"; qCDebug(entities) << "---- UpdateEntityOperator::preRecursion().... ----";
qDebug() << " element=" << element->getAACube(); qCDebug(entities) << " element=" << element->getAACube();
qDebug() << " subtreeContainsOld=" << subtreeContainsOld; qCDebug(entities) << " subtreeContainsOld=" << subtreeContainsOld;
qDebug() << " subtreeContainsNew=" << subtreeContainsNew; qCDebug(entities) << " subtreeContainsNew=" << subtreeContainsNew;
qDebug() << " _foundOld=" << _foundOld; qCDebug(entities) << " _foundOld=" << _foundOld;
qDebug() << " _foundNew=" << _foundNew; qCDebug(entities) << " _foundNew=" << _foundNew;
} }
// If we haven't yet found the old entity, and this subTreeContains our old // If we haven't yet found the old entity, and this subTreeContains our old
@ -209,9 +210,9 @@ bool UpdateEntityOperator::preRecursion(OctreeElement* element) {
if (!_foundOld && subtreeContainsOld) { if (!_foundOld && subtreeContainsOld) {
if (_wantDebug) { if (_wantDebug) {
qDebug() << " OLD TREE CASE...."; qCDebug(entities) << " OLD TREE CASE....";
qDebug() << " entityTreeElement=" << entityTreeElement; qCDebug(entities) << " entityTreeElement=" << entityTreeElement;
qDebug() << " _containingElement=" << _containingElement; qCDebug(entities) << " _containingElement=" << _containingElement;
} }
// If this is the element we're looking for, then ask it to remove the old entity // If this is the element we're looking for, then ask it to remove the old entity
@ -219,7 +220,7 @@ bool UpdateEntityOperator::preRecursion(OctreeElement* element) {
if (entityTreeElement == _containingElement) { if (entityTreeElement == _containingElement) {
if (_wantDebug) { if (_wantDebug) {
qDebug() << " *** it's the OLD ELEMENT! ***"; qCDebug(entities) << " *** it's the OLD ELEMENT! ***";
} }
// If the containgElement IS NOT the best fit for the new entity properties // If the containgElement IS NOT the best fit for the new entity properties
@ -228,7 +229,7 @@ bool UpdateEntityOperator::preRecursion(OctreeElement* element) {
if (_removeOld) { if (_removeOld) {
if (_wantDebug) { if (_wantDebug) {
qDebug() << " *** REMOVING from ELEMENT ***"; qCDebug(entities) << " *** REMOVING from ELEMENT ***";
} }
// the entity knows what element it's in, so we remove it from that one // the entity knows what element it's in, so we remove it from that one
@ -238,12 +239,12 @@ bool UpdateEntityOperator::preRecursion(OctreeElement* element) {
_tree->setContainingElement(_entityItemID, NULL); _tree->setContainingElement(_entityItemID, NULL);
if (oldElement != _containingElement) { if (oldElement != _containingElement) {
qDebug() << "WARNING entity moved during UpdateEntityOperator recursion"; qCDebug(entities) << "WARNING entity moved during UpdateEntityOperator recursion";
_containingElement->removeEntityItem(_existingEntity); _containingElement->removeEntityItem(_existingEntity);
} }
if (_wantDebug) { if (_wantDebug) {
qDebug() << " *** REMOVING from MAP ***"; qCDebug(entities) << " *** REMOVING from MAP ***";
} }
} }
_foundOld = true; _foundOld = true;
@ -258,17 +259,17 @@ bool UpdateEntityOperator::preRecursion(OctreeElement* element) {
if (!_foundNew && subtreeContainsNew) { if (!_foundNew && subtreeContainsNew) {
if (_wantDebug) { if (_wantDebug) {
qDebug() << " NEW TREE CASE...."; qCDebug(entities) << " NEW TREE CASE....";
qDebug() << " entityTreeElement=" << entityTreeElement; qCDebug(entities) << " entityTreeElement=" << entityTreeElement;
qDebug() << " _containingElement=" << _containingElement; qCDebug(entities) << " _containingElement=" << _containingElement;
qDebug() << " entityTreeElement->bestFitBounds(_newEntityBox)=" << entityTreeElement->bestFitBounds(_newEntityBox); qCDebug(entities) << " entityTreeElement->bestFitBounds(_newEntityBox)=" << entityTreeElement->bestFitBounds(_newEntityBox);
} }
// If this element is the best fit for the new entity properties, then add/or update it // If this element is the best fit for the new entity properties, then add/or update it
if (entityTreeElement->bestFitBounds(_newEntityBox)) { if (entityTreeElement->bestFitBounds(_newEntityBox)) {
if (_wantDebug) { if (_wantDebug) {
qDebug() << " *** THIS ELEMENT IS BEST FIT ***"; qCDebug(entities) << " *** THIS ELEMENT IS BEST FIT ***";
} }
EntityTreeElement* oldElement = _existingEntity->getElement(); EntityTreeElement* oldElement = _existingEntity->getElement();
@ -276,20 +277,20 @@ bool UpdateEntityOperator::preRecursion(OctreeElement* element) {
if (entityTreeElement == oldElement) { if (entityTreeElement == oldElement) {
if (_wantDebug) { if (_wantDebug) {
qDebug() << " *** This is the same OLD ELEMENT ***"; qCDebug(entities) << " *** This is the same OLD ELEMENT ***";
} }
// set the entity properties and mark our element as changed. // set the entity properties and mark our element as changed.
_existingEntity->setProperties(_properties); _existingEntity->setProperties(_properties);
if (_wantDebug) { if (_wantDebug) {
qDebug() << " *** set properties ***"; qCDebug(entities) << " *** set properties ***";
} }
} else { } else {
// otherwise, this is an add case. // otherwise, this is an add case.
if (oldElement) { if (oldElement) {
oldElement->removeEntityItem(_existingEntity); oldElement->removeEntityItem(_existingEntity);
if (oldElement != _containingElement) { if (oldElement != _containingElement) {
qDebug() << "WARNING entity moved during UpdateEntityOperator recursion"; qCDebug(entities) << "WARNING entity moved during UpdateEntityOperator recursion";
} }
} }
entityTreeElement->addEntityItem(_existingEntity); entityTreeElement->addEntityItem(_existingEntity);
@ -297,7 +298,7 @@ bool UpdateEntityOperator::preRecursion(OctreeElement* element) {
_existingEntity->setProperties(_properties); // still need to update the properties! _existingEntity->setProperties(_properties); // still need to update the properties!
if (_wantDebug) { if (_wantDebug) {
qDebug() << " *** ADDING ENTITY to ELEMENT and MAP and SETTING PROPERTIES ***"; qCDebug(entities) << " *** ADDING ENTITY to ELEMENT and MAP and SETTING PROPERTIES ***";
} }
} }
_foundNew = true; // we found the new element _foundNew = true; // we found the new element
@ -308,8 +309,8 @@ bool UpdateEntityOperator::preRecursion(OctreeElement* element) {
} }
if (_wantDebug) { if (_wantDebug) {
qDebug() << " FINAL --- keepSearching=" << keepSearching; qCDebug(entities) << " FINAL --- keepSearching=" << keepSearching;
qDebug() << "--------------------------------------------------"; qCDebug(entities) << "--------------------------------------------------";
} }