From d01724ffc35b1ea3789bd6c88e6109ae5bff9177 Mon Sep 17 00:00:00 2001 From: auria Date: Tue, 16 Aug 2011 01:23:15 +0000 Subject: [PATCH] Attempt at displaying wheelie effect when using zipper (this was discussed on IRC). Commented out atm since the angle stuff is behaving all weird git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9514 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/ide/Xcode/Config.xcconfig | 2 +- src/karts/kart.cpp | 26 ++++++++++++++++++++++++++ src/karts/kart_model.hpp | 3 +++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/ide/Xcode/Config.xcconfig b/src/ide/Xcode/Config.xcconfig index 1addc65e4..c00dc81e1 100644 --- a/src/ide/Xcode/Config.xcconfig +++ b/src/ide/Xcode/Config.xcconfig @@ -5,4 +5,4 @@ HEADER_SEARCH_PATHS = /Library/Frameworks/IrrFramework.framework/Versions/A/Head OTHER_CFLAGS = -Wall -DHAVE_OGGVORBIS=1 -DHAS_SOCKLEN_T -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAS_POLL=1 -DHAS_FCNTL=1 -DHAS_INET_PTON=1 -DHAS_INET_NTOP=1 -DHAS_MSGHDR_FLAGS=1 -DENABLE_NLS=1 -DHAVE_GETTEXT=1 -DHAVE_GLUT=1 -DHAVE_IRRLICHT=1 -DPACKAGE="\"supertuxkart\"" -D__MACOSX__=1 -DHAVE_RTT=0 -DENABLE_BIDI=1 -fvisibility=hidden OTHER_LDFLAGS = -lcurl -LIBRARY_SEARCH_PATHS = /usr/local/lib /usr/lib +LIBRARY_SEARCH_PATHS = /usr/lib /usr/local/lib diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp index 6482b3ad8..a8eea695d 100644 --- a/src/karts/kart.cpp +++ b/src/karts/kart.cpp @@ -1956,6 +1956,32 @@ void Kart::updateGraphics(float dt, const Vec3& offset_xyz, * speed_ratio * m_skidding*m_skidding; Moveable::updateGraphics(dt, center_shift, btQuaternion(offset_heading, 0, 0)); + + /* + // cheap wheelie effect + if (m_zipper_fire && m_zipper_fire->getCreationRate() > 0.0f) + { + m_node->updateAbsolutePosition(); + m_kart_model->getWheelNodes()[0]->updateAbsolutePosition(); + float wheel_y = m_kart_model->getWheelNodes()[0]->getAbsolutePosition().Y; + + core::vector3df rot = m_node->getRotation(); + + float ratio = float(m_zipper_fire->getCreationRate())/float(m_zipper_fire->getParticlesInfo()->getMaxRate()); + + const float a = (13.4f - ratio*13.0f); + float dst = -45.0f*sin((a*a)/180.f*M_PI); + + rot.X = dst; + m_node->setRotation(rot); + + m_node->updateAbsolutePosition(); + m_kart_model->getWheelNodes()[0]->updateAbsolutePosition(); + float wheel_y_after = m_kart_model->getWheelNodes()[0]->getAbsolutePosition().Y; + + m_node->setPosition(m_node->getPosition() + core::vector3df(0,wheel_y_after - wheel_y,0)); + } + */ } // updateGraphics /* EOF */ diff --git a/src/karts/kart_model.hpp b/src/karts/kart_model.hpp index fbe5c5376..60569c5dd 100644 --- a/src/karts/kart_model.hpp +++ b/src/karts/kart_model.hpp @@ -186,5 +186,8 @@ public: /** Sets the kart this model is currently used for */ void setKart(Kart* k) { m_kart = k; } + + scene::ISceneNode** getWheelNodes() { return m_wheel_node; } + }; // KartModel #endif