Added support of far camera to stk, updated final camera handling of track exporter.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4775 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-02-20 01:42:32 +00:00
parent 05cd009ed1
commit 9a767dcdbe
3 changed files with 11 additions and 0 deletions

View File

@ -131,6 +131,7 @@ void Camera::setupCamera()
} // switch } // switch
m_camera->setFOV(m_fov); m_camera->setFOV(m_fov);
m_camera->setAspectRatio(m_aspect); m_camera->setAspectRatio(m_aspect);
m_camera->setFarValue(World::getWorld()->getTrack()->getCameraFar());
} // setupCamera } // setupCamera
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@ -72,6 +72,7 @@ Track::Track(std::string filename)
m_all_meshes.clear(); m_all_meshes.clear();
m_has_final_camera = false; m_has_final_camera = false;
m_is_arena = false; m_is_arena = false;
m_camera_far = 1000.0f;
m_quad_graph = NULL; m_quad_graph = NULL;
m_animation_manager = NULL; m_animation_manager = NULL;
m_check_manager = NULL; m_check_manager = NULL;
@ -719,6 +720,10 @@ void Track::loadTrackModel(unsigned int mode_id)
node->get("h", &h); node->get("h", &h);
m_start_heading.push_back(h); m_start_heading.push_back(h);
} }
else if(name=="camera")
{
node->get("far", &m_camera_far);
}
else if(name=="animations") else if(name=="animations")
{ {
m_animation_manager = new AnimationManager(*this, *node); m_animation_manager = new AnimationManager(*this, *node);

View File

@ -89,6 +89,8 @@ private:
/** The version of this track. A certain STK version will only support /** The version of this track. A certain STK version will only support
* certain track versions. */ * certain track versions. */
int m_version; int m_version;
/** Far value for cameras for this track. */
float m_camera_far;
/** The graph used to connect the quads. */ /** The graph used to connect the quads. */
QuadGraph *m_quad_graph; QuadGraph *m_quad_graph;
@ -267,6 +269,9 @@ public:
/** Sets the current ambient color for a kart with index k. */ /** Sets the current ambient color for a kart with index k. */
void setAmbientColor(const video::SColor &color, void setAmbientColor(const video::SColor &color,
unsigned int k); unsigned int k);
/** Returns the far value for cameras. */
float getCameraFar() const { return m_camera_far; }
/** Get the number of start positions defined in the scene file. */ /** Get the number of start positions defined in the scene file. */
unsigned int getNumberOfStartPositions() const unsigned int getNumberOfStartPositions() const
{ return m_start_positions.size(); } { return m_start_positions.size(); }