[Orxonox-commit 2166] r6882 - in code/branches/fps: data/levels src/orxonox/worldentities/pawns
edwind at orxonox.net
edwind at orxonox.net
Mon May 10 16:14:28 CEST 2010
Author: edwind
Date: 2010-05-10 16:14:28 +0200 (Mon, 10 May 2010)
New Revision: 6882
Modified:
code/branches/fps/data/levels/fps_test.oxw
code/branches/fps/src/orxonox/worldentities/pawns/FpsPlayer.cc
Log:
commit by ed
Modified: code/branches/fps/data/levels/fps_test.oxw
===================================================================
--- code/branches/fps/data/levels/fps_test.oxw 2010-05-10 14:00:52 UTC (rev 6881)
+++ code/branches/fps/data/levels/fps_test.oxw 2010-05-10 14:14:28 UTC (rev 6882)
@@ -20,7 +20,7 @@
>
<Light type=directional position="0,-100000,0" direction="0.02, -1, 0.05" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
- <StaticEntity position="0,-10000,0" direction="0,-1,2" collisionType=static mass=100000 friction=0.01 >
+ <StaticEntity position="0,-10000,0" direction="0,-1,0" collisionType=static mass=100000 friction=0.01 >
<attached>
<Model position="0,0,0" mesh="cube.mesh" scale3D="10000,10000,1000" />
</attached>
Modified: code/branches/fps/src/orxonox/worldentities/pawns/FpsPlayer.cc
===================================================================
--- code/branches/fps/src/orxonox/worldentities/pawns/FpsPlayer.cc 2010-05-10 14:00:52 UTC (rev 6881)
+++ code/branches/fps/src/orxonox/worldentities/pawns/FpsPlayer.cc 2010-05-10 14:14:28 UTC (rev 6882)
@@ -146,7 +146,18 @@
{
this->yaw(Radian(this->yaw_ * this->getMouseLookSpeed()),WorldEntity::Parent);
//this->pitch(Radian(this->pitch_ * this->getMouseLookSpeed()));
- this->cameraPositionRootNode_->pitch(Radian(this->pitch_ * this->getMouseLookSpeed()));
+ Radian pitch=this->cameraPositionRootNode_->getOrientation().getPitch();
+ if( pitch<Radian(1.5707) && pitch>Radian(-1.5707) ) this->cameraPositionRootNode_->pitch(Radian(this->pitch_ * this->getMouseLookSpeed()));
+ else if(pitch<Radian(-1.5707)){
+ if(this->pitch_>0.0) this->cameraPositionRootNode_->pitch(Radian(this->pitch_ * this->getMouseLookSpeed()));
+ else if(pitch<Radian(-1.571)) this->cameraPositionRootNode_->pitch(-pitch+Radian(-1.570796));
+ }
+ else if(pitch>Radian(1.5707)){
+ if(this->pitch_<0.0) this->cameraPositionRootNode_->pitch(Radian(this->pitch_ * this->getMouseLookSpeed()));
+ else if(pitch>Radian(1.571)) this->cameraPositionRootNode_->pitch(-pitch+Radian(1.570796));
+ }
+
+
// this->roll(Radian(this->roll_ * this->getMouseLookSpeed()));
}
More information about the Orxonox-commit
mailing list