From 01a9f73b54c602f4d76587009e0d512b5d4ff8d5 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Thu, 12 Mar 2009 00:57:00 +0000 Subject: [PATCH] Started adding powerup functionality to irrlicht port. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@3223 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- data/bowling.projectile | 1 + data/cake.projectile | 1 + data/plunger.projectile | 1 + data/zipper.collectable | 1 + src/gui/race_gui.cpp | 12 +++++--- src/gui/race_gui.hpp | 3 +- src/items/attachment_manager.cpp | 8 +++++ src/items/attachment_manager.hpp | 4 +-- src/items/bowling.cpp | 4 +++ src/items/bowling.hpp | 13 ++++++-- src/items/cake.cpp | 4 +++ src/items/cake.hpp | 13 ++++++-- src/items/flyable.cpp | 13 ++++++++ src/items/flyable.hpp | 16 ++++++++++ src/items/plunger.cpp | 4 +++ src/items/plunger.hpp | 12 ++++++-- src/items/powerup_manager.cpp | 52 +++++++++++++++++++++++++++++--- src/items/powerup_manager.hpp | 49 +++++++++++++++++++----------- src/karts/moveable.cpp | 4 +-- src/karts/moveable.hpp | 7 +++-- src/physics/moving_physics.cpp | 1 + 21 files changed, 183 insertions(+), 40 deletions(-) diff --git a/data/bowling.projectile b/data/bowling.projectile index 9507a4f48..f3dba811f 100644 --- a/data/bowling.projectile +++ b/data/bowling.projectile @@ -3,6 +3,7 @@ (tuxkart-collectable (name "Bowling") (model "bowling.ac") + (mesh "bowling.b3d") (icon "bowling-icon.rgb") (speed 4.0) (min-height 0.2) ; height above terrain below which a ball is diff --git a/data/cake.projectile b/data/cake.projectile index 589aead73..0b99e552b 100644 --- a/data/cake.projectile +++ b/data/cake.projectile @@ -3,6 +3,7 @@ (tuxkart-collectable (name "cake") (model "cake.ac") + (mesh "cake.b3d") (icon "cake-icon.rgb") (speed 50.0) (min-height 0.2) diff --git a/data/plunger.projectile b/data/plunger.projectile index 2fef96c1b..f8b26f4df 100644 --- a/data/plunger.projectile +++ b/data/plunger.projectile @@ -3,6 +3,7 @@ (tuxkart-collectable (name "Plunger") (model "plunger.ac") + (mesh "plunger.b3d") (icon "plunger-icon.rgb") (speed 35.0) (min-height 0.2) ; height above terrain below which a plunger is diff --git a/data/zipper.collectable b/data/zipper.collectable index 988c9bf82..a344f2c3e 100644 --- a/data/zipper.collectable +++ b/data/zipper.collectable @@ -3,6 +3,7 @@ (tuxkart-collectable (name "zipper") (model "zipper.ac") + (mesh "zipper.b3d") (icon "zipper_collect.rgb") ) diff --git a/src/gui/race_gui.cpp b/src/gui/race_gui.cpp index 7cae3c990..5b4280273 100644 --- a/src/gui/race_gui.cpp +++ b/src/gui/race_gui.cpp @@ -64,17 +64,19 @@ RaceGUI::RaceGUI() icon_width = 27; icon_player_width = 35; } -#ifdef NOT_READY_YET + m_icons = new gui::IGUIImage*[race_manager->getNumKarts()]; for(unsigned int i=0; igetNumKarts(); i++) { core::position2d p(0, i*20); Kart *kart = race_manager->getKart(i); Material *m = kart->getKartProperties()->getIconMaterial(); - m = material_manager->getMaterial("track.png"); + // FIXME: The icons needs to be resized. m_icons[i] = irr_driver->getGUI()->addImage(m->getTexture(), p); } -#endif + core::rect p(user_config->m_width-10, 0, + user_config->m_width+10, 10); + m_attachment_icon = irr_driver->getGUI()->addImage(p); #else m_speed_back_icon = material_manager->getMaterial("speedback.rgb"); m_speed_back_icon->getState()->disable(GL_CULL_FACE); @@ -391,7 +393,9 @@ void RaceGUI::drawPowerupIcons ( Kart* player_kart, int offset_x, int y1 = (int)(user_config->m_height*5/6 * ratio_y) + offset_y; int nSize=(int)(64.0f*std::min(ratio_x, ratio_y)); -#ifndef HAVE_IRRLICHT +#ifdef HAVE_IRRLICHT + m_attachment_icon->setImage(powerup->getIcon()->getTexture()); +#else powerup->getIcon()->apply(); int n = player_kart->getNumPowerup() ; diff --git a/src/gui/race_gui.hpp b/src/gui/race_gui.hpp index 076fe996d..34052e087 100644 --- a/src/gui/race_gui.hpp +++ b/src/gui/race_gui.hpp @@ -93,7 +93,8 @@ private: private: #ifdef HAVE_IRRLICHT gui::IGUIStaticText *m_time; - gui::IGUIImage **m_icons; + gui::IGUIImage **m_icons; + gui::IGUIImage *m_attachment_icon; #endif ulClock m_fps_timer; int m_fps_counter; diff --git a/src/items/attachment_manager.cpp b/src/items/attachment_manager.cpp index d807b1120..9bcd17de7 100644 --- a/src/items/attachment_manager.cpp +++ b/src/items/attachment_manager.cpp @@ -44,11 +44,19 @@ struct initAttachmentType {attachmentType attachment; const char *file;}; initAttachmentType iat[]= { +#ifdef HAVE_IRRLICHT + {ATTACH_PARACHUTE, "parachute.b3d"}, + {ATTACH_BOMB, "bomb.b3d"}, + {ATTACH_ANVIL, "anvil.b3d"}, + {ATTACH_TINYTUX, "tinytux_magnet.b3d"}, + {ATTACH_MAX, ""}, +#else {ATTACH_PARACHUTE, "parachute.ac"}, {ATTACH_BOMB, "bomb.ac"}, {ATTACH_ANVIL, "anvil.ac"}, {ATTACH_TINYTUX, "tinytux_magnet.ac"}, {ATTACH_MAX, ""}, +#endif }; //----------------------------------------------------------------------------- diff --git a/src/items/attachment_manager.hpp b/src/items/attachment_manager.hpp index 397bd11ed..57889bacb 100644 --- a/src/items/attachment_manager.hpp +++ b/src/items/attachment_manager.hpp @@ -16,8 +16,8 @@ // 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_ATTACHMENT_MANAGER_H -#define HEADER_ATTACHMENT_MANAGER_H +#ifndef HEADER_ATTACHMENT_MANAGER_HPP +#define HEADER_ATTACHMENT_MANAGER_HPP #include #include "items/attachment.hpp" diff --git a/src/items/bowling.cpp b/src/items/bowling.cpp index 034aa0ed8..06f212ef7 100644 --- a/src/items/bowling.cpp +++ b/src/items/bowling.cpp @@ -70,7 +70,11 @@ Bowling::Bowling(Kart *kart) : Flyable(kart, POWERUP_BOWLING, 50.0f /* mass */) } // Bowling // ----------------------------------------------------------------------------- +#ifdef HAVE_IRRLICHT +void Bowling::init(const lisp::Lisp* lisp, scene::IMesh *bowling) +#else void Bowling::init(const lisp::Lisp* lisp, ssgEntity *bowling) +#endif { Flyable::init(lisp, bowling, POWERUP_BOWLING); m_st_max_distance = 20.0f; diff --git a/src/items/bowling.hpp b/src/items/bowling.hpp index b27475af4..58c09b925 100644 --- a/src/items/bowling.hpp +++ b/src/items/bowling.hpp @@ -17,8 +17,13 @@ // 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_BOWLING_H -#define HEADER_BOWLING_H +#ifndef HEADER_BOWLING_HPP +#define HEADER_BOWLING_HPP + +#ifdef HAVE_IRRLICHT +#include "irrlicht.h" +using namespace irr; +#endif #include "flyable.hpp" @@ -31,7 +36,11 @@ private: public: Bowling(Kart* kart); +#ifdef HAVE_IRRLICHT + static void init(const lisp::Lisp* lisp, scene::IMesh *bowling); +#else static void init(const lisp::Lisp* lisp, ssgEntity* bowling); +#endif virtual void update(float dt); int getExplosionSound() const { return SFXManager::SOUND_BOWLING_STRIKE; } diff --git a/src/items/cake.cpp b/src/items/cake.cpp index f7884670c..76dcf92e7 100644 --- a/src/items/cake.cpp +++ b/src/items/cake.cpp @@ -107,7 +107,11 @@ Cake::Cake (Kart *kart) : Flyable(kart, POWERUP_CAKE) } // Cake // ----------------------------------------------------------------------------- +#ifdef HAVE_IRRLICHT +void Cake::init(const lisp::Lisp* lisp, scene::IMesh *cake_model) +#else void Cake::init(const lisp::Lisp* lisp, ssgEntity *cake_model) +#endif { Flyable::init(lisp, cake_model, POWERUP_CAKE); m_st_max_distance = 80.0f; diff --git a/src/items/cake.hpp b/src/items/cake.hpp index bf64c491c..720665696 100644 --- a/src/items/cake.hpp +++ b/src/items/cake.hpp @@ -17,8 +17,13 @@ // 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_CAKE_H -#define HEADER_CAKE_H +#ifndef HEADER_CAKE_HPP +#define HEADER_CAKE_HPP + +#ifdef HAVE_IRRLICHT +#include "irrlicht.h" +using namespace irr; +#endif #include "flyable.hpp" @@ -35,7 +40,11 @@ private: // projectile (NULL if none) public: Cake (Kart *kart); +#ifdef HAVE_IRRLICHT + static void init (const lisp::Lisp* lisp, scene::IMesh *cake_model); +#else static void init (const lisp::Lisp* lisp, ssgEntity* cake_model); +#endif virtual void update (float dt); virtual void hitTrack () { hit(NULL); } // Kinematic objects are not allowed to have a velocity (assertion in diff --git a/src/items/flyable.cpp b/src/items/flyable.cpp index a2b947c5b..d68131015 100644 --- a/src/items/flyable.cpp +++ b/src/items/flyable.cpp @@ -23,6 +23,8 @@ #include "callback_manager.hpp" #include "race_manager.hpp" +#include "graphics/irr_driver.hpp" +#include "graphics/mesh_tools.hpp" #include "graphics/scene.hpp" #include "items/projectile_manager.hpp" #include "karts/kart.hpp" @@ -35,7 +37,11 @@ // static variables: float Flyable::m_st_speed[POWERUP_MAX]; +#ifdef HAVE_IRRLICHT +scene::IMesh* Flyable::m_st_model[POWERUP_MAX]; +#else ssgEntity* Flyable::m_st_model[POWERUP_MAX]; +#endif float Flyable::m_st_min_height[POWERUP_MAX]; float Flyable::m_st_max_height[POWERUP_MAX]; float Flyable::m_st_force_updown[POWERUP_MAX]; @@ -65,6 +71,7 @@ Flyable::Flyable(Kart *kart, PowerupType type, float mass) : Moveable() // Add the graphical model #ifdef HAVE_IRRLICHT + setRoot(irr_driver->addMesh(m_st_model[type])); #else ssgTransform *m = getModelTransform(); m->addKid(m_st_model[type]); @@ -117,8 +124,13 @@ void Flyable::createPhysics(float y_offset, const btVector3 &velocity, } // createPhysics // ----------------------------------------------------------------------------- +#ifdef HAVE_IRRLICHT +void Flyable::init(const lisp::Lisp* lisp, scene::IMesh *model, + PowerupType type) +#else void Flyable::init(const lisp::Lisp* lisp, ssgEntity *model, PowerupType type) +#endif { m_st_speed[type] = 25.0f; m_st_max_height[type] = 1.0f; @@ -132,6 +144,7 @@ void Flyable::init(const lisp::Lisp* lisp, ssgEntity *model, // Store the size of the model Vec3 min, max; #ifdef HAVE_IRRLICHT + MeshTools::minMax3D(model, &min, &max); #else SSGHelp::MinMax(model, &min, &max); #endif diff --git a/src/items/flyable.hpp b/src/items/flyable.hpp index 55de09687..936255895 100644 --- a/src/items/flyable.hpp +++ b/src/items/flyable.hpp @@ -20,6 +20,10 @@ #ifndef HEADER_FLYABLE_HPP #define HEADER_FLYABLE_HPP +#ifdef HAVE_IRRLICHT +#include "irrlicht.h" +using namespace irr; +#endif #include "audio/sfx_manager.hpp" #include "items/powerup_manager.hpp" #include "karts/moveable.hpp" @@ -28,6 +32,9 @@ class FlyableInfo; class Kart; class MovingPhysics; +#ifndef HAVE_IRRLICHT +class ssgEntity; +#endif class Flyable : public Moveable, public TerrainInfo { @@ -58,7 +65,11 @@ protected: // so we need arrays of these variables to have different values // for bowling balls, missiles, ... static float m_st_speed[POWERUP_MAX]; // Speed of the projectile +#ifdef HAVE_IRRLICHT + static scene::IMesh *m_st_model[POWERUP_MAX]; // 3d model +#else static ssgEntity* m_st_model[POWERUP_MAX]; // 3d model +#endif static float m_st_min_height[POWERUP_MAX]; // min height above track static float m_st_max_height[POWERUP_MAX]; // max height above track static float m_st_force_updown[POWERUP_MAX]; // force pushing up/down @@ -98,8 +109,13 @@ public: * terrain. Missiles can 'follow the terrain' with this adjustment, * but gravity will basically be disabled. */ void setAdjustZVelocity(bool f) { m_adjust_z_velocity = f; } +#ifdef HAVE_IRRLICHT + static void init (const lisp::Lisp* lisp, scene::IMesh *model, + PowerupType type); +#else static void init (const lisp::Lisp* lisp, ssgEntity *model, PowerupType type); +#endif virtual void update (float); void updateFromServer(const FlyableInfo &f, float dt); diff --git a/src/items/plunger.cpp b/src/items/plunger.cpp index bdf4a5a4a..ac816b900 100644 --- a/src/items/plunger.cpp +++ b/src/items/plunger.cpp @@ -106,7 +106,11 @@ Plunger::~Plunger() } // ~Plunger // ----------------------------------------------------------------------------- +#ifdef HAVE_IRRLICHT +void Plunger::init(const lisp::Lisp* lisp, scene::IMesh *plunger_model) +#else void Plunger::init(const lisp::Lisp* lisp, ssgEntity *plunger_model) +#endif { Flyable::init(lisp, plunger_model, POWERUP_PLUNGER); } // init diff --git a/src/items/plunger.hpp b/src/items/plunger.hpp index 6fe885469..d06600ace 100644 --- a/src/items/plunger.hpp +++ b/src/items/plunger.hpp @@ -17,9 +17,13 @@ // 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_MISSILE_H -#define HEADER_MISSILE_H +#ifndef HEADER_MISSILE_HPP +#define HEADER_MISSILE_HPP +#ifdef HAVE_IRRLICHT +#include "irrlicht.h" +using namespace irr; +#endif #include "flyable.hpp" class RubberBand; @@ -38,7 +42,11 @@ private: public: Plunger(Kart *kart); ~Plunger(); +#ifdef HAVE_IRRLICHT + static void init(const lisp::Lisp* lisp, scene::IMesh* missile); +#else static void init (const lisp::Lisp* lisp, ssgEntity* missile); +#endif /** Sets the keep-alive value. Setting it to 0 will remove the plunger * at the next update - which is used if the rubber band snaps. */ diff --git a/src/items/powerup_manager.cpp b/src/items/powerup_manager.cpp index 12a1e93da..6177957a8 100644 --- a/src/items/powerup_manager.cpp +++ b/src/items/powerup_manager.cpp @@ -26,6 +26,7 @@ #include "file_manager.hpp" #include "material_manager.hpp" #include "material.hpp" +#include "graphics/irr_driver.hpp" #include "items/bowling.hpp" #include "items/cake.hpp" #include "items/plunger.hpp" @@ -41,6 +42,16 @@ initPowerupType; initPowerupType ict[]= { +#ifdef HAVE_IRRLICHT + {POWERUP_ZIPPER, "zipper.collectable" }, + {POWERUP_BOWLING, "bowling.projectile" }, + {POWERUP_BUBBLEGUM, "bubblegum.xml" }, + {POWERUP_CAKE, "cake.projectile" }, + {POWERUP_ANVIL, "anvil.collectable" }, + {POWERUP_PARACHUTE, "parachute.collectable" }, + {POWERUP_PLUNGER, "plunger.projectile" }, + {POWERUP_MAX, "" }, +#else {POWERUP_ZIPPER, "zipper.collectable" }, {POWERUP_BOWLING, "bowling.projectile" }, {POWERUP_BUBBLEGUM, "bubblegum.projectile" }, @@ -49,6 +60,7 @@ initPowerupType ict[]= {POWERUP_PARACHUTE, "parachute.collectable" }, {POWERUP_PLUNGER, "plunger.projectile" }, {POWERUP_MAX, "" }, +#endif }; PowerupManager* powerup_manager=0; @@ -58,7 +70,11 @@ PowerupManager::PowerupManager() { for(int i=0; iget("name", sName ); - lisp->get("model", sModel ); - lisp->get("icon", sIconFile ); - #ifdef HAVE_IRRLICHT + lisp->get("mesh", sModel ); #else + lisp->get("model", sModel ); +#endif + lisp->get("icon", sIconFile ); // load material m_all_icons[collectType] = material_manager->getMaterial(sIconFile, /* full_path */ false, - /*make_permanent */ true); + /*make_permanent */ true); +#ifdef HAVE_IRRLICHT + if(sModel!="") + { + // FIXME LEAK: not freed (unimportant, since the models have to exist + // for the whole game anyway). + std::string full_path = file_manager->getModelFile(sModel); + m_all_meshes[collectType] = irr_driver->getMesh(full_path); + } + else + { + m_all_meshes[collectType] = 0; + m_all_extends[collectType] = btVector3(0.0f,0.0f,0.0f); + } +#else m_all_icons[collectType]->getState()->ref(); if(sModel!="") @@ -142,6 +173,17 @@ void PowerupManager::LoadNode(const lisp::Lisp* lisp, int collectType ) #endif // Load special attributes for certain powerups +#ifdef HAVE_IRRLICHT + switch (collectType) { + case POWERUP_BOWLING: + Bowling::init(lisp, m_all_meshes[collectType]); break; + case POWERUP_PLUNGER: + Plunger::init(lisp, m_all_meshes[collectType]); break; + case POWERUP_CAKE: + Cake::init(lisp, m_all_meshes[collectType]); break; + default:; + } // switch +#else switch (collectType) { case POWERUP_BOWLING: Bowling::init (lisp, m_all_models[collectType]); break; @@ -151,6 +193,6 @@ void PowerupManager::LoadNode(const lisp::Lisp* lisp, int collectType ) Cake::init (lisp, m_all_models[collectType]); break; default:; } // switch - +#endif } // LoadNode diff --git a/src/items/powerup_manager.hpp b/src/items/powerup_manager.hpp index 9d8252713..8a5fffe11 100644 --- a/src/items/powerup_manager.hpp +++ b/src/items/powerup_manager.hpp @@ -17,15 +17,20 @@ // 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_POWERUPMANAGER_H -#define HEADER_POWERUPMANAGER_H +#ifndef HEADER_POWERUPMANAGER_HPP +#define HEADER_POWERUPMANAGER_HPP +#ifdef HAVE_IRRLICHT +#include "irrlicht.h" +#endif #include "lisp/parser.hpp" #include "lisp/lisp.hpp" #include "btBulletDynamicsCommon.h" class Material; +#ifndef HAVE_IRRLICHT class ssgEntity; +#endif // The anvil and parachute must be at the end of the enum, and the // zipper just before them (see Powerup::hitBonusBox). @@ -38,24 +43,34 @@ enum PowerupType {POWERUP_NOTHING, class PowerupManager { protected: - Material* m_all_icons [POWERUP_MAX]; - float m_all_max_distance[POWERUP_MAX]; // if a target is closer than this - float m_all_force_to_target[POWERUP_MAX]; // apply this force to move towards + Material* m_all_icons [POWERUP_MAX]; + float m_all_max_distance[POWERUP_MAX]; // if a target is closer than this + float m_all_force_to_target[POWERUP_MAX]; // apply this force to move towards // the target - float m_all_max_turn_angle[POWERUP_MAX]; // maximum turn angle for homing - ssgEntity* m_all_models[POWERUP_MAX]; - btVector3 m_all_extends[POWERUP_MAX]; - void LoadNode (const lisp::Lisp* lisp, int collectType); + float m_all_max_turn_angle[POWERUP_MAX]; // maximum turn angle for homing +#ifdef HAVE_IRRLICHT + scene::IMesh *m_all_meshes[POWERUP_MAX]; +#else + ssgEntity* m_all_models[POWERUP_MAX]; +#endif + btVector3 m_all_extends[POWERUP_MAX]; + void LoadNode (const lisp::Lisp* lisp, int collectType); public: PowerupManager (); - void loadPowerups(); - void removeTextures (); - void Load (int collectType, const char* filename); - Material* getIcon (int type) const {return m_all_icons [type]; } - ssgEntity* getModel (int type) const {return m_all_models[type]; } - float getForceToTarget(int type) const {return m_all_force_to_target[type]; } - float getMaxDistance (int type) const {return m_all_max_distance[type];} - float getMaxTurnAngle (int type) const {return m_all_max_turn_angle[type];} + void loadPowerups(); + void removeTextures (); + void Load (int collectType, const char* filename); + Material* getIcon (int type) const {return m_all_icons [type]; } +#ifdef HAVE_IRRLICHT + /** Returns the mesh for a certain powerup. + * \param type Mesh type for which the model is returned. */ + scene::IMesh *getMesh (int type) const {return m_all_meshes[type]; } +#else + ssgEntity* getModel (int type) const {return m_all_models[type]; } +#endif + float getForceToTarget(int type) const {return m_all_force_to_target[type]; } + float getMaxDistance (int type) const {return m_all_max_distance[type];} + float getMaxTurnAngle (int type) const {return m_all_max_turn_angle[type];} const btVector3& getExtend (int type) const {return m_all_extends[type]; } }; diff --git a/src/karts/moveable.cpp b/src/karts/moveable.cpp index 60748306e..344212155 100644 --- a/src/karts/moveable.cpp +++ b/src/karts/moveable.cpp @@ -31,9 +31,9 @@ Moveable::Moveable() { m_body = 0; m_motion_state = 0; - m_first_time = true ; + m_first_time = true; #ifdef HAVE_IRRLICHT - m_mesh = 0; + m_mesh = 0; #else m_model_transform = new ssgTransform(); m_model_transform->ref(); diff --git a/src/karts/moveable.hpp b/src/karts/moveable.hpp index d1b3e09ff..5e559091f 100644 --- a/src/karts/moveable.hpp +++ b/src/karts/moveable.hpp @@ -66,10 +66,11 @@ public: Moveable(); virtual ~Moveable(); #ifdef HAVE_IRRLICHT - scene::ISceneNode - *getRoot() {return m_root; } + scene::ISceneNode + *getRoot() {return m_root; } + void setRoot(scene::ISceneNode *n){m_root = n; } #else - ssgTransform *getModelTransform() {return m_model_transform; } + ssgTransform *getModelTransform() {return m_model_transform; } #endif virtual const btVector3 &getVelocity() const {return m_body->getLinearVelocity();} diff --git a/src/physics/moving_physics.cpp b/src/physics/moving_physics.cpp index 7c4c89af0..9715d0032 100644 --- a/src/physics/moving_physics.cpp +++ b/src/physics/moving_physics.cpp @@ -59,6 +59,7 @@ MovingPhysics::MovingPhysics(const XMLNode *xml_node) { fprintf(stderr, "Warning: '%s' in '%s' not found and is ignored.\n", xml_node->getName().c_str(), model_name.c_str()); + return; } // if(!obj) } m_mesh = obj->getMesh(0);