coding standards clean up

This commit is contained in:
ZappoMan 2013-04-12 16:55:57 -07:00
parent 5504d87212
commit 5a8c5ff011
4 changed files with 69 additions and 59 deletions

View file

@ -1080,7 +1080,9 @@ void Head::updateHandMovement() {
glm::vec3 newElbowPosition = avatar.bone[ AVATAR_BONE_RIGHT_SHOULDER ].position; glm::vec3 newElbowPosition = avatar.bone[ AVATAR_BONE_RIGHT_SHOULDER ].position;
newElbowPosition += armVector * (float)ONE_HALF; newElbowPosition += armVector * (float)ONE_HALF;
glm::vec3 perpendicular = glm::cross( avatar.orientation.getFront(), armVector ); glm::vec3 perpendicular = glm::cross( avatar.orientation.getFront(), armVector );
newElbowPosition += perpendicular * (float)(( 1.0f - ( avatar.maxArmLength / distance ) ) * ONE_HALF); // XXXBHG - Jeffery, you should clean this up. You can't multiple glm::vec3's by doubles, only floats
// XXXBHG - Jeffery, you should clean this up. You can't multiple glm::vec3's by doubles, only floats
newElbowPosition += perpendicular * (float)(( 1.0f - ( avatar.maxArmLength / distance ) ) * ONE_HALF);
avatar.bone[ AVATAR_BONE_RIGHT_UPPER_ARM ].position = newElbowPosition; avatar.bone[ AVATAR_BONE_RIGHT_UPPER_ARM ].position = newElbowPosition;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View file

@ -534,7 +534,6 @@ void render_view_frustum() {
right = headRight; right = headRight;
} }
////////////////////////////////////////
// Ask the ViewFrustum class to calculate our corners // Ask the ViewFrustum class to calculate our corners
ViewFrustum vf(position,direction,up,right,::WIDTH,::HEIGHT); ViewFrustum vf(position,direction,up,right,::WIDTH,::HEIGHT);
@ -544,7 +543,6 @@ void render_view_frustum() {
glLineWidth(1.0); glLineWidth(1.0);
glBegin(GL_LINES); glBegin(GL_LINES);
////////////////////////////////////////
// Drawing the head direction vectors // Drawing the head direction vectors
glm::vec3 headLookingAt = headPosition + (headDirection * 0.2f); glm::vec3 headLookingAt = headPosition + (headDirection * 0.2f);
glm::vec3 headLookingAtUp = headPosition + (headUp * 0.2f); glm::vec3 headLookingAtUp = headPosition + (headUp * 0.2f);
@ -565,7 +563,6 @@ void render_view_frustum() {
glVertex3f(headPosition.x, headPosition.y, headPosition.z); glVertex3f(headPosition.x, headPosition.y, headPosition.z);
glVertex3f(headLookingAtRight.x, headLookingAtRight.y, headLookingAtRight.z); glVertex3f(headLookingAtRight.x, headLookingAtRight.y, headLookingAtRight.z);
////////////////////////////////////////
// Drawing the camera direction vectors // Drawing the camera direction vectors
glm::vec3 cameraLookingAt = cameraPosition + (cameraDirection * 0.2f); glm::vec3 cameraLookingAt = cameraPosition + (cameraDirection * 0.2f);
glm::vec3 cameraLookingAtUp = cameraPosition + (cameraUp * 0.2f); glm::vec3 cameraLookingAtUp = cameraPosition + (cameraUp * 0.2f);
@ -587,7 +584,6 @@ void render_view_frustum() {
glVertex3f(cameraLookingAtRight.x,cameraLookingAtRight.y,cameraLookingAtRight.z); glVertex3f(cameraLookingAtRight.x,cameraLookingAtRight.y,cameraLookingAtRight.z);
////////////////////////////////////////
// Drawing the bounds of the frustum // Drawing the bounds of the frustum
// vf.getNear plane - bottom edge // vf.getNear plane - bottom edge
glColor3f(1,0,0); glColor3f(1,0,0);

View file

@ -10,7 +10,8 @@
#include "ViewFrustum.h" #include "ViewFrustum.h"
ViewFrustum::ViewFrustum(glm::vec3 position, glm::vec3 direction, glm::vec3 up, glm::vec3 right, float screenWidth, float screenHeight) { ViewFrustum::ViewFrustum(glm::vec3 position, glm::vec3 direction,
glm::vec3 up, glm::vec3 right, float screenWidth, float screenHeight) {
this->calculateViewFrustum(position, direction, up, right, screenWidth, screenHeight); this->calculateViewFrustum(position, direction, up, right, screenWidth, screenHeight);
} }
@ -23,7 +24,8 @@ ViewFrustum::ViewFrustum(glm::vec3 position, glm::vec3 direction, glm::vec3 up,
// Notes on how/why this works: // Notes on how/why this works:
// http://www.lighthouse3d.com/tutorials/view-frustum-culling/view-frustums-shape/ // http://www.lighthouse3d.com/tutorials/view-frustum-culling/view-frustums-shape/
// //
void ViewFrustum::calculateViewFrustum(glm::vec3 position, glm::vec3 direction, glm::vec3 up, glm::vec3 right, float screenWidth, float screenHeight) { void ViewFrustum::calculateViewFrustum(glm::vec3 position, glm::vec3 direction,
glm::vec3 up, glm::vec3 right, float screenWidth, float screenHeight) {
// Save the values we were passed... // Save the values we were passed...
this->_position=position; this->_position=position;
@ -73,17 +75,27 @@ void ViewFrustum::dump() {
printf("nearHeight=%f\n",this->_nearHeight); printf("nearHeight=%f\n",this->_nearHeight);
printf("nearWidth=%f\n",this->_nearWidth); printf("nearWidth=%f\n",this->_nearWidth);
printf("farCenter.x=%f, farCenter.y=%f, farCenter.z=%f\n",this->_farCenter.x,this->_farCenter.y,this->_farCenter.z); printf("farCenter.x=%f, farCenter.y=%f, farCenter.z=%f\n",
printf("farTopLeft.x=%f, farTopLeft.y=%f, farTopLeft.z=%f\n",this->_farTopLeft.x,this->_farTopLeft.y,this->_farTopLeft.z); this->_farCenter.x,this->_farCenter.y,this->_farCenter.z);
printf("farTopRight.x=%f, farTopRight.y=%f, farTopRight.z=%f\n",this->_farTopRight.x,this->_farTopRight.y,this->_farTopRight.z); printf("farTopLeft.x=%f, farTopLeft.y=%f, farTopLeft.z=%f\n",
printf("farBottomLeft.x=%f, farBottomLeft.y=%f, farBottomLeft.z=%f\n",this->_farBottomLeft.x,this->_farBottomLeft.y,this->_farBottomLeft.z); this->_farTopLeft.x,this->_farTopLeft.y,this->_farTopLeft.z);
printf("farBottomRight.x=%f, farBottomRight.y=%f, farBottomRight.z=%f\n",this->_farBottomRight.x,this->_farBottomRight.y,this->_farBottomRight.z); printf("farTopRight.x=%f, farTopRight.y=%f, farTopRight.z=%f\n",
this->_farTopRight.x,this->_farTopRight.y,this->_farTopRight.z);
printf("farBottomLeft.x=%f, farBottomLeft.y=%f, farBottomLeft.z=%f\n",
this->_farBottomLeft.x,this->_farBottomLeft.y,this->_farBottomLeft.z);
printf("farBottomRight.x=%f, farBottomRight.y=%f, farBottomRight.z=%f\n",
this->_farBottomRight.x,this->_farBottomRight.y,this->_farBottomRight.z);
printf("nearCenter.x=%f, nearCenter.y=%f, nearCenter.z=%f\n",this->_nearCenter.x,this->_nearCenter.y,this->_nearCenter.z); printf("nearCenter.x=%f, nearCenter.y=%f, nearCenter.z=%f\n",
printf("nearTopLeft.x=%f, nearTopLeft.y=%f, nearTopLeft.z=%f\n",this->_nearTopLeft.x,this->_nearTopLeft.y,this->_nearTopLeft.z); this->_nearCenter.x,this->_nearCenter.y,this->_nearCenter.z);
printf("nearTopRight.x=%f, nearTopRight.y=%f, nearTopRight.z=%f\n",this->_nearTopRight.x,this->_nearTopRight.y,this->_nearTopRight.z); printf("nearTopLeft.x=%f, nearTopLeft.y=%f, nearTopLeft.z=%f\n",
printf("nearBottomLeft.x=%f, nearBottomLeft.y=%f, nearBottomLeft.z=%f\n",this->_nearBottomLeft.x,this->_nearBottomLeft.y,this->_nearBottomLeft.z); this->_nearTopLeft.x,this->_nearTopLeft.y,this->_nearTopLeft.z);
printf("nearBottomRight.x=%f, nearBottomRight.y=%f, nearBottomRight.z=%f\n",this->_nearBottomRight.x,this->_nearBottomRight.y,this->_nearBottomRight.z); printf("nearTopRight.x=%f, nearTopRight.y=%f, nearTopRight.z=%f\n",
this->_nearTopRight.x,this->_nearTopRight.y,this->_nearTopRight.z);
printf("nearBottomLeft.x=%f, nearBottomLeft.y=%f, nearBottomLeft.z=%f\n",
this->_nearBottomLeft.x,this->_nearBottomLeft.y,this->_nearBottomLeft.z);
printf("nearBottomRight.x=%f, nearBottomRight.y=%f, nearBottomRight.z=%f\n",
this->_nearBottomRight.x,this->_nearBottomRight.y,this->_nearBottomRight.z);
} }