stk-code_catmod/src/terrain_info.hpp
hikerstk 6daa2ef2d0 1) Removed more windows warnings.
2) Cleanup of old unused, and non-bullet code
3) Fixed wheelies, though they are currently still
   disabled in the stk_config.data file since the
   AI crashes with the new wheelie implementation.



git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1365 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2007-12-20 04:37:35 +00:00

52 lines
2.1 KiB
C++

// $Id: terrain_info.hpp 1284 2007-11-08 12:31:54Z hikerstk $
//
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2007 Joerg Henrichs
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTe ABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef HEADER_TERRAIN_INFO_H
#define HEADER_TERRAIN_INFO_H
#include "btBulletDynamicsCommon.h"
#include "material.hpp"
/** This class stores information about the triangle that's under an object, i.e.:
* the normal, a pointer to the material, and the height above th
*/
class TerrainInfo
{
private:
int m_HoT_frequency; // how often hight of terrain is computed
int m_HoT_counter; // compute HAT only every N timesteps
btVector3 m_normal; // normal of the triangle under the object
const Material *m_material; // material of the triangle under the object
float m_HoT; // height of terrain
public:
TerrainInfo(int frequency=1) {m_HoT_frequency=frequency;
m_HoT_counter=frequency; }
TerrainInfo(btVector3 &pos, int frequency=1);
virtual ~TerrainInfo() {};
virtual void update(btVector3 &pos);
float getHoT() const { return m_HoT; }
const Material* getMaterial() const { return m_material; }
const btVector3& getNormal() const { return m_normal; }
float getTerrainPitch(float heading) const;
}; // TerrainInfo
#endif