mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 05:57:29 +02:00
cleaned up some tabbing issues in main.cpp
This commit is contained in:
parent
f86a92fef0
commit
4b18a25b7f
1 changed files with 34 additions and 34 deletions
|
@ -113,7 +113,7 @@ bool wantColorRandomizer = true; // for addSphere and load file
|
||||||
|
|
||||||
Oscilloscope audioScope(256,200,true);
|
Oscilloscope audioScope(256,200,true);
|
||||||
|
|
||||||
ViewFrustum viewFrustum; // current state of view frustum, perspective, orientation, etc.
|
ViewFrustum viewFrustum; // current state of view frustum, perspective, orientation, etc.
|
||||||
|
|
||||||
Avatar myAvatar(true); // The rendered avatar of oneself
|
Avatar myAvatar(true); // The rendered avatar of oneself
|
||||||
Camera myCamera; // My view onto the world (sometimes on myself :)
|
Camera myCamera; // My view onto the world (sometimes on myself :)
|
||||||
|
@ -704,16 +704,16 @@ void display(void)
|
||||||
glMaterialfv(GL_FRONT, GL_SPECULAR, specular_color);
|
glMaterialfv(GL_FRONT, GL_SPECULAR, specular_color);
|
||||||
glMateriali(GL_FRONT, GL_SHININESS, 96);
|
glMateriali(GL_FRONT, GL_SHININESS, 96);
|
||||||
|
|
||||||
// camera settings
|
// camera settings
|
||||||
if ( ::lookingInMirror ) {
|
if ( ::lookingInMirror ) {
|
||||||
// set the camera to looking at my own face
|
// set the camera to looking at my own face
|
||||||
myCamera.setTargetPosition ( myAvatar.getHeadPosition() );
|
myCamera.setTargetPosition ( myAvatar.getHeadPosition() );
|
||||||
myCamera.setTargetYaw ( myAvatar.getBodyYaw() - 180.0f ); // 180 degrees from body yaw
|
myCamera.setTargetYaw ( myAvatar.getBodyYaw() - 180.0f ); // 180 degrees from body yaw
|
||||||
myCamera.setPitch ( 0.0 );
|
myCamera.setPitch ( 0.0 );
|
||||||
myCamera.setRoll ( 0.0 );
|
myCamera.setRoll ( 0.0 );
|
||||||
myCamera.setUpShift ( 0.0 );
|
myCamera.setUpShift ( 0.0 );
|
||||||
myCamera.setDistance ( 0.2 );
|
myCamera.setDistance ( 0.2 );
|
||||||
myCamera.setTightness ( 100.0f );
|
myCamera.setTightness ( 100.0f );
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
//float firstPersonPitch = 20.0f;
|
//float firstPersonPitch = 20.0f;
|
||||||
|
@ -788,15 +788,15 @@ void display(void)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
myCamera.setPitch (thirdPersonPitch );
|
myCamera.setPitch (thirdPersonPitch );
|
||||||
myCamera.setUpShift (thirdPersonUpShift );
|
myCamera.setUpShift (thirdPersonUpShift );
|
||||||
myCamera.setDistance (thirdPersonDistance );
|
myCamera.setDistance (thirdPersonDistance );
|
||||||
myCamera.setTightness(thirdPersonTightness);
|
myCamera.setTightness(thirdPersonTightness);
|
||||||
}
|
}
|
||||||
|
|
||||||
myCamera.setTargetPosition( myAvatar.getHeadPosition() );
|
myCamera.setTargetPosition( myAvatar.getHeadPosition() );
|
||||||
myCamera.setTargetYaw ( myAvatar.getBodyYaw() );
|
myCamera.setTargetYaw ( myAvatar.getBodyYaw() );
|
||||||
myCamera.setRoll ( 0.0 );
|
myCamera.setRoll ( 0.0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// important...
|
// important...
|
||||||
|
@ -815,24 +815,24 @@ void display(void)
|
||||||
|
|
||||||
if (::viewFrustumFromOffset && ::frustumOn) {
|
if (::viewFrustumFromOffset && ::frustumOn) {
|
||||||
|
|
||||||
// set the camera to third-person view but offset so we can see the frustum
|
// set the camera to third-person view but offset so we can see the frustum
|
||||||
viewFrustumOffsetCamera.setTargetYaw( ::viewFrustumOffsetYaw + myAvatar.getBodyYaw() );
|
viewFrustumOffsetCamera.setTargetYaw( ::viewFrustumOffsetYaw + myAvatar.getBodyYaw() );
|
||||||
viewFrustumOffsetCamera.setPitch ( ::viewFrustumOffsetPitch );
|
viewFrustumOffsetCamera.setPitch ( ::viewFrustumOffsetPitch );
|
||||||
viewFrustumOffsetCamera.setRoll ( ::viewFrustumOffsetRoll );
|
viewFrustumOffsetCamera.setRoll ( ::viewFrustumOffsetRoll );
|
||||||
viewFrustumOffsetCamera.setUpShift ( ::viewFrustumOffsetUp );
|
viewFrustumOffsetCamera.setUpShift ( ::viewFrustumOffsetUp );
|
||||||
viewFrustumOffsetCamera.setDistance ( ::viewFrustumOffsetDistance );
|
viewFrustumOffsetCamera.setDistance ( ::viewFrustumOffsetDistance );
|
||||||
viewFrustumOffsetCamera.update(1.f/FPS);
|
viewFrustumOffsetCamera.update(1.f/FPS);
|
||||||
whichCamera = viewFrustumOffsetCamera;
|
whichCamera = viewFrustumOffsetCamera;
|
||||||
}
|
}
|
||||||
|
|
||||||
// transform view according to whichCamera
|
// transform view according to whichCamera
|
||||||
// could be myCamera (if in normal mode)
|
// could be myCamera (if in normal mode)
|
||||||
// or could be viewFrustumOffsetCamera if in offset mode
|
// or could be viewFrustumOffsetCamera if in offset mode
|
||||||
// I changed the ordering here - roll is FIRST (JJV)
|
// I changed the ordering here - roll is FIRST (JJV)
|
||||||
|
|
||||||
glRotatef ( whichCamera.getRoll(), IDENTITY_FRONT.x, IDENTITY_FRONT.y, IDENTITY_FRONT.z );
|
glRotatef ( whichCamera.getRoll(), IDENTITY_FRONT.x, IDENTITY_FRONT.y, IDENTITY_FRONT.z );
|
||||||
glRotatef ( whichCamera.getPitch(), IDENTITY_RIGHT.x, IDENTITY_RIGHT.y, IDENTITY_RIGHT.z );
|
glRotatef ( whichCamera.getPitch(), IDENTITY_RIGHT.x, IDENTITY_RIGHT.y, IDENTITY_RIGHT.z );
|
||||||
glRotatef ( 180.0 - whichCamera.getYaw(), IDENTITY_UP.x, IDENTITY_UP.y, IDENTITY_UP.z );
|
glRotatef ( 180.0 - whichCamera.getYaw(), IDENTITY_UP.x, IDENTITY_UP.y, IDENTITY_UP.z );
|
||||||
|
|
||||||
glTranslatef( -whichCamera.getPosition().x, -whichCamera.getPosition().y, -whichCamera.getPosition().z );
|
glTranslatef( -whichCamera.getPosition().x, -whichCamera.getPosition().y, -whichCamera.getPosition().z );
|
||||||
|
|
||||||
|
@ -849,18 +849,18 @@ void display(void)
|
||||||
// draw a red sphere
|
// draw a red sphere
|
||||||
float sphereRadius = 0.25f;
|
float sphereRadius = 0.25f;
|
||||||
glColor3f(1,0,0);
|
glColor3f(1,0,0);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glutSolidSphere( sphereRadius, 15, 15 );
|
glutSolidSphere( sphereRadius, 15, 15 );
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
|
||||||
//draw a grid ground plane....
|
//draw a grid ground plane....
|
||||||
drawGroundPlaneGrid( 5.0f, 9 );
|
drawGroundPlaneGrid( 5.0f, 9 );
|
||||||
|
|
||||||
// Draw voxels
|
// Draw voxels
|
||||||
if ( showingVoxels )
|
if ( showingVoxels )
|
||||||
{
|
{
|
||||||
voxels.render();
|
voxels.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render avatars of other agents
|
// Render avatars of other agents
|
||||||
AgentList* agentList = AgentList::getInstance();
|
AgentList* agentList = AgentList::getInstance();
|
||||||
|
|
Loading…
Reference in a new issue