windows type mismatch warning fixes

This commit is contained in:
Brad Hefta-Gaub 2014-01-13 00:30:23 -08:00
parent 08c9dfbea7
commit 55babbf7b6
24 changed files with 96 additions and 95 deletions

View file

@ -1373,6 +1373,7 @@ static glm::vec3 getFaceVector(BoxFace face) {
case MIN_Z_FACE: case MIN_Z_FACE:
return glm::vec3(0, 0, -1); return glm::vec3(0, 0, -1);
default: // quiet windows warnings
case MAX_Z_FACE: case MAX_Z_FACE:
return glm::vec3(0, 0, 1); return glm::vec3(0, 0, 1);
} }

View file

@ -608,7 +608,7 @@ void Audio::render(int screenWidth, int screenHeight) {
char out[40]; char out[40];
sprintf(out, "%3.0f\n", _averagedLatency); sprintf(out, "%3.0f\n", _averagedLatency);
drawtext(startX + _averagedLatency / AUDIO_CALLBACK_MSECS * frameWidth - 10, topY - 9, 0.10, 0, 1, 0, out, 1,1,0); drawtext(startX + _averagedLatency / AUDIO_CALLBACK_MSECS * frameWidth - 10, topY - 9, 0.10f, 0, 1, 0, out, 1,1,0);
// Show a red bar with the 'start' point of one frame plus the jitter buffer // Show a red bar with the 'start' point of one frame plus the jitter buffer
@ -616,12 +616,12 @@ void Audio::render(int screenWidth, int screenHeight) {
int jitterBufferPels = (1.f + (float)getJitterBufferSamples() int jitterBufferPels = (1.f + (float)getJitterBufferSamples()
/ (float) NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL) * frameWidth; / (float) NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL) * frameWidth;
sprintf(out, "%.0f\n", getJitterBufferSamples() / SAMPLE_RATE * 1000.f); sprintf(out, "%.0f\n", getJitterBufferSamples() / SAMPLE_RATE * 1000.f);
drawtext(startX + jitterBufferPels - 5, topY - 9, 0.10, 0, 1, 0, out, 1, 0, 0); drawtext(startX + jitterBufferPels - 5, topY - 9, 0.10f, 0, 1, 0, out, 1, 0, 0);
sprintf(out, "j %.1f\n", _measuredJitter); sprintf(out, "j %.1f\n", _measuredJitter);
if (Menu::getInstance()->getAudioJitterBufferSamples() == 0) { if (Menu::getInstance()->getAudioJitterBufferSamples() == 0) {
drawtext(startX + jitterBufferPels - 5, bottomY + 12, 0.10, 0, 1, 0, out, 1, 0, 0); drawtext(startX + jitterBufferPels - 5, bottomY + 12, 0.10f, 0, 1, 0, out, 1, 0, 0);
} else { } else {
drawtext(startX, bottomY + 12, 0.10, 0, 1, 0, out, 1, 0, 0); drawtext(startX, bottomY + 12, 0.10f, 0, 1, 0, out, 1, 0, 0);
} }
glBegin(GL_QUADS); glBegin(GL_QUADS);
@ -637,8 +637,8 @@ void Audio::render(int screenWidth, int screenHeight) {
// Take a pointer to the acquired microphone input samples and add procedural sounds // Take a pointer to the acquired microphone input samples and add procedural sounds
void Audio::addProceduralSounds(int16_t* monoInput, int numSamples) { void Audio::addProceduralSounds(int16_t* monoInput, int numSamples) {
const float MAX_AUDIBLE_VELOCITY = 6.0; const float MAX_AUDIBLE_VELOCITY = 6.0f;
const float MIN_AUDIBLE_VELOCITY = 0.1; const float MIN_AUDIBLE_VELOCITY = 0.1f;
const int VOLUME_BASELINE = 400; const int VOLUME_BASELINE = 400;
const float SOUND_PITCH = 8.f; const float SOUND_PITCH = 8.f;

View file

@ -23,7 +23,7 @@ Cloud::Cloud() {
_particles = new Particle[_count]; _particles = new Particle[_count];
_field = new Field(PARTICLE_WORLD_SIZE, FIELD_COUPLE); _field = new Field(PARTICLE_WORLD_SIZE, FIELD_COUPLE);
for (int i = 0; i < _count; i++) { for (unsigned int i = 0; i < _count; i++) {
_particles[i].position = randVector() * box; _particles[i].position = randVector() * box;
const float INIT_VEL_SCALE = 0.03f; const float INIT_VEL_SCALE = 0.03f;
_particles[i].velocity = randVector() * ((float)PARTICLE_WORLD_SIZE * INIT_VEL_SCALE); _particles[i].velocity = randVector() * ((float)PARTICLE_WORLD_SIZE * INIT_VEL_SCALE);

View file

@ -135,7 +135,7 @@ void DataServerClient::processSendFromDataServer(unsigned char* packetData, int
QStringList valueList = QString(valuesPosition).split(MULTI_KEY_VALUE_SEPARATOR); QStringList valueList = QString(valuesPosition).split(MULTI_KEY_VALUE_SEPARATOR);
// user string was UUID, find matching avatar and associate data // user string was UUID, find matching avatar and associate data
for (size_t i = 0; i < keyList.size(); i++) { for (int i = 0; i < keyList.size(); i++) {
if (valueList[i] != " ") { if (valueList[i] != " ") {
if (keyList[i] == DataServerKey::FaceMeshURL) { if (keyList[i] == DataServerKey::FaceMeshURL) {

View file

@ -26,7 +26,7 @@ const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths
const glm::vec3 UP_VECT = glm::vec3(0, 1, 0); const glm::vec3 UP_VECT = glm::vec3(0, 1, 0);
const float ANGULAR_RATE = 0.02f; const float ANGULAR_RATE = 0.02f;
const float VERTICAL_ANGLE = M_PI_4 / 2.0f; const float VERTICAL_ANGLE = (float)M_PI_4 / 2.0f;
const float RETURN_RATE = 0.02f; const float RETURN_RATE = 0.02f;
const float NEAR_CLIP = 0.5f; const float NEAR_CLIP = 0.5f;
const float FAR_CLIP = 10.0f; const float FAR_CLIP = 10.0f;

View file

@ -762,7 +762,7 @@ void sendFakeEnterEvent() {
} }
const int QLINE_MINIMUM_WIDTH = 400; const int QLINE_MINIMUM_WIDTH = 400;
const float DIALOG_RATIO_OF_WINDOW = 0.30; const float DIALOG_RATIO_OF_WINDOW = 0.30f;
void Menu::login() { void Menu::login() {
QInputDialog loginDialog(Application::getInstance()->getWindow()); QInputDialog loginDialog(Application::getInstance()->getWindow());

View file

@ -205,7 +205,7 @@ void VoxelSystem::freeBufferIndex(glBufferIndex index) {
// make sure the index isn't already in the free list..., this is a debugging measure only done if you've enabled audits // make sure the index isn't already in the free list..., this is a debugging measure only done if you've enabled audits
if (Menu::getInstance()->isOptionChecked(MenuOption::AutomaticallyAuditTree)) { if (Menu::getInstance()->isOptionChecked(MenuOption::AutomaticallyAuditTree)) {
for (long i = 0; i < _freeIndexes.size(); i++) { for (unsigned long i = 0; i < _freeIndexes.size(); i++) {
if (_freeIndexes[i] == index) { if (_freeIndexes[i] == index) {
printf("freeBufferIndex(glBufferIndex index)... index=%ld already in free list!\n", index); printf("freeBufferIndex(glBufferIndex index)... index=%ld already in free list!\n", index);
inList = true; inList = true;
@ -382,7 +382,7 @@ void VoxelSystem::setupFaceIndices(GLuint& faceVBOID, GLubyte faceIdentityIndice
// populate the indicesArray // populate the indicesArray
// this will not change given new voxels, so we can set it all up now // this will not change given new voxels, so we can set it all up now
for (int n = 0; n < _maxVoxels; n++) { for (unsigned long n = 0; n < _maxVoxels; n++) {
// fill the indices array // fill the indices array
int voxelIndexOffset = n * INDICES_PER_FACE; int voxelIndexOffset = n * INDICES_PER_FACE;
GLuint* currentIndicesPos = indicesArray + voxelIndexOffset; GLuint* currentIndicesPos = indicesArray + voxelIndexOffset;
@ -421,7 +421,7 @@ void VoxelSystem::initVoxelMemory() {
// populate the indicesArray // populate the indicesArray
// this will not change given new voxels, so we can set it all up now // this will not change given new voxels, so we can set it all up now
for (int n = 0; n < _maxVoxels; n++) { for (unsigned long n = 0; n < _maxVoxels; n++) {
indicesArray[n] = n; indicesArray[n] = n;
} }

View file

@ -149,7 +149,7 @@ public slots:
protected: protected:
float _treeScale; float _treeScale;
int _maxVoxels; unsigned long _maxVoxels;
VoxelTree* _tree; VoxelTree* _tree;
void setupNewVoxelsForDrawing(); void setupNewVoxelsForDrawing();

View file

@ -33,17 +33,17 @@ using namespace std;
const bool BALLS_ON = false; const bool BALLS_ON = false;
const glm::vec3 DEFAULT_UP_DIRECTION(0.0f, 1.0f, 0.0f); const glm::vec3 DEFAULT_UP_DIRECTION(0.0f, 1.0f, 0.0f);
const float YAW_MAG = 500.0; const float YAW_MAG = 500.0f;
const float MY_HAND_HOLDING_PULL = 0.2; const float MY_HAND_HOLDING_PULL = 0.2f;
const float YOUR_HAND_HOLDING_PULL = 1.0; const float YOUR_HAND_HOLDING_PULL = 1.0f;
const float BODY_SPRING_DEFAULT_TIGHTNESS = 1000.0f; const float BODY_SPRING_DEFAULT_TIGHTNESS = 1000.0f;
const float BODY_SPRING_FORCE = 300.0f; const float BODY_SPRING_FORCE = 300.0f;
const float BODY_SPRING_DECAY = 16.0f; const float BODY_SPRING_DECAY = 16.0f;
const float COLLISION_RADIUS_SCALAR = 1.2; // pertains to avatar-to-avatar collisions const float COLLISION_RADIUS_SCALAR = 1.2f; // pertains to avatar-to-avatar collisions
const float COLLISION_BALL_FORCE = 200.0; // pertains to avatar-to-avatar collisions const float COLLISION_BALL_FORCE = 200.0f; // pertains to avatar-to-avatar collisions
const float COLLISION_BODY_FORCE = 30.0; // pertains to avatar-to-avatar collisions const float COLLISION_BODY_FORCE = 30.0f; // pertains to avatar-to-avatar collisions
const float HEAD_ROTATION_SCALE = 0.70; const float HEAD_ROTATION_SCALE = 0.70f;
const float HEAD_ROLL_SCALE = 0.40; const float HEAD_ROLL_SCALE = 0.40f;
const float HEAD_MAX_PITCH = 45; const float HEAD_MAX_PITCH = 45;
const float HEAD_MIN_PITCH = -45; const float HEAD_MIN_PITCH = -45;
const float HEAD_MAX_YAW = 85; const float HEAD_MAX_YAW = 85;
@ -52,14 +52,14 @@ const float AVATAR_BRAKING_STRENGTH = 40.0f;
const float MOUSE_RAY_TOUCH_RANGE = 0.01f; const float MOUSE_RAY_TOUCH_RANGE = 0.01f;
const float FLOATING_HEIGHT = 0.13f; const float FLOATING_HEIGHT = 0.13f;
const bool USING_HEAD_LEAN = false; const bool USING_HEAD_LEAN = false;
const float LEAN_SENSITIVITY = 0.15; const float LEAN_SENSITIVITY = 0.15f;
const float LEAN_MAX = 0.45; const float LEAN_MAX = 0.45f;
const float LEAN_AVERAGING = 10.0; const float LEAN_AVERAGING = 10.0f;
const float HEAD_RATE_MAX = 50.f; const float HEAD_RATE_MAX = 50.f;
const float SKIN_COLOR[] = {1.0, 0.84, 0.66}; const float SKIN_COLOR[] = {1.0f, 0.84f, 0.66f};
const float DARK_SKIN_COLOR[] = {0.9, 0.78, 0.63}; const float DARK_SKIN_COLOR[] = {0.9f, 0.78f, 0.63f};
const int NUM_BODY_CONE_SIDES = 9; const int NUM_BODY_CONE_SIDES = 9;
const float CHAT_MESSAGE_SCALE = 0.0015; const float CHAT_MESSAGE_SCALE = 0.0015f;
const float CHAT_MESSAGE_HEIGHT = 0.1f; const float CHAT_MESSAGE_HEIGHT = 0.1f;
void Avatar::sendAvatarURLsMessage(const QUrl& voxelURL) { void Avatar::sendAvatarURLsMessage(const QUrl& voxelURL) {
@ -269,7 +269,7 @@ void Avatar::render(bool forceRenderHead) {
glRotatef(glm::angle(chatRotation), chatAxis.x, chatAxis.y, chatAxis.z); glRotatef(glm::angle(chatRotation), chatAxis.x, chatAxis.y, chatAxis.z);
glColor3f(0, 0.8, 0); glColor3f(0, 0.8f, 0);
glRotatef(180, 0, 1, 0); glRotatef(180, 0, 1, 0);
glRotatef(180, 0, 0, 1); glRotatef(180, 0, 0, 1);
glScalef(_scale * CHAT_MESSAGE_SCALE, _scale * CHAT_MESSAGE_SCALE, 1.0f); glScalef(_scale * CHAT_MESSAGE_SCALE, _scale * CHAT_MESSAGE_SCALE, 1.0f);

View file

@ -19,15 +19,15 @@
using namespace std; using namespace std;
const float FINGERTIP_COLLISION_RADIUS = 0.01; const float FINGERTIP_COLLISION_RADIUS = 0.01f;
const float FINGERTIP_VOXEL_SIZE = 0.05; const float FINGERTIP_VOXEL_SIZE = 0.05f;
const int TOY_BALL_HAND = 1; const int TOY_BALL_HAND = 1;
const float TOY_BALL_RADIUS = 0.05f; const float TOY_BALL_RADIUS = 0.05f;
const float TOY_BALL_DAMPING = 0.1f; const float TOY_BALL_DAMPING = 0.1f;
const glm::vec3 NO_VELOCITY = glm::vec3(0,0,0); const glm::vec3 NO_VELOCITY = glm::vec3(0,0,0);
const glm::vec3 NO_GRAVITY = glm::vec3(0,0,0); const glm::vec3 NO_GRAVITY = glm::vec3(0,0,0);
const float NO_DAMPING = 0.f; const float NO_DAMPING = 0.f;
const glm::vec3 TOY_BALL_GRAVITY = glm::vec3(0,-2.0,0); const glm::vec3 TOY_BALL_GRAVITY = glm::vec3(0,-2.0f,0);
const QString TOY_BALL_UPDATE_SCRIPT(""); const QString TOY_BALL_UPDATE_SCRIPT("");
const float PALM_COLLISION_RADIUS = 0.03f; const float PALM_COLLISION_RADIUS = 0.03f;
const float CATCH_RADIUS = 0.3f; const float CATCH_RADIUS = 0.3f;
@ -159,7 +159,7 @@ void Hand::simulateToyBall(PalmData& palm, const glm::vec3& fingerTipPosition, f
IN_HAND, IN_HAND,
TOY_BALL_UPDATE_SCRIPT); TOY_BALL_UPDATE_SCRIPT);
// Play a new ball sound // Play a new ball sound
app->getAudio()->startDrumSound(1.0, 2000, 0.5, 0.02); app->getAudio()->startDrumSound(1.0f, 2000, 0.5f, 0.02f);
} }
if (grabButtonPressed) { if (grabButtonPressed) {
@ -359,7 +359,7 @@ void Hand::updateCollisions() {
getLeftRightPalmIndices(leftPalmIndex, rightPalmIndex); getLeftRightPalmIndices(leftPalmIndex, rightPalmIndex);
// check for collisions // check for collisions
for (int i = 0; i < getNumPalms(); i++) { for (size_t i = 0; i < getNumPalms(); i++) {
PalmData& palm = getPalms()[i]; PalmData& palm = getPalms()[i];
if (!palm.isActive()) { if (!palm.isActive()) {
continue; continue;
@ -379,7 +379,7 @@ void Hand::updateCollisions() {
bool wasColliding = palm.getIsCollidingWithPalm(); bool wasColliding = palm.getIsCollidingWithPalm();
palm.setIsCollidingWithPalm(false); palm.setIsCollidingWithPalm(false);
// If 'Play Slaps' is enabled, look for palm-to-palm collisions and make sound // If 'Play Slaps' is enabled, look for palm-to-palm collisions and make sound
for (int j = 0; j < otherAvatar->getHand().getNumPalms(); j++) { for (size_t j = 0; j < otherAvatar->getHand().getNumPalms(); j++) {
PalmData& otherPalm = otherAvatar->getHand().getPalms()[j]; PalmData& otherPalm = otherAvatar->getHand().getPalms()[j];
if (!otherPalm.isActive()) { if (!otherPalm.isActive()) {
continue; continue;
@ -505,7 +505,7 @@ void Hand::render(bool isMine) {
} }
if (Menu::getInstance()->isOptionChecked(MenuOption::CollisionProxies)) { if (Menu::getInstance()->isOptionChecked(MenuOption::CollisionProxies)) {
for (int i = 0; i < getNumPalms(); i++) { for (size_t i = 0; i < getNumPalms(); i++) {
PalmData& palm = getPalms()[i]; PalmData& palm = getPalms()[i];
if (!palm.isActive()) { if (!palm.isActive()) {
continue; continue;
@ -611,7 +611,7 @@ void Hand::renderLeapHands(bool isMine) {
glColor4f(handColor.r, handColor.g, handColor.b, 0.5); glColor4f(handColor.r, handColor.g, handColor.b, 0.5);
glm::vec3 tip = finger.getTipPosition(); glm::vec3 tip = finger.getTipPosition();
glm::vec3 root = finger.getRootPosition(); glm::vec3 root = finger.getRootPosition();
Avatar::renderJointConnectingCone(root, tip, 0.001, 0.003); Avatar::renderJointConnectingCone(root, tip, 0.001f, 0.003f);
} }
} }
} }

View file

@ -20,12 +20,12 @@ using namespace std;
const float EYE_RIGHT_OFFSET = 0.27f; const float EYE_RIGHT_OFFSET = 0.27f;
const float EYE_UP_OFFSET = 0.36f; const float EYE_UP_OFFSET = 0.36f;
const float EYE_FRONT_OFFSET = 0.8f; const float EYE_FRONT_OFFSET = 0.8f;
const float EAR_RIGHT_OFFSET = 1.0; const float EAR_RIGHT_OFFSET = 1.0f;
const float MOUTH_UP_OFFSET = -0.3f; const float MOUTH_UP_OFFSET = -0.3f;
const float HEAD_MOTION_DECAY = 0.1; const float HEAD_MOTION_DECAY = 0.1f;
const float MINIMUM_EYE_ROTATION_DOT = 0.5f; // based on a dot product: 1.0 is straight ahead, 0.0 is 90 degrees off const float MINIMUM_EYE_ROTATION_DOT = 0.5f; // based on a dot product: 1.0 is straight ahead, 0.0 is 90 degrees off
const float EYEBALL_RADIUS = 0.017; const float EYEBALL_RADIUS = 0.017f;
const float EYELID_RADIUS = 0.019; const float EYELID_RADIUS = 0.019f;
const float EYEBALL_COLOR[3] = { 0.9f, 0.9f, 0.8f }; const float EYEBALL_COLOR[3] = { 0.9f, 0.9f, 0.8f };
const float HAIR_SPRING_FORCE = 15.0f; const float HAIR_SPRING_FORCE = 15.0f;
@ -35,12 +35,12 @@ const float HAIR_DRAG = 10.0f;
const float HAIR_LENGTH = 0.09f; const float HAIR_LENGTH = 0.09f;
const float HAIR_THICKNESS = 0.03f; const float HAIR_THICKNESS = 0.03f;
const float NOSE_LENGTH = 0.025; const float NOSE_LENGTH = 0.025f;
const float NOSE_WIDTH = 0.03; const float NOSE_WIDTH = 0.03f;
const float NOSE_HEIGHT = 0.034; const float NOSE_HEIGHT = 0.034f;
const float NOSE_UP_OFFSET = -0.07; const float NOSE_UP_OFFSET = -0.07f;
const float NOSE_UPTURN = 0.005; const float NOSE_UPTURN = 0.005f;
const float IRIS_RADIUS = 0.007; const float IRIS_RADIUS = 0.007f;
const float IRIS_PROTRUSION = 0.0145f; const float IRIS_PROTRUSION = 0.0145f;
const char IRIS_TEXTURE_FILENAME[] = "resources/images/iris.png"; const char IRIS_TEXTURE_FILENAME[] = "resources/images/iris.png";
@ -148,7 +148,7 @@ void Head::simulate(float deltaTime, bool isMine) {
} }
_saccade += (_saccadeTarget - _saccade) * 0.50f; _saccade += (_saccadeTarget - _saccade) * 0.50f;
const float AUDIO_AVERAGING_SECS = 0.05; const float AUDIO_AVERAGING_SECS = 0.05f;
_averageLoudness = (1.f - deltaTime / AUDIO_AVERAGING_SECS) * _averageLoudness + _averageLoudness = (1.f - deltaTime / AUDIO_AVERAGING_SECS) * _averageLoudness +
(deltaTime / AUDIO_AVERAGING_SECS) * _audioLoudness; (deltaTime / AUDIO_AVERAGING_SECS) * _audioLoudness;

View file

@ -29,14 +29,14 @@ using namespace std;
const glm::vec3 DEFAULT_UP_DIRECTION(0.0f, 1.0f, 0.0f); const glm::vec3 DEFAULT_UP_DIRECTION(0.0f, 1.0f, 0.0f);
const float YAW_MAG = 500.0f; const float YAW_MAG = 500.0f;
const float PITCH_MAG = 100.0f; const float PITCH_MAG = 100.0f;
const float COLLISION_RADIUS_SCALAR = 1.2; // pertains to avatar-to-avatar collisions const float COLLISION_RADIUS_SCALAR = 1.2f; // pertains to avatar-to-avatar collisions
const float COLLISION_BALL_FORCE = 200.0f; // pertains to avatar-to-avatar collisions const float COLLISION_BALL_FORCE = 200.0f; // pertains to avatar-to-avatar collisions
const float COLLISION_BODY_FORCE = 30.0f; // pertains to avatar-to-avatar collisions const float COLLISION_BODY_FORCE = 30.0f; // pertains to avatar-to-avatar collisions
const float COLLISION_RADIUS_SCALE = 0.125f; const float COLLISION_RADIUS_SCALE = 0.125f;
const float MOUSE_RAY_TOUCH_RANGE = 0.01f; const float MOUSE_RAY_TOUCH_RANGE = 0.01f;
const bool USING_HEAD_LEAN = false; const bool USING_HEAD_LEAN = false;
const float SKIN_COLOR[] = {1.0, 0.84, 0.66}; const float SKIN_COLOR[] = {1.0f, 0.84f, 0.66f};
const float DARK_SKIN_COLOR[] = {0.9, 0.78, 0.63}; const float DARK_SKIN_COLOR[] = {0.9f, 0.78f, 0.63f};
MyAvatar::MyAvatar(Node* owningNode) : MyAvatar::MyAvatar(Node* owningNode) :
Avatar(owningNode), Avatar(owningNode),
@ -470,7 +470,7 @@ void MyAvatar::render(bool forceRenderHead) {
glRotatef(glm::angle(chatRotation), chatAxis.x, chatAxis.y, chatAxis.z); glRotatef(glm::angle(chatRotation), chatAxis.x, chatAxis.y, chatAxis.z);
glColor3f(0, 0.8, 0); glColor3f(0, 0.8f, 0);
glRotatef(180, 0, 1, 0); glRotatef(180, 0, 1, 0);
glRotatef(180, 0, 0, 1); glRotatef(180, 0, 0, 1);
glScalef(_scale * CHAT_MESSAGE_SCALE, _scale * CHAT_MESSAGE_SCALE, 1.0f); glScalef(_scale * CHAT_MESSAGE_SCALE, _scale * CHAT_MESSAGE_SCALE, 1.0f);
@ -617,8 +617,8 @@ void MyAvatar::updateThrust(float deltaTime, Transmitter * transmitter) {
// If thrust keys are being held down, slowly increase thrust to allow reaching great speeds // If thrust keys are being held down, slowly increase thrust to allow reaching great speeds
if (_driveKeys[FWD] || _driveKeys[BACK] || _driveKeys[RIGHT] || _driveKeys[LEFT] || _driveKeys[UP] || _driveKeys[DOWN]) { if (_driveKeys[FWD] || _driveKeys[BACK] || _driveKeys[RIGHT] || _driveKeys[LEFT] || _driveKeys[UP] || _driveKeys[DOWN]) {
const float THRUST_INCREASE_RATE = 1.05; const float THRUST_INCREASE_RATE = 1.05f;
const float MAX_THRUST_MULTIPLIER = 75.0; const float MAX_THRUST_MULTIPLIER = 75.0f;
//printf("m = %.3f\n", _thrustMultiplier); //printf("m = %.3f\n", _thrustMultiplier);
if (_thrustMultiplier < MAX_THRUST_MULTIPLIER) { if (_thrustMultiplier < MAX_THRUST_MULTIPLIER) {
_thrustMultiplier *= 1.f + deltaTime * THRUST_INCREASE_RATE; _thrustMultiplier *= 1.f + deltaTime * THRUST_INCREASE_RATE;
@ -919,7 +919,7 @@ void MyAvatar::updateChatCircle(float deltaTime) {
// compute the accumulated centers // compute the accumulated centers
glm::vec3 center = _position; glm::vec3 center = _position;
for (size_t i = 0; i < sortedAvatars.size(); i++) { for (int i = 0; i < sortedAvatars.size(); i++) {
SortedAvatar& sortedAvatar = sortedAvatars[i]; SortedAvatar& sortedAvatar = sortedAvatars[i];
sortedAvatar.accumulatedCenter = (center += sortedAvatar.avatar->getPosition()) / (i + 2.0f); sortedAvatar.accumulatedCenter = (center += sortedAvatar.avatar->getPosition()) / (i + 2.0f);
} }

View file

@ -73,7 +73,7 @@ bool SkeletonModel::render(float alpha) {
glm::vec3 skinColor, darkSkinColor; glm::vec3 skinColor, darkSkinColor;
_owningAvatar->getSkinColors(skinColor, darkSkinColor); _owningAvatar->getSkinColors(skinColor, darkSkinColor);
for (size_t i = 0; i < _jointStates.size(); i++) { for (int i = 0; i < _jointStates.size(); i++) {
glPushMatrix(); glPushMatrix();
glm::vec3 position; glm::vec3 position;
@ -164,7 +164,7 @@ void SkeletonModel::applyPalmData(int jointIndex, const QVector<int>& fingerJoin
// sort the finger indices by raw x, get the average direction // sort the finger indices by raw x, get the average direction
QVector<IndexValue> fingerIndices; QVector<IndexValue> fingerIndices;
glm::vec3 direction; glm::vec3 direction;
for (int i = 0; i < palm.getNumFingers(); i++) { for (size_t i = 0; i < palm.getNumFingers(); i++) {
glm::vec3 fingerVector = palm.getFingers()[i].getTipPosition() - palm.getPosition(); glm::vec3 fingerVector = palm.getFingers()[i].getTipPosition() - palm.getPosition();
float length = glm::length(fingerVector); float length = glm::length(fingerVector);
if (length > EPSILON) { if (length > EPSILON) {
@ -191,7 +191,7 @@ void SkeletonModel::applyPalmData(int jointIndex, const QVector<int>& fingerJoin
// match them up as best we can // match them up as best we can
float proportion = fingerIndices.size() / (float)fingerJointIndices.size(); float proportion = fingerIndices.size() / (float)fingerJointIndices.size();
for (size_t i = 0; i < fingerJointIndices.size(); i++) { for (int i = 0; i < fingerJointIndices.size(); i++) {
int fingerIndex = fingerIndices.at(roundf(i * proportion)).index; int fingerIndex = fingerIndices.at(roundf(i * proportion)).index;
glm::vec3 fingerVector = palm.getFingers()[fingerIndex].getTipPosition() - glm::vec3 fingerVector = palm.getFingers()[fingerIndex].getTipPosition() -
palm.getFingers()[fingerIndex].getRootPosition(); palm.getFingers()[fingerIndex].getRootPosition();

View file

@ -159,7 +159,7 @@ void Faceshift::readFromSocket() {
} }
float Faceshift::getBlendshapeCoefficient(int index) const { float Faceshift::getBlendshapeCoefficient(int index) const {
return (index >= 0 && index < _blendshapeCoefficients.size()) ? _blendshapeCoefficients[index] : 0.0f; return (index >= 0 && index < (int)_blendshapeCoefficients.size()) ? _blendshapeCoefficients[index] : 0.0f;
} }
void Faceshift::send(const std::string& message) { void Faceshift::send(const std::string& message) {

View file

@ -157,17 +157,17 @@ void SerialInterface::renderLevels(int width, int height) {
// Draw the numeric degree/sec values from the gyros // Draw the numeric degree/sec values from the gyros
sprintf(val, "Yaw %4.1f", _estimatedRotation.y); sprintf(val, "Yaw %4.1f", _estimatedRotation.y);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y, 0.10, 0, 1.0, 1, val, 0, 1, 0); drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y, 0.10f, 0, 1.0f, 1, val, 0, 1, 0);
sprintf(val, "Pitch %4.1f", _estimatedRotation.x); sprintf(val, "Pitch %4.1f", _estimatedRotation.x);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 15, 0.10, 0, 1.0, 1, val, 0, 1, 0); drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 15, 0.10f, 0, 1.0f, 1, val, 0, 1, 0);
sprintf(val, "Roll %4.1f", _estimatedRotation.z); sprintf(val, "Roll %4.1f", _estimatedRotation.z);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 30, 0.10, 0, 1.0, 1, val, 0, 1, 0); drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 30, 0.10f, 0, 1.0f, 1, val, 0, 1, 0);
sprintf(val, "X %4.3f", _lastAcceleration.x - _gravity.x); sprintf(val, "X %4.3f", _lastAcceleration.x - _gravity.x);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 45, 0.10, 0, 1.0, 1, val, 0, 1, 0); drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 45, 0.10f, 0, 1.0f, 1, val, 0, 1, 0);
sprintf(val, "Y %4.3f", _lastAcceleration.y - _gravity.y); sprintf(val, "Y %4.3f", _lastAcceleration.y - _gravity.y);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 60, 0.10, 0, 1.0, 1, val, 0, 1, 0); drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 60, 0.10f, 0, 1.0f, 1, val, 0, 1, 0);
sprintf(val, "Z %4.3f", _lastAcceleration.z - _gravity.z); sprintf(val, "Z %4.3f", _lastAcceleration.z - _gravity.z);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 75, 0.10, 0, 1.0, 1, val, 0, 1, 0); drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 75, 0.10f, 0, 1.0f, 1, val, 0, 1, 0);
// Draw the levels as horizontal lines // Draw the levels as horizontal lines
const int LEVEL_CENTER = 150; const int LEVEL_CENTER = 150;

View file

@ -48,13 +48,13 @@ template<class T> QVariant readBinaryArray(QDataStream& in) {
QDataStream uncompressedIn(uncompressed); QDataStream uncompressedIn(uncompressed);
uncompressedIn.setByteOrder(QDataStream::LittleEndian); uncompressedIn.setByteOrder(QDataStream::LittleEndian);
uncompressedIn.setVersion(QDataStream::Qt_4_5); // for single/double precision switch uncompressedIn.setVersion(QDataStream::Qt_4_5); // for single/double precision switch
for (int i = 0; i < arrayLength; i++) { for (quint32 i = 0; i < arrayLength; i++) {
T value; T value;
uncompressedIn >> value; uncompressedIn >> value;
values.append(value); values.append(value);
} }
} else { } else {
for (int i = 0; i < arrayLength; i++) { for (quint32 i = 0; i < arrayLength; i++) {
T value; T value;
in >> value; in >> value;
values.append(value); values.append(value);
@ -142,7 +142,7 @@ FBXNode parseBinaryFBXNode(QDataStream& in) {
} }
node.name = in.device()->read(nameLength); node.name = in.device()->read(nameLength);
for (int i = 0; i < propertyCount; i++) { for (quint32 i = 0; i < propertyCount; i++) {
node.properties.append(parseBinaryFBXProperty(in)); node.properties.append(parseBinaryFBXProperty(in));
} }
@ -337,7 +337,7 @@ QVariantHash parseMapping(QIODevice* device) {
} else if (sections.size() >= 4) { } else if (sections.size() >= 4) {
QVariantHash heading = properties.value(name).toHash(); QVariantHash heading = properties.value(name).toHash();
QVariantList contents; QVariantList contents;
for (size_t i = 2; i < sections.size(); i++) { for (int i = 2; i < sections.size(); i++) {
contents.append(sections.at(i).trimmed()); contents.append(sections.at(i).trimmed());
} }
heading.insertMulti(sections.at(1).trimmed(), contents); heading.insertMulti(sections.at(1).trimmed(), contents);

View file

@ -164,9 +164,9 @@ void Model::simulate(float deltaTime) {
memcpy(_blendedVertices.data(), mesh.vertices.constData(), vertexCount * sizeof(glm::vec3)); memcpy(_blendedVertices.data(), mesh.vertices.constData(), vertexCount * sizeof(glm::vec3));
// blend in each coefficient // blend in each coefficient
for (int j = 0; j < _blendshapeCoefficients.size(); j++) { for (unsigned int j = 0; j < _blendshapeCoefficients.size(); j++) {
float coefficient = _blendshapeCoefficients[j]; float coefficient = _blendshapeCoefficients[j];
if (coefficient == 0.0f || j >= mesh.blendshapes.size() || mesh.blendshapes[j].vertices.isEmpty()) { if (coefficient == 0.0f || j >= (unsigned int)mesh.blendshapes.size() || mesh.blendshapes[j].vertices.isEmpty()) {
continue; continue;
} }
const glm::vec3* vertex = mesh.blendshapes[j].vertices.constData(); const glm::vec3* vertex = mesh.blendshapes[j].vertices.constData();
@ -345,9 +345,9 @@ bool Model::render(float alpha) {
memcpy(_blendedNormals.data(), mesh.normals.constData(), vertexCount * sizeof(glm::vec3)); memcpy(_blendedNormals.data(), mesh.normals.constData(), vertexCount * sizeof(glm::vec3));
// blend in each coefficient // blend in each coefficient
for (int j = 0; j < _blendshapeCoefficients.size(); j++) { for (unsigned int j = 0; j < _blendshapeCoefficients.size(); j++) {
float coefficient = _blendshapeCoefficients[j]; float coefficient = _blendshapeCoefficients[j];
if (coefficient == 0.0f || j >= mesh.blendshapes.size() || mesh.blendshapes[j].vertices.isEmpty()) { if (coefficient == 0.0f || j >= (unsigned int)mesh.blendshapes.size() || mesh.blendshapes[j].vertices.isEmpty()) {
continue; continue;
} }
const float NORMAL_COEFFICIENT_SCALE = 0.01f; const float NORMAL_COEFFICIENT_SCALE = 0.01f;

View file

@ -42,7 +42,7 @@ bool ChatEntry::keyPressEvent(QKeyEvent* event) {
return true; return true;
case Qt::Key_Delete: case Qt::Key_Delete:
if (_cursorPos < _contents.size()) { if (_cursorPos < (int)_contents.size()) {
_contents.erase(_cursorPos, 1); _contents.erase(_cursorPos, 1);
} }
return true; return true;
@ -86,11 +86,11 @@ void ChatEntry::render(int screenWidth, int screenHeight) {
glVertex2f(left - 5, top - 3); glVertex2f(left - 5, top - 3);
glEnd(); glEnd();
drawtext(left, bottom, 0.10, 0, 1.0, 0, _contents.c_str(), 1, 1, 1); drawtext(left, bottom, 0.10f, 0, 1.0f, 0, _contents.c_str(), 1, 1, 1);
float width = 0; float width = 0;
for (string::iterator it = _contents.begin(), end = it + _cursorPos; it != end; it++) { for (string::iterator it = _contents.begin(), end = it + _cursorPos; it != end; it++) {
width += widthChar(0.10, 0, *it); width += widthChar(0.10f, 0, *it);
} }
glDisable(GL_LINE_SMOOTH); glDisable(GL_LINE_SMOOTH);
glBegin(GL_LINE_STRIP); glBegin(GL_LINE_STRIP);

View file

@ -44,7 +44,7 @@ const int SIXENSE_CONTROLLER_ID_RIGHT_HAND = 1;
void HandData::getLeftRightPalmIndices(int& leftPalmIndex, int& rightPalmIndex) const { void HandData::getLeftRightPalmIndices(int& leftPalmIndex, int& rightPalmIndex) const {
leftPalmIndex = -1; leftPalmIndex = -1;
rightPalmIndex = -1; rightPalmIndex = -1;
for (int i = 0; i < _palms.size(); i++) { for (size_t i = 0; i < _palms.size(); i++) {
const PalmData& palm = _palms[i]; const PalmData& palm = _palms[i];
if (palm.isActive()) { if (palm.isActive()) {
if (palm.getSixenseID() == SIXENSE_CONTROLLER_ID_LEFT_HAND) { if (palm.getSixenseID() == SIXENSE_CONTROLLER_ID_LEFT_HAND) {
@ -81,7 +81,7 @@ void PalmData::addToPosition(const glm::vec3& delta) {
// convert to Leap coordinates, then add to palm and finger positions // convert to Leap coordinates, then add to palm and finger positions
glm::vec3 leapDelta = _owningHandData->worldVectorToLeapVector(delta); glm::vec3 leapDelta = _owningHandData->worldVectorToLeapVector(delta);
_rawPosition += leapDelta; _rawPosition += leapDelta;
for (int i = 0; i < getNumFingers(); i++) { for (size_t i = 0; i < getNumFingers(); i++) {
FingerData& finger = _fingers[i]; FingerData& finger = _fingers[i];
if (finger.isActive()) { if (finger.isActive()) {
finger.setRawTipPosition(finger.getTipRawPosition() + leapDelta); finger.setRawTipPosition(finger.getTipRawPosition() + leapDelta);
@ -263,7 +263,7 @@ void FingerData::updateTrail() {
_tipTrailPositions[_tipTrailCurrentStartIndex] = getTipPosition(); _tipTrailPositions[_tipTrailCurrentStartIndex] = getTipPosition();
if (_tipTrailCurrentValidLength < _tipTrailPositions.size()) if (_tipTrailCurrentValidLength < (int)_tipTrailPositions.size())
_tipTrailCurrentValidLength++; _tipTrailCurrentValidLength++;
} }
else { else {

View file

@ -67,7 +67,7 @@ void DatagramSequencer::receivedDatagram(const QByteArray& datagram) {
QIODeviceOpener opener(&_incomingDatagramBuffer, QIODevice::ReadOnly); QIODeviceOpener opener(&_incomingDatagramBuffer, QIODevice::ReadOnly);
// read the sequence number // read the sequence number
quint32 sequenceNumber; int sequenceNumber;
_incomingDatagramStream >> sequenceNumber; _incomingDatagramStream >> sequenceNumber;
// if it's less than the last, ignore // if it's less than the last, ignore
@ -107,7 +107,7 @@ void DatagramSequencer::receivedDatagram(const QByteArray& datagram) {
// read the list of acknowledged packets // read the list of acknowledged packets
quint32 acknowledgementCount; quint32 acknowledgementCount;
_incomingPacketStream >> acknowledgementCount; _incomingPacketStream >> acknowledgementCount;
for (int i = 0; i < acknowledgementCount; i++) { for (quint32 i = 0; i < acknowledgementCount; i++) {
quint32 packetNumber; quint32 packetNumber;
_incomingPacketStream >> packetNumber; _incomingPacketStream >> packetNumber;
if (_sendRecords.isEmpty()) { if (_sendRecords.isEmpty()) {

View file

@ -31,9 +31,9 @@ ViewFrustum::ViewFrustum() :
_up(0,0,0), _up(0,0,0),
_right(0,0,0), _right(0,0,0),
_fieldOfView(0.0), _fieldOfView(0.0),
_aspectRatio(1.0), _aspectRatio(1.0f),
_nearClip(0.1), _nearClip(0.1f),
_farClip(500.0), _farClip(500.0f),
_focalLength(0.25f), _focalLength(0.25f),
_keyholeRadius(DEFAULT_KEYHOLE_RADIUS), _keyholeRadius(DEFAULT_KEYHOLE_RADIUS),
_farTopLeft(0,0,0), _farTopLeft(0,0,0),

View file

@ -392,7 +392,7 @@ void NodeList::processSTUNResponse(unsigned char* packetData, size_t dataBytes)
const uint32_t RFC_5389_MAGIC_COOKIE_NETWORK_ORDER = htonl(RFC_5389_MAGIC_COOKIE); const uint32_t RFC_5389_MAGIC_COOKIE_NETWORK_ORDER = htonl(RFC_5389_MAGIC_COOKIE);
int attributeStartIndex = NUM_BYTES_STUN_HEADER; size_t attributeStartIndex = NUM_BYTES_STUN_HEADER;
if (memcmp(packetData + NUM_BYTES_MESSAGE_TYPE_AND_LENGTH, if (memcmp(packetData + NUM_BYTES_MESSAGE_TYPE_AND_LENGTH,
&RFC_5389_MAGIC_COOKIE_NETWORK_ORDER, &RFC_5389_MAGIC_COOKIE_NETWORK_ORDER,
@ -606,7 +606,7 @@ int NodeList::processDomainServerList(unsigned char* packetData, size_t dataByte
unsigned char* readPtr = packetData + numBytesForPacketHeader(packetData); unsigned char* readPtr = packetData + numBytesForPacketHeader(packetData);
unsigned char* startPtr = packetData; unsigned char* startPtr = packetData;
while((readPtr - startPtr) < dataBytes - sizeof(uint16_t)) { while((size_t)(readPtr - startPtr) < dataBytes - sizeof(uint16_t)) {
nodeType = *readPtr++; nodeType = *readPtr++;
QUuid nodeUUID = QUuid::fromRfc4122(QByteArray((char*) readPtr, NUM_BYTES_RFC4122_UUID)); QUuid nodeUUID = QUuid::fromRfc4122(QByteArray((char*) readPtr, NUM_BYTES_RFC4122_UUID));
readPtr += NUM_BYTES_RFC4122_UUID; readPtr += NUM_BYTES_RFC4122_UUID;
@ -955,7 +955,7 @@ void NodeList::addDomainListener(DomainChangeListener* listener) {
} }
void NodeList::removeDomainListener(DomainChangeListener* listener) { void NodeList::removeDomainListener(DomainChangeListener* listener) {
for (int i = 0; i < _domainListeners.size(); i++) { for (size_t i = 0; i < _domainListeners.size(); i++) {
if (_domainListeners[i] == listener) { if (_domainListeners[i] == listener) {
_domainListeners.erase(_domainListeners.begin() + i); _domainListeners.erase(_domainListeners.begin() + i);
return; return;
@ -968,7 +968,7 @@ void NodeList::addHook(NodeListHook* hook) {
} }
void NodeList::removeHook(NodeListHook* hook) { void NodeList::removeHook(NodeListHook* hook) {
for (int i = 0; i < _hooks.size(); i++) { for (size_t i = 0; i < _hooks.size(); i++) {
if (_hooks[i] == hook) { if (_hooks[i] == hook) {
_hooks.erase(_hooks.begin() + i); _hooks.erase(_hooks.begin() + i);
return; return;
@ -977,21 +977,21 @@ void NodeList::removeHook(NodeListHook* hook) {
} }
void NodeList::notifyHooksOfAddedNode(Node* node) { void NodeList::notifyHooksOfAddedNode(Node* node) {
for (int i = 0; i < _hooks.size(); i++) { for (size_t i = 0; i < _hooks.size(); i++) {
//printf("NodeList::notifyHooksOfAddedNode() i=%d\n", i); //printf("NodeList::notifyHooksOfAddedNode() i=%d\n", i);
_hooks[i]->nodeAdded(node); _hooks[i]->nodeAdded(node);
} }
} }
void NodeList::notifyHooksOfKilledNode(Node* node) { void NodeList::notifyHooksOfKilledNode(Node* node) {
for (int i = 0; i < _hooks.size(); i++) { for (size_t i = 0; i < _hooks.size(); i++) {
//printf("NodeList::notifyHooksOfKilledNode() i=%d\n", i); //printf("NodeList::notifyHooksOfKilledNode() i=%d\n", i);
_hooks[i]->nodeKilled(node); _hooks[i]->nodeKilled(node);
} }
} }
void NodeList::notifyDomainChanged() { void NodeList::notifyDomainChanged() {
for (int i = 0; i < _domainListeners.size(); i++) { for (size_t i = 0; i < _domainListeners.size(); i++) {
_domainListeners[i]->domainChanged(_domainHostname); _domainListeners[i]->domainChanged(_domainHostname);
} }
} }

View file

@ -372,7 +372,7 @@ unsigned char* pointToVoxel(float x, float y, float z, float s, unsigned char r,
unsigned char byte = 0; // we will be adding coding bits here unsigned char byte = 0; // we will be adding coding bits here
int bitInByteNDX = 0; // keep track of where we are in byte as we go int bitInByteNDX = 0; // keep track of where we are in byte as we go
int byteNDX = 1; // keep track of where we are in buffer of bytes as we go int byteNDX = 1; // keep track of where we are in buffer of bytes as we go
int octetsDone = 0; unsigned int octetsDone = 0;
// Now we actually fill out the voxel code // Now we actually fill out the voxel code
while (octetsDone < voxelSizeInOctets) { while (octetsDone < voxelSizeInOctets) {
@ -471,7 +471,7 @@ void printVoxelCode(unsigned char* voxelCode) {
qDebug("voxelSizeInOctets=%d\n",voxelSizeInOctets); qDebug("voxelSizeInOctets=%d\n",voxelSizeInOctets);
qDebug("voxelBufferSize=%d\n",voxelBufferSize); qDebug("voxelBufferSize=%d\n",voxelBufferSize);
for(int i=0;i<voxelBufferSize;i++) { for(unsigned int i=0;i<voxelBufferSize;i++) {
qDebug("i=%d ",i); qDebug("i=%d ",i);
outputBits(voxelCode[i]); outputBits(voxelCode[i]);
} }
@ -693,7 +693,7 @@ int unpackFloatFromByte(unsigned char* buffer, float& value, float scaleBy) {
return sizeof(holder); return sizeof(holder);
} }
char debug::DEADBEEF[] = { 0xDE, 0xAD, 0xBE, 0xEF }; unsigned char debug::DEADBEEF[] = { 0xDE, 0xAD, 0xBE, 0xEF };
int debug::DEADBEEF_SIZE = sizeof(DEADBEEF); int debug::DEADBEEF_SIZE = sizeof(DEADBEEF);
void debug::setDeadBeef(void* memoryVoid, int size) { void debug::setDeadBeef(void* memoryVoid, int size) {
unsigned char* memoryAt = (unsigned char*)memoryVoid; unsigned char* memoryAt = (unsigned char*)memoryVoid;

View file

@ -133,7 +133,7 @@ public:
static void setDeadBeef(void* memoryVoid, int size); static void setDeadBeef(void* memoryVoid, int size);
static void checkDeadBeef(void* memoryVoid, int size); static void checkDeadBeef(void* memoryVoid, int size);
private: private:
static char DEADBEEF[]; static unsigned char DEADBEEF[];
static int DEADBEEF_SIZE; static int DEADBEEF_SIZE;
}; };