Fixed incorrect maths (wrong sign, probably after swapping the axis).
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6730 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
148d09c4ba
commit
49dd6821a4
@ -61,7 +61,7 @@ void TerrainInfo::update(const Vec3& pos)
|
||||
float TerrainInfo::getTerrainPitch(float heading) const {
|
||||
if(m_HoT==Track::NOHIT) return 0.0f;
|
||||
|
||||
const float X =-sin(heading);
|
||||
const float X = sin(heading);
|
||||
const float Z = cos(heading);
|
||||
// Compute the angle between the normal of the plane and the line to
|
||||
// (x,0,z). (x,0,z) is normalised, so are the coordinates of the plane,
|
||||
@ -70,6 +70,6 @@ float TerrainInfo::getTerrainPitch(float heading) const {
|
||||
|
||||
// The actual angle computed above is between the normal and the (x, 0, z)
|
||||
// line, so to compute the actual angles 90 degrees must be subtracted.
|
||||
pitch = acosf(pitch) - NINETY_DEGREE_RAD;
|
||||
pitch = -acosf(pitch) + NINETY_DEGREE_RAD;
|
||||
return pitch;
|
||||
} // getTerrainPitch
|
||||
|
Loading…
x
Reference in New Issue
Block a user