Merge branch 'GameClient' of https://github.com/dean11/Danbias into GameClient

This commit is contained in:
lanariel 2014-02-18 12:02:58 +01:00
commit 0a70839211
3 changed files with 6 additions and 9 deletions

View File

@ -112,8 +112,7 @@ void Camera_FPS::StrafeLeft( Float distance )
void Camera_FPS::PitchUp( Float radian )
{
//this->pitchUp = Clamp( this->pitchUp + radian, -0.48f * pi, 0.48f * pi );
this->pitchUp = this->pitchUp + radian; // debug hack
this->pitchUp = Clamp( this->pitchUp + radian, -0.48f * pi, 0.48f * pi );
this->head.SetAngular( this->body.angularAxis + this->pitchUp * this->body.direction.v[0] );
}

View File

@ -89,12 +89,6 @@ bool GameState::Init( SharedStateContent &shared )
// Debugg hack
this->InitiatePlayer( 0, "crate_generic.dan",Float3( 0,132, 10), Quaternion::identity, Float3(1), true );
Graphics::Definitions::Pointlight light;
light.Pos = Float3( 0,132,0);
light.Color = Float3( 1.0f );
light.Bright = 1.0f;
light.Radius = 1000.0f;
Graphics::API::AddLight( light );
// end debug hack
return true;

View File

@ -337,7 +337,11 @@ namespace Utility
template<typename ValueType>
inline ValueType Clamp( const ValueType &value, const ValueType &min, const ValueType &max )
{ return value < min ? Max( value, max ) : min; }
{
if( value < min ) return min;
if( value > max ) return max;
return value;
}
template<typename ValueType>
inline ValueType Average( const ValueType &valueA, const ValueType &valueB )