diff --git a/src/Makefile.am b/src/Makefile.am index d6f90acc6..404ca52ce 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,6 +26,7 @@ libstatic_ssg_a_CXXFLAGS = @NOREGMOVE@ AM_CPPFLAGS=-DSUPERTUXKART_DATADIR="\"$(datadir)/games/@PACKAGE@/\"" supertuxkart_SOURCES = main.cpp \ + vec3.cpp vec3.hpp \ actionmap.cpp actionmap.hpp \ material.cpp material.hpp \ material_manager.cpp material_manager.hpp \ @@ -39,7 +40,7 @@ supertuxkart_SOURCES = main.cpp \ music_information.cpp music_information.hpp \ sfx_openal.cpp sfx_openal.hpp \ smoke.cpp smoke.hpp \ - input.hpp \ + input.hpp \ isect.cpp isect.hpp \ track.cpp track.hpp \ herring.cpp herring.hpp \ @@ -90,7 +91,6 @@ supertuxkart_SOURCES = main.cpp \ scene.hpp scene.cpp \ no_copy.hpp constants.hpp \ translation.cpp translation.hpp \ - traffic.cpp \ player.hpp \ challenges/challenge.hpp challenges/challenge.cpp \ challenges/energy_math_class.cpp challenges/energy_math_class.hpp\ diff --git a/src/attachment.cpp b/src/attachment.cpp index 9278d6dcb..b8d74fdd7 100644 --- a/src/attachment.cpp +++ b/src/attachment.cpp @@ -69,13 +69,7 @@ void Attachment::hitGreenHerring() float leftover_time = 0.0f; switch(getType()) // If there already is an attachment, make it worse :) { - case ATTACH_BOMB: projectile_manager->newExplosion(m_kart->getCoord()); - // Best solution would probably be to trigger the - // explosion, and then to attach a new, random - // attachment. Unfortunately, handleExplosion() is not - // really severe enough, and forceRescue() attaches - // tinytux, so that the new attachment is immediately lost. - // m_kart->handleExplosion(m_kart->getCoord()->xyz, true); + case ATTACH_BOMB: projectile_manager->newExplosion(m_kart->getPos()); m_kart->handleExplosion(m_kart->getPos(), /*direct_hit*/ true); clear(); random_attachment = rand()%3; @@ -145,7 +139,7 @@ void Attachment::update(float dt) case ATTACH_MAX: break; case ATTACH_BOMB: if(m_time_left<=0.0) { - projectile_manager->newExplosion(m_kart->getCoord()); + projectile_manager->newExplosion(m_kart->getPos()); m_kart->handleExplosion(m_kart->getPos(), /*direct_hit*/ true); } diff --git a/src/explosion.cpp b/src/explosion.cpp index cddf1a89b..f743bcf7b 100644 --- a/src/explosion.cpp +++ b/src/explosion.cpp @@ -24,7 +24,7 @@ #include "scene.hpp" -Explosion::Explosion(sgCoord* coord) : ssgTransform() +Explosion::Explosion(const Vec3& coord) : ssgTransform() { this->ref(); ssgCutout *cut = new ssgCutout(); @@ -35,11 +35,14 @@ Explosion::Explosion(sgCoord* coord) : ssgTransform() } // Explosion //----------------------------------------------------------------------------- -void Explosion::init(sgCoord* coord) +void Explosion::init(const Vec3& coord) { sound_manager->playSfx( SOUND_EXPLOSION ); - setTransform(coord); + sgCoord c; + c.xyz[0]=coord[0];c.xyz[1]=coord[1];c.xyz[2]=coord[2]; + c.hpr[0]=0; c.hpr[1]=0; c.hpr[2]=0; + setTransform(&c); m_step = -1; scene->add(this); } @@ -58,5 +61,3 @@ void Explosion::update (float dt) m_seq -> selectStep ( m_step ) ; } - - diff --git a/src/explosion.hpp b/src/explosion.hpp index 89bfa810c..8a49ffa41 100644 --- a/src/explosion.hpp +++ b/src/explosion.hpp @@ -21,6 +21,7 @@ #define HEADER_EXPLOSION_H #include +#include "vec3.hpp" class Explosion : public ssgTransform { @@ -29,8 +30,8 @@ public: ssgSelector *m_seq ; public: - Explosion(sgCoord* coord); - void init (sgCoord *coord); + Explosion(const Vec3& coord); + void init (const Vec3& coord); void update (float delta_t); int inUse () {return (m_step >= 0); } bool hasEnded () {return m_step >= m_seq->getNumKids(); } diff --git a/src/flyable.cpp b/src/flyable.cpp index 748e96017..8ec0bef04 100644 --- a/src/flyable.cpp +++ b/src/flyable.cpp @@ -76,7 +76,7 @@ void Flyable::createPhysics(float y_offset, const btVector3 velocity, trans.getBasis()[2][1]); float heading=atan2(-direction.getX(), direction.getY()); - TerrainInfo::update(trans.getOrigin()); + TerrainInfo::update(m_owner->getPos()); float pitch = getTerrainPitch(heading); btMatrix3x3 m; @@ -166,15 +166,15 @@ void Flyable::update (float dt) { if(m_exploded) return; - btTransform trans=getBody()->getWorldTransform(); - TerrainInfo::update(trans.getOrigin()); + Vec3 pos=getBody()->getWorldTransform().getOrigin(); + TerrainInfo::update(pos); if(getHoT()==Track::NOHIT) { explode(NULL); // flyable out of track boundary return; } - float hat = trans.getOrigin().getZ()-getHoT(); + float hat = pos.getZ()-getHoT(); // Use the Height Above Terrain to set the Z velocity. // HAT is clamped by min/max height. This might be somewhat diff --git a/src/gui/race_gui.cpp b/src/gui/race_gui.cpp index 101a17b7d..1a6fc4d3e 100644 --- a/src/gui/race_gui.cpp +++ b/src/gui/race_gui.cpp @@ -296,7 +296,7 @@ void RaceGUI::drawMap () Kart* kart = world->getKart(i); if(kart->isEliminated()) continue; // don't draw eliminated kart - glColor3fv ( *kart->getColor()); + glColor3fv ( kart->getColor().toFloat()); c = kart->getCoord () ; /* If it's a player, draw a bigger sign */ diff --git a/src/ide/vc8/supertuxkart.vcproj b/src/ide/vc8/supertuxkart.vcproj index 271e0b235..59b7e1074 100644 --- a/src/ide/vc8/supertuxkart.vcproj +++ b/src/ide/vc8/supertuxkart.vcproj @@ -682,6 +682,10 @@ RelativePath="../../../src\attachment.cpp" > + + @@ -898,10 +902,6 @@ RelativePath="../../../src\track_manager.cpp" > - - @@ -918,6 +918,10 @@ RelativePath="../../../src\user_config.cpp" > + + @@ -1304,6 +1308,10 @@ RelativePath="../../../src\player_kart.hpp" > + + @@ -1420,6 +1428,10 @@ RelativePath="..\..\user_pointer.hpp" > + + @@ -1635,10 +1647,6 @@ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" > - - diff --git a/src/kart.cpp b/src/kart.cpp index 5960f7e0f..957d152e4 100644 --- a/src/kart.cpp +++ b/src/kart.cpp @@ -360,7 +360,7 @@ void Kart::reset() m_rescue = false; placeModel(); - TerrainInfo::update(m_transform.getOrigin()); + TerrainInfo::update(getPos()); } // reset //----------------------------------------------------------------------------- @@ -592,7 +592,7 @@ void Kart::update(float dt) // dependent on the wheel size, suspension data etc.: when jumping, // the wheel suspension will be fully compressed, resulting in the // ray to start too low (under the track). - btVector3 pos_plus_epsilon = trans.getOrigin()+btVector3(0,0,0.2f); + Vec3 pos_plus_epsilon = trans.getOrigin()+btVector3(0,0,0.2f); //btVector3 pos_plus_epsilon (-56.6874237, -137.48851, -3.06826854); TerrainInfo::update(pos_plus_epsilon); diff --git a/src/kart.hpp b/src/kart.hpp index 4f9a25e1b..341cea46f 100644 --- a/src/kart.hpp +++ b/src/kart.hpp @@ -153,7 +153,7 @@ public: // Functions to access the current kart properties (which might get changed, // e.g. mass increase or air_friction increase depending on attachment etc.) // ------------------------------------------------------------------------- - const sgVec3* getColor () const {return m_kart_properties->getColor();} + const Vec3 &getColor () const {return m_kart_properties->getColor();} float getMass () const { return m_kart_properties->getMass() @@ -219,21 +219,6 @@ public: virtual void raceFinished (float time); }; -class TrafficDriver : public Kart -{ -public: - TrafficDriver (const std::string& kart_name, sgVec3 _pos, - sgCoord init_pos) - : Kart (kart_name, 0, init_pos ) - { - sgCopyVec3 ( m_reset_pos.xyz, _pos ) ; - reset () ; - } - virtual void doLapCounting () ; - virtual void doZipperProcessing () ; - virtual void update (float delta) ; -} ; - #endif diff --git a/src/kart_properties.cpp b/src/kart_properties.cpp index 58231c303..091260953 100644 --- a/src/kart_properties.cpp +++ b/src/kart_properties.cpp @@ -143,9 +143,7 @@ void KartProperties::getAllData(const lisp::Lisp* lisp) lisp->get("model-file", m_model_file); lisp->get("icon-file", m_icon_file); lisp->get("shadow-file", m_shadow_file); - lisp->get("red", m_color[0]); - lisp->get("green", m_color[1]); - lisp->get("blue", m_color[2]); + lisp->get("rgb", m_color); lisp->get("wheel-base", m_wheel_base); lisp->get("heightCOG", m_height_cog); @@ -206,7 +204,7 @@ void KartProperties::init_defaults() m_icon_file = "tuxicon.png"; m_shadow_file = "tuxkartshadow.png"; - m_color[0] = 1.0f; m_color[1] = 0.0f; m_color[2] = 0.0f; + m_color.setValue(1.0f, 0.0f, 0.0f); m_kart_width = 1.0f; m_kart_length = 1.5f; diff --git a/src/kart_properties.hpp b/src/kart_properties.hpp index 23e735573..8d18fe071 100644 --- a/src/kart_properties.hpp +++ b/src/kart_properties.hpp @@ -22,6 +22,7 @@ #include #include +#include "vec3.hpp" #include "lisp/lisp.hpp" #include "no_copy.hpp" @@ -45,7 +46,7 @@ protected: // the statusbar and the character select screen std::string m_shadow_file; // Filename of the image file that contains the // shadow for this kart - float m_color[3]; // Color the represents the kart in the status + Vec3 m_color; // Color the represents the kart in the status // bar and on the track-view // Physic properties @@ -121,7 +122,7 @@ public: const std::string& getIdent () const {return m_ident; } const std::string& getShadowFile () const {return m_shadow_file; } const std::string& getIconFile () const {return m_icon_file; } - const sgVec3* getColor () const {return &m_color; } + const Vec3 &getColor () const {return m_color; } float getMass () const {return m_mass; } float getKartLength () const {return m_kart_length; } float getKartWidth () const {return m_kart_width; } diff --git a/src/lisp/lisp.hpp b/src/lisp/lisp.hpp index 0a845feda..5889ae303 100644 --- a/src/lisp/lisp.hpp +++ b/src/lisp/lisp.hpp @@ -23,7 +23,7 @@ #include #include #include -#include "btBulletDynamicsCommon.h" +#include "vec3.hpp" namespace lisp { @@ -140,7 +140,7 @@ namespace lisp } return true; } - bool get(const char* name, btVector3& val) const + bool get(const char* name, Vec3& val) const { const Lisp* lisp = getLisp(name); if(!lisp) diff --git a/src/moveable.cpp b/src/moveable.cpp index 1fab2579b..ec99dc9e9 100644 --- a/src/moveable.cpp +++ b/src/moveable.cpp @@ -160,6 +160,9 @@ void Moveable::update (float dt) } // if m_history_position m_velocityLC = getVelocity()*getTrans().getBasis(); + const btMatrix3x3& basis=m_body->getWorldTransform().getBasis(); + m_hpr.setHPR(basis); + placeModel(); m_first_time = false ; } // update diff --git a/src/moveable.hpp b/src/moveable.hpp index 7ed96e969..999de17aa 100644 --- a/src/moveable.hpp +++ b/src/moveable.hpp @@ -22,6 +22,7 @@ #define HEADER_MOVEABLE_H #include +#include "vec3.hpp" #include "material.hpp" #include "btBulletDynamicsCommon.h" #include "user_pointer.hpp" @@ -53,7 +54,7 @@ protected: btRigidBody* m_body; btDefaultMotionState* m_motion_state; btTransform m_transform; - btVector3 m_hpr; + Vec3 m_hpr; public: Moveable (bool bHasHistory=false); @@ -64,8 +65,8 @@ public: const btVector3 &getVelocityLC() const {return m_velocityLC; } virtual void setVelocity(const btVector3& v) {m_body->setLinearVelocity(v); } sgCoord* getCoord () {return &m_curr_pos; } - const btVector3& getPos () const {return m_transform.getOrigin(); } - const btVector3& getRotation() const {return m_hpr; } + const Vec3& getPos () const {return (Vec3&)m_transform.getOrigin();} + const Vec3& getRotation() const {return m_hpr; } const sgCoord* getCoord () const {return &m_curr_pos; } const sgVec4* getNormalHOT () const {return m_normal_hot; } const sgCoord* getResetPos () const {return &m_reset_pos; } diff --git a/src/projectile_manager.cpp b/src/projectile_manager.cpp index 54e552aa5..6d6cc22a1 100644 --- a/src/projectile_manager.cpp +++ b/src/projectile_manager.cpp @@ -94,7 +94,7 @@ void ProjectileManager::update(float dt) while(p!=m_active_projectiles.end()) { if(! (*p)->hasHit()) { p++; continue; } - newExplosion((*p)->getCoord()); + newExplosion((const Vec3&)(*p)->getPos()); Flyable *f=*p; Projectiles::iterator pNext=m_active_projectiles.erase(p); // returns the next element delete f; @@ -141,7 +141,7 @@ Flyable *ProjectileManager::newProjectile(Kart *kart, CollectableType type) // ----------------------------------------------------------------------------- /** See if there is an old, unused explosion object available. If so, * reuse this object, otherwise create a new one. */ -Explosion* ProjectileManager::newExplosion(sgCoord* coord) +Explosion* ProjectileManager::newExplosion(const Vec3& coord) { Explosion *e = new Explosion(coord); m_active_explosions.push_back(e); diff --git a/src/projectile_manager.hpp b/src/projectile_manager.hpp index 4d013049f..91497b660 100644 --- a/src/projectile_manager.hpp +++ b/src/projectile_manager.hpp @@ -22,6 +22,7 @@ #include #include +#include "vec3.hpp" #include "flyable.hpp" #include "collectable_manager.hpp" @@ -60,7 +61,7 @@ public: void cleanup (); void update (float dt); Flyable* newProjectile (Kart *kart, CollectableType type); - Explosion* newExplosion (sgCoord *coord); + Explosion* newExplosion (const Vec3& coord); void Deactivate (Flyable *p) {} void removeTextures (); }; diff --git a/src/terrain_info.cpp b/src/terrain_info.cpp index 13ea1e3bf..ad5c120a8 100644 --- a/src/terrain_info.cpp +++ b/src/terrain_info.cpp @@ -23,7 +23,7 @@ #include "world.hpp" #include "constants.hpp" -TerrainInfo::TerrainInfo(const btVector3 &pos, int frequency) +TerrainInfo::TerrainInfo(const Vec3 &pos, int frequency) { m_HoT_frequency = frequency; m_HoT_counter = frequency; @@ -31,7 +31,7 @@ TerrainInfo::TerrainInfo(const btVector3 &pos, int frequency) update(pos); } //----------------------------------------------------------------------------- -void TerrainInfo::update(const btVector3& pos) +void TerrainInfo::update(const Vec3& pos) { m_HoT_counter++; if(m_HoT_counter>=m_HoT_frequency) diff --git a/src/terrain_info.hpp b/src/terrain_info.hpp index 53a0241d4..18177c6c5 100644 --- a/src/terrain_info.hpp +++ b/src/terrain_info.hpp @@ -20,7 +20,7 @@ #ifndef HEADER_TERRAIN_INFO_H #define HEADER_TERRAIN_INFO_H -#include "btBulletDynamicsCommon.h" +#include "vec3.hpp" #include "material.hpp" /** This class stores information about the triangle that's under an object, i.e.: @@ -31,19 +31,19 @@ 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 + Vec3 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(const btVector3 &pos, int frequency=1); + TerrainInfo(const Vec3 &pos, int frequency=1); virtual ~TerrainInfo() {}; - virtual void update(const btVector3 &pos); + virtual void update(const Vec3 &pos); float getHoT() const { return m_HoT; } - const Material* getMaterial() const { return m_material; } - const btVector3& getNormal() const { return m_normal; } + const Material *getMaterial() const { return m_material; } + const Vec3 &getNormal() const { return m_normal; } float getTerrainPitch(float heading) const; }; // TerrainInfo diff --git a/src/track.cpp b/src/track.cpp index 1fbb86e42..03e62914d 100644 --- a/src/track.cpp +++ b/src/track.cpp @@ -431,9 +431,9 @@ void Track::getStartCoords(unsigned int pos, sgCoord* coords) const { coords->hpr[1] = 0.0f; coords->hpr[2] = 0.0f; - btVector3 tmp_pos(coords->xyz[0],coords->xyz[1],coords->xyz[2]); + Vec3 tmp_pos(coords->xyz); - btVector3 normal; + Vec3 normal; const Material *material=NULL; getTerrainInfo(tmp_pos, &(coords->xyz[2]), &normal, &material); @@ -1358,7 +1358,7 @@ void Track::herring_command (sgVec3 *xyz, char htype, int bNeedHeight ) } // herring_command // ---------------------------------------------------------------------------- -void Track::getTerrainInfo(const btVector3 &pos, float *hot, btVector3* normal, +void Track::getTerrainInfo(const Vec3 &pos, float *hot, Vec3 *normal, const Material **material) const { btVector3 to_pos(pos); diff --git a/src/track.hpp b/src/track.hpp index f23cf1d7a..ca43153ec 100644 --- a/src/track.hpp +++ b/src/track.hpp @@ -34,6 +34,7 @@ #include #include #include "btBulletDynamicsCommon.h" +#include "vec3.hpp" #include "material.hpp" #include "triangle_mesh.hpp" #include "music_information.hpp" @@ -60,8 +61,8 @@ private: float m_AI_angle_adjustment; float m_AI_curve_speed_adjustment; bool m_has_final_camera; - btVector3 m_camera_final_position; - btVector3 m_camera_final_hpr; + Vec3 m_camera_final_position; + Vec3 m_camera_final_hpr; public: enum RoadSide{ RS_DONT_KNOW = -1, RS_LEFT = 0, RS_RIGHT = 1 }; @@ -196,10 +197,10 @@ public: const std::vector& getWidth () const {return m_path_width; } const std::string& getHerringStyle () const {return m_herring_style; } bool hasFinalCamera () const {return m_has_final_camera; } - const btVector3& getCameraPosition () const {return m_camera_final_position;} - const btVector3& getCameraHPR () const {return m_camera_final_hpr; } + const Vec3& getCameraPosition () const {return m_camera_final_position;} + const Vec3& getCameraHPR () const {return m_camera_final_hpr; } void getStartCoords (unsigned int pos, sgCoord* coords) const; - void getTerrainInfo(const btVector3 &pos, float *hot, btVector3* normal, + void getTerrainInfo(const Vec3 &pos, float *hot, Vec3* normal, const Material **material) const; void createPhysicsModel (); void glVtx (sgVec2 v, float x_offset, float y_offset) const diff --git a/src/vec3.cpp b/src/vec3.cpp new file mode 100755 index 000000000..7a9ddb27d --- /dev/null +++ b/src/vec3.cpp @@ -0,0 +1,79 @@ +// $Id: vec3.cpp 1954 2008-05-20 10:01:26Z scifly $ +// +// SuperTuxKart - a fun racing game with go-kart +// Copyright (C) 2008 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 +// MERCHANTABILITY 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. + +#include "vec3.hpp" + +void Vec3::setHPR(const btMatrix3x3& m) +{ + float f[4][4]; + m.getOpenGLSubMatrix((float*)f); + +// sgSetCoord(m_curr_pos, f); +//void sgSetCoord ( sgCoord *dst, const sgMat4 src ) + + float s = m.getColumn(0).length(); + + if ( s <= 0.00001 ) + { + fprintf(stderr,"setHPR: bad matrix\n"); + setValue(0,0,0); + return ; + } + s=1/s; + +#define CLAMPTO1(x) x<-1 ? -1 : (x>1 ? 1 : x) + + setY(asin(CLAMPTO1(m.getRow(2).getY()))); + + SGfloat cp = cos(getY()); + + /* If pointing nearly vertically up - then heading is ill-defined */ + + + if ( cp > -0.00001 && cp < 0.00001 ) + { + float cr = CLAMPTO1( m.getRow(1).getX()*s); + float sr = CLAMPTO1(-m.getRow(1).getZ()*s); + + setX(0.0f); + setZ(atan2(sr, cr )); + } + else + { + cp = s / cp ; // includes the scaling factor + float sr = CLAMPTO1( -m.getRow(2).getX() * cp ); + float cr = CLAMPTO1( m.getRow(2).getZ() * cp ); + float sh = CLAMPTO1( -m.getRow(0).getY() * cp ); + float ch = CLAMPTO1( m.getRow(1).getY() * cp ); + + if ( (sh == 0.0f && ch == 0.0f) || (sr == 0.0f && cr == 0.0f) ) + { + cr = CLAMPTO1( m.getRow(1).getX()*s); + sr = CLAMPTO1(-m.getRow(1).getZ()*s) ; + + setX(0.0f); + } + else + setX(atan2(sh, ch )); + + setZ(atan2(sr, cr )); + } +} // setHPR + +// ---------------------------------------------------------------------------- diff --git a/src/vec3.hpp b/src/vec3.hpp new file mode 100755 index 000000000..9283342a5 --- /dev/null +++ b/src/vec3.hpp @@ -0,0 +1,42 @@ +// $Id: vec3.hpp 1954 2008-05-20 10:01:26Z scifly $ +// +// SuperTuxKart - a fun racing game with go-kart +// Copyright (C) 2008 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 +// MERCHANTABILITY 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_VEC3_H +#define HEADER_VEC3_H + +#include + +#include "LinearMath/btVector3.h" +#include "LinearMath/btMatrix3x3.h" +class Vec3 : public btVector3 +{ +private: + inline float clampToUnity(float f) {return f<-1?f:(f>1?1:f);} +public: + inline Vec3(sgVec3 a) : btVector3(a[0], a[1], a[2]) {} + inline Vec3(const btVector3& a) : btVector3(a) {} + inline Vec3() : btVector3() {} + void setHPR(const btMatrix3x3& m); + inline const float operator[](int n) const {return *(&m_x+n); } + float* toFloat() const {return (float*)this; } + Vec3& operator=(const btVector3& a) {*(btVector3*)this=a; return *this;} + Vec3& operator=(const btMatrix3x3& m) {setHPR(m); return *this;} +}; // Vec3 +#endif diff --git a/src/world.cpp b/src/world.cpp index d3c1a4930..f10eaccfb 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -623,7 +623,7 @@ void World::removeKart(int kart_number) camera->setMode(Camera::CM_LEADER_MODE); m_eliminated_players++; } - projectile_manager->newExplosion(kart->getCoord()); + projectile_manager->newExplosion(kart->getPos()); // The kart can't be really removed from the m_kart array, since otherwise // a race can't be restarted. So it's only marked to be eliminated (and // ignored in all loops). Important:world->getCurrentNumKarts() returns