Improved splitscreen camera settings (thanks to Minibjorn).
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2967 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
9d7c64d675
commit
c0f4e4555a
@ -33,6 +33,7 @@
|
|||||||
Camera::Camera(int camera_index, const Kart* kart)
|
Camera::Camera(int camera_index, const Kart* kart)
|
||||||
{
|
{
|
||||||
m_mode = CM_NORMAL;
|
m_mode = CM_NORMAL;
|
||||||
|
m_index = camera_index;
|
||||||
m_context = new ssgContext ;
|
m_context = new ssgContext ;
|
||||||
m_distance = kart->getKartProperties()->getCameraDistance();
|
m_distance = kart->getKartProperties()->getCameraDistance();
|
||||||
m_kart = kart;
|
m_kart = kart;
|
||||||
@ -126,8 +127,10 @@ void Camera::setMode(Mode mode)
|
|||||||
// In 2 and 3 player mode we have a different FOV and would not see our
|
// In 2 and 3 player mode we have a different FOV and would not see our
|
||||||
// kart at the default distance. We use 1.5 times the distance to fix that.
|
// kart at the default distance. We use 1.5 times the distance to fix that.
|
||||||
const int num_players = race_manager->getNumPlayers();
|
const int num_players = race_manager->getNumPlayers();
|
||||||
if (num_players == 2 || num_players == 3)
|
if(num_players==2 || (num_players==3 && m_index==3) )
|
||||||
m_distance += m_distance / 2;
|
m_distance += m_distance*0.5f;
|
||||||
|
else if(num_players>=3)
|
||||||
|
m_distance += m_distance*0.3333333f;
|
||||||
}
|
}
|
||||||
} // setMode
|
} // setMode
|
||||||
|
|
||||||
|
@ -39,12 +39,12 @@ public:
|
|||||||
CM_SIMPLE_REPLAY
|
CM_SIMPLE_REPLAY
|
||||||
};
|
};
|
||||||
protected:
|
protected:
|
||||||
ssgContext *m_context ;
|
ssgContext *m_context;
|
||||||
// sgCoord m_current_pos;
|
|
||||||
Vec3 m_xyz; // current position of camera
|
Vec3 m_xyz; // current position of camera
|
||||||
Vec3 m_hpr; // heading, pitch, roll of camera
|
Vec3 m_hpr; // heading, pitch, roll of camera
|
||||||
const Kart *m_kart; // the kart the camera is attached to
|
const Kart *m_kart; // the kart the camera is attached to
|
||||||
Mode m_mode; // CM_ value, see above
|
Mode m_mode; // CM_ value, see above
|
||||||
|
int m_index; /**<Index of camera. */
|
||||||
float m_x, m_y, m_w, m_h; // window to us
|
float m_x, m_y, m_w, m_h; // window to us
|
||||||
float m_current_speed; // current speed of camera
|
float m_current_speed; // current speed of camera
|
||||||
float m_last_pitch; // for tiling the camera when going downhill
|
float m_last_pitch; // for tiling the camera when going downhill
|
||||||
|
Loading…
x
Reference in New Issue
Block a user