Showing the changes to interface/src/main.cpp (1 of 5 files). Show all
Unified · Split
| @@ -692,14 +692,14 @@ void displaySide(Camera& whichCamera) { · 691 unmodified lines | ||
| 692 | 692 | float sphereRadius = 0.25f; |
| 693 | 693 | glColor3f(1,0,0); |
| 694 | 694 | glPushMatrix(); |
| 695 | − glutSolidSphere( sphereRadius, 15, 15 ); | |
| 695 | + glutSolidSphere(sphereRadius, 15, 15); | |
| 696 | 696 | glPopMatrix(); |
| 697 | 697 | |
| 698 | 698 | //draw a grid ground plane.... |
| 699 | 699 | drawGroundPlaneGrid(10.f); |
| 700 | 700 | |
| 701 | 701 | // Draw voxels |
| 702 | − if ( showingVoxels ) | |
| 702 | + if (showingVoxels) | |
| 703 | 703 | { |
| 704 | 704 | voxels.render(); |
| 705 | 705 | } |
| @@ -984,15 +984,15 @@ void display(void) · 278 unmodified lines | ||
| 984 | 984 | glMateriali(GL_FRONT, GL_SHININESS, 96); |
| 985 | 985 | |
| 986 | 986 | // camera settings |
| 987 | − if ( ::lookingInMirror ) { | |
| 987 | + if (::lookingInMirror) { | |
| 988 | 988 | // set the camera to looking at my own face |
| 989 | − myCamera.setTargetPosition ( myAvatar.getHeadPosition() ); | |
| 990 | − myCamera.setTargetYaw ( myAvatar.getBodyYaw() - 180.0f ); // 180 degrees from body yaw | |
| 991 | − myCamera.setPitch ( 0.0 ); | |
| 992 | − myCamera.setRoll ( 0.0 ); | |
| 993 | − myCamera.setUpShift ( 0.0 ); | |
| 994 | − myCamera.setDistance ( 0.2 ); | |
| 995 | − myCamera.setTightness ( 100.0f ); | |
| 989 | + myCamera.setTargetPosition (myAvatar.getHeadPosition()); | |
| 990 | + myCamera.setTargetYaw (myAvatar.getBodyYaw() - 180.0f); // 180 degrees from body yaw | |
| 991 | + myCamera.setPitch (0.0); | |
| 992 | + myCamera.setRoll (0.0); | |
| 993 | + myCamera.setUpShift (0.0); | |
| 994 | + myCamera.setDistance (0.2); | |
| 995 | + myCamera.setTightness (100.0f); | |
| 996 | 996 | } else { |
| 997 | 997 | |
| 998 | 998 | //float firstPersonPitch = 20.0f; |
| @@ -1010,36 +1010,24 @@ void display(void) · 11 unmodified lines | ||
| 1010 | 1010 | float thirdPersonDistance = 1.2f; |
| 1011 | 1011 | float thirdPersonTightness = 8.0f; |
| 1012 | 1012 | |
| 1013 | − if ( USING_FIRST_PERSON_EFFECT ) { | |
| 1013 | + if (USING_FIRST_PERSON_EFFECT) { | |
| 1014 | 1014 | float ff = 0.0; |
| 1015 | 1015 | float min = 0.1; |
| 1016 | 1016 | float max = 0.5; |
| 1017 | 1017 | |
| 1018 | − if ( myAvatar.getIsNearInteractingOther()){ | |
| 1019 | − if ( myAvatar.getSpeed() < max ) { | |
| 1018 | + if (myAvatar.getIsNearInteractingOther()){ | |
| 1019 | + if (myAvatar.getSpeed() < max) { | |
| 1020 | 1020 | |
| 1021 | 1021 | float s = (myAvatar.getSpeed()- min)/max ; |
| 1022 | 1022 | ff = 1.0 - s; |
| 1023 | 1023 | } |
| 1024 | 1024 | } |
| 1025 | − | |
| 1026 | − /* | |
| 1027 | − if ( ff < 0.8 ) { | |
| 1028 | − myAvatar.setDisplayingHead( true ); | |
| 1029 | − } else { | |
| 1030 | − myAvatar.setDisplayingHead( false ); | |
| 1031 | − } | |
| 1032 | − */ | |
| 1033 | − | |
| 1034 | − //printf( "ff = %f\n", ff ); | |
| 1035 | 1025 | |
| 1036 | − myCamera.setPitch ( thirdPersonPitch + ff * ( firstPersonPitch - thirdPersonPitch )); | |
| 1037 | − myCamera.setUpShift ( thirdPersonUpShift + ff * ( firstPersonUpShift - thirdPersonUpShift )); | |
| 1038 | − myCamera.setDistance ( thirdPersonDistance + ff * ( firstPersonDistance - thirdPersonDistance )); | |
| 1039 | − myCamera.setTightness ( thirdPersonTightness + ff * ( firstPersonTightness - thirdPersonTightness )); | |
| 1040 | − | |
| 1026 | + myCamera.setPitch (thirdPersonPitch + ff * (firstPersonPitch - thirdPersonPitch )); | |
| 1027 | + myCamera.setUpShift (thirdPersonUpShift + ff * (firstPersonUpShift - thirdPersonUpShift )); | |
| 1028 | + myCamera.setDistance (thirdPersonDistance + ff * (firstPersonDistance - thirdPersonDistance )); | |
| 1029 | + myCamera.setTightness (thirdPersonTightness + ff * (firstPersonTightness - thirdPersonTightness)); | |
| 1041 | 1030 | |
| 1042 | − | |
| 1043 | 1031 | // this version uses a ramp-up/ramp-down timer in the camera to determine shift between first and thirs-person view |
| 1044 | 1032 | /* |
| 1045 | 1033 | if ( myAvatar.getSpeed() < 0.02 ) { |
| @@ -1073,13 +1061,13 @@ void display(void) · 27 unmodified lines | ||
| 1073 | 1061 | myCamera.setTightness(thirdPersonTightness); |
| 1074 | 1062 | } |
| 1075 | 1063 | |
| 1076 | − myCamera.setTargetPosition( myAvatar.getHeadPosition() ); | |
| 1077 | − myCamera.setTargetYaw ( myAvatar.getBodyYaw() ); | |
| 1078 | − myCamera.setRoll ( 0.0 ); | |
| 1064 | + myCamera.setTargetPosition(myAvatar.getHeadPosition()); | |
| 1065 | + myCamera.setTargetYaw (myAvatar.getBodyYaw()); | |
| 1066 | + myCamera.setRoll (0.0); | |
| 1079 | 1067 | } |
| 1080 | 1068 | |
| 1081 | 1069 | // important... |
| 1082 | − myCamera.update( 1.f/FPS ); | |
| 1070 | + myCamera.update(1.f/FPS); | |
| 1083 | 1071 | |
| 1084 | 1072 | // Note: whichCamera is used to pick between the normal camera myCamera for our |
| 1085 | 1073 | // main camera, vs, an alternate camera. The alternate camera we support right now |
| @@ -1095,11 +1083,11 @@ void display(void) · 9 unmodified lines | ||
| 1095 | 1083 | if (::viewFrustumFromOffset && ::frustumOn) { |
| 1096 | 1084 | |
| 1097 | 1085 | // set the camera to third-person view but offset so we can see the frustum |
| 1098 | − viewFrustumOffsetCamera.setTargetYaw( ::viewFrustumOffsetYaw + myAvatar.getBodyYaw() ); | |
| 1099 | − viewFrustumOffsetCamera.setPitch ( ::viewFrustumOffsetPitch ); | |
| 1100 | − viewFrustumOffsetCamera.setRoll ( ::viewFrustumOffsetRoll ); | |
| 1101 | − viewFrustumOffsetCamera.setUpShift ( ::viewFrustumOffsetUp ); | |
| 1102 | − viewFrustumOffsetCamera.setDistance ( ::viewFrustumOffsetDistance ); | |
| 1086 | + viewFrustumOffsetCamera.setTargetYaw(::viewFrustumOffsetYaw + myAvatar.getBodyYaw() ); | |
| 1087 | + viewFrustumOffsetCamera.setPitch (::viewFrustumOffsetPitch ); | |
| 1088 | + viewFrustumOffsetCamera.setRoll (::viewFrustumOffsetRoll ); | |
| 1089 | + viewFrustumOffsetCamera.setUpShift (::viewFrustumOffsetUp ); | |
| 1090 | + viewFrustumOffsetCamera.setDistance (::viewFrustumOffsetDistance); | |
| 1103 | 1091 | viewFrustumOffsetCamera.update(1.f/FPS); |
| 1104 | 1092 | whichCamera = viewFrustumOffsetCamera; |
| 1105 | 1093 | } |
| @@ -1109,11 +1097,11 @@ void display(void) · 3 unmodified lines | ||
| 1109 | 1097 | // or could be viewFrustumOffsetCamera if in offset mode |
| 1110 | 1098 | // I changed the ordering here - roll is FIRST (JJV) |
| 1111 | 1099 | |
| 1112 | − glRotatef ( whichCamera.getRoll(), IDENTITY_FRONT.x, IDENTITY_FRONT.y, IDENTITY_FRONT.z ); | |
| 1113 | − glRotatef ( whichCamera.getPitch(), IDENTITY_RIGHT.x, IDENTITY_RIGHT.y, IDENTITY_RIGHT.z ); | |
| 1114 | − glRotatef ( 180.0 - whichCamera.getYaw(), IDENTITY_UP.x, IDENTITY_UP.y, IDENTITY_UP.z ); | |
| 1100 | + glRotatef ( whichCamera.getRoll(), IDENTITY_FRONT.x, IDENTITY_FRONT.y, IDENTITY_FRONT.z); | |
| 1101 | + glRotatef ( whichCamera.getPitch(), IDENTITY_RIGHT.x, IDENTITY_RIGHT.y, IDENTITY_RIGHT.z); | |
| 1102 | + glRotatef (180.0 - whichCamera.getYaw(), IDENTITY_UP.x, IDENTITY_UP.y, IDENTITY_UP.z ); | |
| 1115 | 1103 | |
| 1116 | − glTranslatef( -whichCamera.getPosition().x, -whichCamera.getPosition().y, -whichCamera.getPosition().z ); | |
| 1104 | + glTranslatef(-whichCamera.getPosition().x, -whichCamera.getPosition().y, -whichCamera.getPosition().z); | |
| 1117 | 1105 | |
| 1118 | 1106 | if (::oculusOn) { |
| 1119 | 1107 | displayOculus(whichCamera); |
| @@ -1666,16 +1654,16 @@ void idle(void) { · 546 unmodified lines | ||
| 1666 | 1654 | |
| 1667 | 1655 | // update behaviors for avatar hand movement: handControl takes mouse values as input, |
| 1668 | 1656 | // and gives back 3D values modulated for smooth transitioning between interaction modes. |
| 1669 | − handControl.update( mouseX, mouseY ); | |
| 1670 | − myAvatar.setHandMovementValues( handControl.getValues() ); | |
| 1657 | + handControl.update(mouseX, mouseY); | |
| 1658 | + myAvatar.setHandMovementValues(handControl.getValues()); | |
| 1671 | 1659 | |
| 1672 | 1660 | // tell my avatar if the mouse is being pressed... |
| 1673 | − if ( mousePressed) { | |
| 1661 | + if (mousePressed) { | |
| 1674 | 1662 | myAvatar.setMousePressed(mousePressed); |
| 1675 | 1663 | } |
| 1676 | 1664 | |
| 1677 | 1665 | // walking triggers the handControl to stop |
| 1678 | − if ( myAvatar.getMode() == AVATAR_MODE_WALKING ) { | |
| 1666 | + if (myAvatar.getMode() == AVATAR_MODE_WALKING) { | |
| 1679 | 1667 | handControl.stop(); |
| 1680 | 1668 | } |
| 1681 | 1669 | |
| @@ -1868,7 +1856,7 @@ int main(int argc, const char * argv[]) · 186 unmodified lines | ||
| 1868 | 1856 | |
| 1869 | 1857 | #ifdef _WIN32 |
| 1870 | 1858 | WSADATA WsaData; |
| 1871 | − int wsaresult = WSAStartup( MAKEWORD(2,2), &WsaData ); | |
| 1859 | + int wsaresult = WSAStartup(MAKEWORD(2,2), &WsaData); | |
| 1872 | 1860 | #endif |
| 1873 | 1861 | |
| 1874 | 1862 | // start the agentList threads |