mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 15:38:00 +02:00
Small tweaks to initial values for offset camera, so people can make sense of it
This commit is contained in:
parent
e825764304
commit
7a239fc7f0
2 changed files with 13 additions and 17 deletions
|
@ -13,7 +13,7 @@ Camera::Camera() {
|
||||||
_mode = CAMERA_MODE_THIRD_PERSON;
|
_mode = CAMERA_MODE_THIRD_PERSON;
|
||||||
_tightness = DEFAULT_CAMERA_TIGHTNESS;
|
_tightness = DEFAULT_CAMERA_TIGHTNESS;
|
||||||
_fieldOfView = 60.0; // default
|
_fieldOfView = 60.0; // default
|
||||||
_nearClip = 0.01; // default
|
_nearClip = 0.08; // default
|
||||||
_farClip = 50.0; // default
|
_farClip = 50.0; // default
|
||||||
_yaw = 0.0;
|
_yaw = 0.0;
|
||||||
_pitch = 0.0;
|
_pitch = 0.0;
|
||||||
|
|
|
@ -520,11 +520,11 @@ int frustumDrawingMode = FRUSTUM_DRAW_MODE_ALL; // the mode we're drawing the
|
||||||
bool frustumOn = false; // Whether or not to display the debug view frustum
|
bool frustumOn = false; // Whether or not to display the debug view frustum
|
||||||
bool cameraFrustum = true; // which frustum to look at
|
bool cameraFrustum = true; // which frustum to look at
|
||||||
|
|
||||||
bool viewFrustumFromOffset=false; // Wether or not to offset the view of the frustum
|
bool viewFrustumFromOffset =false; // Wether or not to offset the view of the frustum
|
||||||
float viewFrustumOffsetYaw = -90.0; // the following variables control yaw, pitch, roll and distance form regular
|
float viewFrustumOffsetYaw = -135.0; // the following variables control yaw, pitch, roll and distance form regular
|
||||||
float viewFrustumOffsetPitch = 7.5; // camera to the offset camera
|
float viewFrustumOffsetPitch = 0.0; // camera to the offset camera
|
||||||
float viewFrustumOffsetRoll = 0.0;
|
float viewFrustumOffsetRoll = 0.0;
|
||||||
float viewFrustumOffsetDistance = 0.0;
|
float viewFrustumOffsetDistance = 25.0;
|
||||||
float viewFrustumOffsetUp = 0.0;
|
float viewFrustumOffsetUp = 0.0;
|
||||||
|
|
||||||
void render_view_frustum() {
|
void render_view_frustum() {
|
||||||
|
@ -747,24 +747,20 @@ void display(void)
|
||||||
Camera viewFrustumOffsetCamera = myCamera;
|
Camera viewFrustumOffsetCamera = myCamera;
|
||||||
|
|
||||||
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.setYaw ( 180.0 - myAvatar.getBodyYaw() + ::viewFrustumOffsetYaw );
|
viewFrustumOffsetCamera.setYaw ( 180.0 - myAvatar.getBodyYaw() + ::viewFrustumOffsetYaw );
|
||||||
viewFrustumOffsetCamera.setPitch ( 0.0 + ::viewFrustumOffsetPitch );
|
viewFrustumOffsetCamera.setPitch ( ::viewFrustumOffsetPitch );
|
||||||
viewFrustumOffsetCamera.setRoll ( 0.0 + ::viewFrustumOffsetRoll );
|
viewFrustumOffsetCamera.setRoll ( ::viewFrustumOffsetRoll );
|
||||||
viewFrustumOffsetCamera.setUp ( 0.2 + ::viewFrustumOffsetUp );
|
viewFrustumOffsetCamera.setUp ( ::viewFrustumOffsetUp );
|
||||||
viewFrustumOffsetCamera.setDistance ( 0.5 + ::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(), 0, 0, 1 );
|
glRotatef ( whichCamera.getRoll(), 0, 0, 1 );
|
||||||
glRotatef ( whichCamera.getPitch(), 1, 0, 0 );
|
glRotatef ( whichCamera.getPitch(), 1, 0, 0 );
|
||||||
|
|
Loading…
Reference in a new issue