diff --git a/src/animations/ipo.cpp b/src/animations/ipo.cpp index f70acd9e2..7ea6bf6da 100644 --- a/src/animations/ipo.cpp +++ b/src/animations/ipo.cpp @@ -22,8 +22,7 @@ #include "io/xml_node.hpp" const std::string Ipo::m_all_channel_names[IPO_MAX] = - {std::string("LocX"), std::string("LocY"), std::string("LocZ"), - std::string("RotX"), "RotY", "RotZ"}; + {"LocX", "LocY", "LocZ", "RotX", "RotY", "RotZ"}; Ipo::Ipo(const XMLNode &curve, float fps) { @@ -114,12 +113,12 @@ void Ipo::update(float dt, core::vector3df *xyz, core::vector3df *hpr) switch(m_channel) { - case Ipo::IPO_LOCX : xyz->X = get(); break; - case Ipo::IPO_LOCY : xyz->Y = get(); break; - case Ipo::IPO_LOCZ : xyz->Z = get(); break; - case Ipo::IPO_ROTX : hpr->X = get(); break; - case Ipo::IPO_ROTY : hpr->Y = get(); break; - case Ipo::IPO_ROTZ : hpr->Z = get(); break; + case Ipo::IPO_LOCX : xyz->X = get(); break; + case Ipo::IPO_LOCY : xyz->Y = get(); break; + case Ipo::IPO_LOCZ : xyz->Z = get(); break; + case Ipo::IPO_ROTX : hpr->X = -get(); break; // the - signs are odd, + case Ipo::IPO_ROTY : hpr->Y = -get(); break; // but it works + case Ipo::IPO_ROTZ : hpr->Z = get(); break; // why no - ?? default: assert(false); // shut up compiler warning } // switch diff --git a/src/animations/three_d_animation.cpp b/src/animations/three_d_animation.cpp index 24d7c318a..4cc07092f 100644 --- a/src/animations/three_d_animation.cpp +++ b/src/animations/three_d_animation.cpp @@ -82,10 +82,23 @@ void ThreeDAnimation::createPhysicsBody(const std::string &shape) { m_collision_shape = new btBoxShape(0.5*extend); } - else if(shape=="cone") + else if(shape=="coneX") { + float radius = 0.5f*std::max(extend.getY(), extend.getZ()); + m_collision_shape = new btConeShapeX(radius, extend.getX()); + } + else if(shape=="coneY") + { + float radius = 0.5f*std::max(extend.getX(), extend.getZ()); + m_collision_shape = new btConeShape(radius, extend.getY()); + } + else if(shape=="coneZ") + { + // Note that the b3d model and therefore the extend has the + // irrlicht axis, i.e. Y and Z swapped. Also we need to + // convert float radius = 0.5f*std::max(extend.getX(), extend.getY()); - m_collision_shape = new btConeShapeZ(radius, extend.getZ()); + m_collision_shape = new btConeShapeZ(radius, extend.getZ()); } else { @@ -131,7 +144,7 @@ void ThreeDAnimation::update(float dt) if(m_body) { hpr = DEGREE_TO_RAD*hpr; - btQuaternion q(hpr.X, hpr.Z, -hpr.Y); + btQuaternion q(-hpr.Z, -hpr.X, -hpr.Y); Vec3 p(xyz); btTransform trans(q,p); m_motion_state->setWorldTransform(trans); diff --git a/src/input/input_manager.cpp b/src/input/input_manager.cpp index 74c533b08..4ed7c8422 100644 --- a/src/input/input_manager.cpp +++ b/src/input/input_manager.cpp @@ -100,7 +100,6 @@ InputManager::~InputManager() void InputManager::handleStaticAction(int key, int value) { static bool control_is_pressed=false; - printf("%d %d %d\n",key,value,control_is_pressed); switch (key) { #ifdef DEBUG diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp index 712baeae0..b12765348 100644 --- a/src/tracks/track.cpp +++ b/src/tracks/track.cpp @@ -529,14 +529,14 @@ void Track::createWater(const XMLNode &node) //scene::IMesh *mesh = irr_driver->getMesh(full_path); scene::IAnimatedMesh *mesh = irr_driver->getSceneManager()->getMesh(full_path.c_str()); - irr_driver->getSceneManager()->addWaterSurfaceSceneNode(mesh->getMesh(0)); -// scene::IAnimatedMesh *mesh = irr_driver->getSceneManager()->addHillPlaneMesh("myHill", -// core::dimension2d(20,20), -// core::dimension2d(40,40), 0, 0, -// core::dimension2d(0,0), -// core::dimension2d(10,10)); + //irr_driver->getSceneManager()->addWaterSurfaceSceneNode(mesh->getMesh(0)); + //scene::IAnimatedMesh *mesh = irr_driver->getSceneManager()->addHillPlaneMesh("myHill", + // core::dimension2d(20,20), + // core::dimension2d(40,40), 0, 0, + // core::dimension2d(0,0), + // core::dimension2d(10,10)); - scene::SMeshBuffer b(*(scene::SMeshBuffer*)(mesh->getMesh(0)->getMeshBuffer(0))); + //scene::SMeshBuffer b(*(scene::SMeshBuffer*)(mesh->getMesh(0)->getMeshBuffer(0))); //scene::SMeshBuffer* buffer = new scene::SMeshBuffer(*(scene::SMeshBuffer*)(mesh->getMeshBuffer(0))); float wave_height = 2.0f;