2011-10-25 05:03:10 +00:00
|
|
|
//
|
|
|
|
|
// KRSettings.cpp
|
|
|
|
|
// KREngine
|
|
|
|
|
//
|
2012-03-15 20:09:01 +00:00
|
|
|
// Copyright 2012 Kearwood Gilbert. All rights reserved.
|
2011-10-25 06:16:47 +00:00
|
|
|
//
|
|
|
|
|
// Redistribution and use in source and binary forms, with or without modification, are
|
|
|
|
|
// permitted provided that the following conditions are met:
|
|
|
|
|
//
|
|
|
|
|
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
|
|
|
// conditions and the following disclaimer.
|
|
|
|
|
//
|
|
|
|
|
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
|
|
|
// of conditions and the following disclaimer in the documentation and/or other materials
|
|
|
|
|
// provided with the distribution.
|
|
|
|
|
//
|
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY KEARWOOD GILBERT ''AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
|
|
|
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KEARWOOD GILBERT OR
|
|
|
|
|
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
|
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
|
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
|
|
|
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
|
|
|
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
|
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
//
|
|
|
|
|
// The views and conclusions contained in the software and documentation are those of the
|
|
|
|
|
// authors and should not be interpreted as representing official policies, either expressed
|
|
|
|
|
// or implied, of Kearwood Gilbert.
|
2011-10-25 05:03:10 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
#import "KRCamera.h"
|
|
|
|
|
|
|
|
|
|
KRCamera::KRCamera() {
|
|
|
|
|
double const PI = 3.141592653589793f;
|
|
|
|
|
|
|
|
|
|
bShowShadowBuffer = false;
|
|
|
|
|
bEnablePerPixel = true;
|
|
|
|
|
bEnableDiffuseMap = true;
|
|
|
|
|
bEnableNormalMap = true;
|
|
|
|
|
bEnableSpecMap = true;
|
|
|
|
|
bDebugPSSM = false;
|
|
|
|
|
bEnableAmbient = true;
|
|
|
|
|
bEnableDiffuse = true;
|
|
|
|
|
bEnableSpecular = true;
|
2012-04-12 06:25:44 +00:00
|
|
|
bEnableLightMap = true;
|
2011-10-25 05:03:10 +00:00
|
|
|
bDebugSuperShiny = false;
|
2012-04-13 01:13:18 +00:00
|
|
|
bEnableDeferredLighting = false;
|
2011-10-25 05:03:10 +00:00
|
|
|
|
2012-03-29 19:39:28 +00:00
|
|
|
|
2011-10-25 05:03:10 +00:00
|
|
|
dAmbientR = 0.25f;
|
|
|
|
|
dAmbientG = 0.25f;
|
|
|
|
|
dAmbientB = 0.35f;
|
|
|
|
|
|
|
|
|
|
dSunR = 1.0f;
|
|
|
|
|
dSunG = 1.0f;
|
|
|
|
|
dSunB = 0.70f;
|
|
|
|
|
|
|
|
|
|
perspective_fov = PI / 8.0;
|
|
|
|
|
perspective_aspect = 1.3333;
|
|
|
|
|
perspective_nearz = 0.25f;
|
|
|
|
|
perspective_farz = 100.0f;
|
|
|
|
|
|
|
|
|
|
dof_quality = 0;
|
|
|
|
|
dof_depth = 0.05f;
|
|
|
|
|
dof_falloff = 0.05f;
|
|
|
|
|
|
|
|
|
|
bEnableFlash = false;
|
|
|
|
|
flash_intensity = 1.0f;
|
|
|
|
|
flash_depth = 0.7f;
|
|
|
|
|
flash_falloff = 0.5f;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bEnableVignette = false;
|
|
|
|
|
vignette_radius = 0.4f;
|
|
|
|
|
vignette_falloff = 1.0f;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KRCamera::~KRCamera() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KRMat4 KRCamera::getProjectionMatrix() {
|
|
|
|
|
KRMat4 projectionMatrix;
|
|
|
|
|
projectionMatrix.perspective(perspective_fov, perspective_aspect, perspective_nearz, perspective_farz);
|
|
|
|
|
projectionMatrix.rotate(-90 * 0.0174532925199, Z_AXIS);
|
|
|
|
|
return projectionMatrix;
|
|
|
|
|
}
|