Made the backwards facing camera using a higher angle to make
it more useful (actual angle can be determined in stk_config.xml). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6155 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
6432d83c27
commit
4976d9d60c
@ -117,8 +117,15 @@
|
||||
of the chassis. -->
|
||||
<center gravity-shift="0 0.3 0"/>
|
||||
|
||||
<!-- Camera: Distance between kart and camera. -->
|
||||
<camera distance="1.5" up-angle="15"/>
|
||||
<!-- Camera: Distance between kart and camera.
|
||||
forward-up-angle: Angle between camera and plane of kart (pitch)
|
||||
when the camera is pointing forward
|
||||
backward-up-angke: Angle between camera and plane of kart (pitch)
|
||||
when the camera is pointing backwards. This is usually
|
||||
larger than the forward-up-angle, since the kart itself
|
||||
otherwise obstricts too much of the view. -->
|
||||
<camera distance="1.5" forward-up-angle="15"
|
||||
backward-up-angle="30"/>
|
||||
|
||||
<!-- If a kart starts within the specified time after 'go',
|
||||
it receives the corresponding bonus from 'boost'. Those
|
||||
|
@ -296,7 +296,7 @@ void Camera::computeNormalCameraPosition(Vec3 *wanted_position,
|
||||
float dampened_steer = fabsf(steering) * steering;
|
||||
float angle_around = m_kart->getHeading()
|
||||
+ m_rotation_range * dampened_steer * 0.5f;
|
||||
float angle_up = m_kart->getKartProperties()->getCameraUpAngle()
|
||||
float angle_up = m_kart->getKartProperties()->getCameraForwardUpAngle()
|
||||
- m_kart->getPitch() ;
|
||||
|
||||
wanted_position->setX(-sin(angle_around));
|
||||
@ -347,7 +347,7 @@ void Camera::update(float dt)
|
||||
{
|
||||
wanted_target.setY(wanted_target.getY()+ 0.75f);
|
||||
float angle_around = m_kart->getHeading();
|
||||
float angle_up = m_kart->getKartProperties()->getCameraUpAngle()
|
||||
float angle_up = m_kart->getKartProperties()->getCameraBackwardUpAngle()
|
||||
- m_kart->getPitch() ;
|
||||
wanted_position.setX( sin(angle_around));
|
||||
wanted_position.setY( sin(angle_up) );
|
||||
@ -438,7 +438,7 @@ void Camera::handleEndCamera(float dt)
|
||||
//+ m_rotation_range * m_kart->getSteerPercent()
|
||||
//* m_kart->getSkidding()
|
||||
;
|
||||
float angle_up = m_kart->getKartProperties()->getCameraUpAngle()
|
||||
float angle_up = m_kart->getKartProperties()->getCameraBackwardUpAngle()
|
||||
- m_kart->getPitch() ;
|
||||
Vec3 wanted_position;
|
||||
wanted_position.setX( sin(angle_around));
|
||||
|
@ -77,7 +77,8 @@ KartProperties::KartProperties(const std::string &filename)
|
||||
m_skid_decrease = m_skid_increase = m_skid_visual = m_skid_max =
|
||||
m_slipstream_length = m_slipstream_collect_time =
|
||||
m_slipstream_use_time = m_slipstream_add_power =
|
||||
m_slipstream_min_speed = m_camera_distance = m_camera_up_angle =
|
||||
m_slipstream_min_speed = m_camera_distance =
|
||||
m_camera_forward_up_angle = m_camera_backward_up_angle =
|
||||
m_rescue_time = m_rescue_height = m_explosion_time =
|
||||
m_explosion_radius = m_ai_steering_variation = UNDEFINED;
|
||||
m_gravity_center_shift = Vec3(UNDEFINED);
|
||||
@ -396,8 +397,10 @@ void KartProperties::getAllData(const XMLNode * root)
|
||||
if(const XMLNode *camera_node= root->getNode("camera"))
|
||||
{
|
||||
camera_node->get("distance", &m_camera_distance);
|
||||
camera_node->get("up-angle", &m_camera_up_angle);
|
||||
m_camera_up_angle *= DEGREE_TO_RAD;
|
||||
camera_node->get("forward-up-angle", &m_camera_forward_up_angle);
|
||||
m_camera_forward_up_angle *= DEGREE_TO_RAD;
|
||||
camera_node->get("backward-up-angle", &m_camera_backward_up_angle);
|
||||
m_camera_backward_up_angle *= DEGREE_TO_RAD;
|
||||
}
|
||||
|
||||
if(const XMLNode *startup_node= root->getNode("startup"))
|
||||
@ -521,7 +524,8 @@ void KartProperties::checkAllSet(const std::string &filename)
|
||||
CHECK_NEG(m_slipstream_add_power, "slipstream add-power" );
|
||||
CHECK_NEG(m_slipstream_min_speed, "slipstream min-speed" );
|
||||
CHECK_NEG(m_camera_distance, "camera distance" );
|
||||
CHECK_NEG(m_camera_up_angle, "camera up-angle" );
|
||||
CHECK_NEG(m_camera_forward_up_angle, "camera forward-up-angle" );
|
||||
CHECK_NEG(m_camera_backward_up_angle, "camera forward-up-angle" );
|
||||
CHECK_NEG(m_nitro_power_boost, "nitro power-boost" );
|
||||
CHECK_NEG(m_nitro_consumption, "nitro consumption" );
|
||||
CHECK_NEG(m_nitro_big_container, "nitro big-container" );
|
||||
|
@ -201,8 +201,12 @@ private:
|
||||
float m_ai_steering_variation;
|
||||
|
||||
float m_camera_distance; /**< Distance of normal camera from kart.*/
|
||||
float m_camera_up_angle; /**< Up angle of the camera in relation to
|
||||
the pitch of the kart. */
|
||||
float m_camera_forward_up_angle; /**< Up angle of the camera in relation to
|
||||
the pitch of the kart when driving
|
||||
forwards. */
|
||||
float m_camera_backward_up_angle; /**< Up angle of the camera in relation to
|
||||
the pitch of the kart when driving
|
||||
backwards. */
|
||||
|
||||
/** The following two vectors define at what ratio of the maximum speed what
|
||||
* gear is selected. E.g. 0.25 means: if speed <=0.25*maxSpeed --> gear 1,
|
||||
@ -443,7 +447,10 @@ public:
|
||||
float getCameraDistance () const {return m_camera_distance; }
|
||||
|
||||
/** Returns the angle the camera has relative to the pitch of the kart. */
|
||||
float getCameraUpAngle () const {return m_camera_up_angle; }
|
||||
float getCameraForwardUpAngle () const {return m_camera_forward_up_angle; }
|
||||
|
||||
/** Returns the angle the camera has relative to the pitch of the kart. */
|
||||
float getCameraBackwardUpAngle () const {return m_camera_backward_up_angle; }
|
||||
|
||||
/** Returns AI steering variation value. */
|
||||
float getAISteeringVariation () const {return m_ai_steering_variation; }
|
||||
|
Loading…
Reference in New Issue
Block a user