Added "speed-weighted objects" functionality (so that we can have animations whose strength and speed grows with the kart's speed).
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14286 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
45d68487f0
commit
831d27efbc
@ -483,6 +483,11 @@
|
||||
<rear-right position="0.38 0 -0.6" />
|
||||
<rear-left position="-0.38 0 -0.6"/>
|
||||
</wheels>
|
||||
|
||||
<!-- Parameters for the speed-weighted objects:
|
||||
a bigger value for strength-factor leads to the speed of the kart more quickly affecting
|
||||
the strength of the animation (up to a maximum value that corresponds to the original animation) -->
|
||||
<speed-weighted strength-factor="0.05" speed-factor="5.0"/>
|
||||
|
||||
<!-- friction: slip used for bullet skidding. A high value
|
||||
(like 10000000) disables bullet skidding. -->
|
||||
|
@ -994,9 +994,9 @@ void IrrDriver::removeTexture(video::ITexture *t)
|
||||
/** Adds an animated mesh to the scene.
|
||||
* \param mesh The animated mesh to add.
|
||||
*/
|
||||
scene::IAnimatedMeshSceneNode *IrrDriver::addAnimatedMesh(scene::IAnimatedMesh *mesh)
|
||||
scene::IAnimatedMeshSceneNode *IrrDriver::addAnimatedMesh(scene::IAnimatedMesh *mesh, scene::ISceneNode* parent)
|
||||
{
|
||||
return m_scene_manager->addAnimatedMeshSceneNode(mesh, NULL, -1,
|
||||
return m_scene_manager->addAnimatedMeshSceneNode(mesh, parent, -1,
|
||||
core::vector3df(0,0,0),
|
||||
core::vector3df(0,0,0),
|
||||
core::vector3df(1,1,1),
|
||||
|
@ -171,7 +171,7 @@ public:
|
||||
void removeMeshFromCache(scene::IMesh *mesh);
|
||||
void removeTexture(video::ITexture *t);
|
||||
scene::IAnimatedMeshSceneNode
|
||||
*addAnimatedMesh(scene::IAnimatedMesh *mesh);
|
||||
*addAnimatedMesh(scene::IAnimatedMesh *mesh, scene::ISceneNode* parent=NULL);
|
||||
scene::ICameraSceneNode
|
||||
*addCameraSceneNode();
|
||||
Camera *addCamera(unsigned int index, AbstractKart *kart);
|
||||
|
@ -2389,7 +2389,7 @@ void Kart::updateGraphics(float dt, const Vec3& offset_xyz,
|
||||
wheel_up_axis[i] = m_default_suspension_length[i]
|
||||
- m_vehicle->getWheelInfo(i).m_raycastInfo.m_suspensionLength;
|
||||
}
|
||||
m_kart_model->update(m_wheel_rotation_dt, getSteerPercent(), wheel_up_axis);
|
||||
m_kart_model->update(m_wheel_rotation_dt, getSteerPercent(), wheel_up_axis, m_speed);
|
||||
|
||||
Vec3 center_shift = m_kart_properties->getGravityCenterShift();
|
||||
float y = m_vehicle->getWheelInfo(0).m_chassisConnectionPointCS.getY()
|
||||
|
@ -89,6 +89,7 @@ KartModel::KartModel(bool is_master)
|
||||
m_wheel_filename[1] = "";
|
||||
m_wheel_filename[2] = "";
|
||||
m_wheel_filename[3] = "";
|
||||
m_speed_weighted_objects.clear();
|
||||
m_animated_node = NULL;
|
||||
m_mesh = NULL;
|
||||
for(unsigned int i=AF_BEGIN; i<=AF_END; i++)
|
||||
@ -123,6 +124,8 @@ void KartModel::loadInfo(const XMLNode &node)
|
||||
animation_node->get("start-jump", &m_animation_frame[AF_JUMP_START]);
|
||||
animation_node->get("start-jump-loop",&m_animation_frame[AF_JUMP_LOOP] );
|
||||
animation_node->get("end-jump", &m_animation_frame[AF_JUMP_END] );
|
||||
animation_node->get("start-speed-weighted", &m_animation_frame[AF_SPEED_WEIGHTED_START] );
|
||||
animation_node->get("end-speed-weighted", &m_animation_frame[AF_SPEED_WEIGHTED_END] );
|
||||
animation_node->get("speed", &m_animation_speed );
|
||||
}
|
||||
|
||||
@ -145,6 +148,14 @@ void KartModel::loadInfo(const XMLNode &node)
|
||||
m_has_nitro_emitter = true;
|
||||
}
|
||||
|
||||
if(const XMLNode *speedWeighted_node=node.getNode("speed-weighted"))
|
||||
{
|
||||
for(unsigned int i=0 ; i < speedWeighted_node->getNumNodes() ; i++)
|
||||
{
|
||||
loadSpeedWeightedInfo(speedWeighted_node->getNode(i));
|
||||
}
|
||||
}
|
||||
|
||||
if(const XMLNode *hat_node=node.getNode("hat"))
|
||||
{
|
||||
if(hat_node->get("offset", &m_hat_offset))
|
||||
@ -185,6 +196,22 @@ KartModel::~KartModel()
|
||||
}
|
||||
}
|
||||
|
||||
for(size_t i=0; i<m_speed_weighted_objects.size(); i++)
|
||||
{
|
||||
if(m_speed_weighted_objects[i].m_node)
|
||||
{
|
||||
// Master KartModels should never have a speed weighted object attached.
|
||||
assert(!m_is_master);
|
||||
|
||||
m_speed_weighted_objects[i].m_node->drop();
|
||||
}
|
||||
if(m_is_master && m_speed_weighted_objects[i].m_model)
|
||||
{
|
||||
irr_driver->dropAllTextures(m_speed_weighted_objects[i].m_model);
|
||||
irr_driver->removeMeshFromCache(m_speed_weighted_objects[i].m_model);
|
||||
}
|
||||
}
|
||||
|
||||
if(m_is_master && m_mesh)
|
||||
{
|
||||
m_mesh->drop();
|
||||
@ -247,6 +274,17 @@ KartModel* KartModel::makeCopy()
|
||||
km->m_max_suspension[i] = m_max_suspension[i];
|
||||
km->m_dampen_suspension_amplitude[i]= m_dampen_suspension_amplitude[i];
|
||||
}
|
||||
|
||||
km->m_speed_weighted_objects.resize(m_speed_weighted_objects.size());
|
||||
for(size_t i=0; i<m_speed_weighted_objects.size(); i++)
|
||||
{
|
||||
km->m_speed_weighted_objects[i].m_model = m_speed_weighted_objects[i].m_model;
|
||||
// Master should not have any speed weighted nodes.
|
||||
assert(!m_speed_weighted_objects[i].m_node);
|
||||
km->m_speed_weighted_objects[i].m_name = m_speed_weighted_objects[i].m_name;
|
||||
km->m_speed_weighted_objects[i].m_position = m_speed_weighted_objects[i].m_position;
|
||||
}
|
||||
|
||||
for(unsigned int i=AF_BEGIN; i<=AF_END; i++)
|
||||
km->m_animation_frame[i] = m_animation_frame[i];
|
||||
|
||||
@ -299,6 +337,13 @@ scene::ISceneNode* KartModel::attachModel(bool animated_models)
|
||||
if(!m_wheel_model[i]) continue;
|
||||
m_wheel_node[i]->setParent(lod_node);
|
||||
}
|
||||
|
||||
// Become the owner of the speed weighted objects
|
||||
for(size_t i=0; i<m_speed_weighted_objects.size(); i++)
|
||||
{
|
||||
if(!m_speed_weighted_objects[i].m_node) continue;
|
||||
m_speed_weighted_objects[i].m_node->setParent(lod_node);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -316,6 +361,8 @@ scene::ISceneNode* KartModel::attachModel(bool animated_models)
|
||||
std::string debug_name = m_model_filename+" (kart-model)";
|
||||
node->setName(debug_name.c_str());
|
||||
#endif
|
||||
|
||||
// Attach the wheels
|
||||
for(unsigned int i=0; i<4; i++)
|
||||
{
|
||||
if(!m_wheel_model[i]) continue;
|
||||
@ -327,6 +374,27 @@ scene::ISceneNode* KartModel::attachModel(bool animated_models)
|
||||
#endif
|
||||
m_wheel_node[i]->setPosition(m_wheel_graphics_position[i].toIrrVector());
|
||||
}
|
||||
|
||||
// Attach the speed weighted objects + set the animation state
|
||||
for(size_t i=0 ; i < m_speed_weighted_objects.size() ; i++)
|
||||
{
|
||||
SpeedWeightedObject& obj = m_speed_weighted_objects[i];
|
||||
obj.m_node = NULL;
|
||||
if(obj.m_model)
|
||||
{
|
||||
obj.m_node = irr_driver->addAnimatedMesh(obj.m_model, node);
|
||||
obj.m_node->grab();
|
||||
|
||||
obj.m_node->setAnimationStrength(0.0f);
|
||||
obj.m_node->setFrameLoop(m_animation_frame[AF_SPEED_WEIGHTED_START], m_animation_frame[AF_SPEED_WEIGHTED_END]);
|
||||
|
||||
#ifdef DEBUG
|
||||
std::string debug_name = obj.m_name+" (speed-weighted)";
|
||||
obj.m_node->setName(debug_name.c_str());
|
||||
#endif
|
||||
obj.m_node->setPosition(obj.m_position.toIrrVector());
|
||||
}
|
||||
}
|
||||
}
|
||||
return node;
|
||||
} // attachModel
|
||||
@ -350,10 +418,31 @@ bool KartModel::loadModels(const KartProperties &kart_properties)
|
||||
m_mesh->grab();
|
||||
irr_driver->grabAllTextures(m_mesh);
|
||||
|
||||
Vec3 min, max;
|
||||
MeshTools::minMax3D(m_mesh->getMesh(m_animation_frame[AF_STRAIGHT]), &min, &max);
|
||||
Vec3 kart_min, kart_max;
|
||||
MeshTools::minMax3D(m_mesh->getMesh(m_animation_frame[AF_STRAIGHT]), &kart_min, &kart_max);
|
||||
|
||||
Vec3 size = max-min;
|
||||
// Load the speed weighted object models. We need to do that now because it can affect the dimensions of the kart
|
||||
for(size_t i=0 ; i < m_speed_weighted_objects.size() ; i++)
|
||||
{
|
||||
SpeedWeightedObject& obj = m_speed_weighted_objects[i];
|
||||
std::string full_name =
|
||||
kart_properties.getKartDir()+obj.m_name;
|
||||
obj.m_model = irr_driver->getAnimatedMesh(full_name);
|
||||
// Grab all textures. This is done for the master only, so
|
||||
// the destructor will only free the textures if a master
|
||||
// copy is freed.
|
||||
irr_driver->grabAllTextures(obj.m_model);
|
||||
|
||||
// Update min/max
|
||||
Vec3 obj_min, obj_max;
|
||||
MeshTools::minMax3D(obj.m_model, &obj_min, &obj_max);
|
||||
obj_min += obj.m_position;
|
||||
obj_max += obj.m_position;
|
||||
kart_min.min(obj_min);
|
||||
kart_max.min(obj_max);
|
||||
}
|
||||
|
||||
Vec3 size = kart_max-kart_min;
|
||||
m_kart_width = size.getX();
|
||||
m_kart_height = size.getY();
|
||||
m_kart_length = size.getZ();
|
||||
@ -418,6 +507,18 @@ void KartModel::loadNitroEmitterInfo(const XMLNode &node,
|
||||
emitter_node->get("position", &m_nitro_emitter_position[index]);
|
||||
} // loadNitroEmitterInfo
|
||||
|
||||
/** Loads a single speed weighted node. */
|
||||
void KartModel::loadSpeedWeightedInfo(const XMLNode* speed_weighted_node)
|
||||
{
|
||||
SpeedWeightedObject obj;
|
||||
|
||||
speed_weighted_node->get("position", &obj.m_position);
|
||||
speed_weighted_node->get("model", &obj.m_name);
|
||||
|
||||
if(!obj.m_name.empty())
|
||||
m_speed_weighted_objects.push_back(obj);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Loads a single wheel node. Currently this is the name of the wheel model
|
||||
* and the position of the wheel relative to the kart.
|
||||
@ -488,7 +589,7 @@ void KartModel::reset()
|
||||
{
|
||||
// Reset the wheels
|
||||
const float suspension[4]={0,0,0,0};
|
||||
update(0, 0.0f, suspension);
|
||||
update(0, 0.0f, suspension, 0.0f);
|
||||
|
||||
// Stop any animations currently being played.
|
||||
setAnimation(KartModel::AF_DEFAULT);
|
||||
@ -594,12 +695,14 @@ void KartModel::OnAnimationEnd(scene::IAnimatedMeshSceneNode *node)
|
||||
} // OnAnimationEnd
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Rotates and turns the wheels appropriately, and adjust for suspension.
|
||||
/** Rotates and turns the wheels appropriately, and adjust for suspension
|
||||
+ updates the speed-weighted objects' animations.
|
||||
* \param rotation_dt How far the wheels have rotated since last time.
|
||||
* \param steer The actual steer settings.
|
||||
* \param suspension Suspension height for all four wheels.
|
||||
* \param speed The speed of the kart in meters/sec, used for the speed-weighted objects' animations
|
||||
*/
|
||||
void KartModel::update(float rotation_dt, float steer, const float suspension[4])
|
||||
void KartModel::update(float rotation_dt, float steer, const float suspension[4], float speed)
|
||||
{
|
||||
float clamped_suspension[4];
|
||||
// Clamp suspension to minimum and maximum suspension length, so that
|
||||
@ -655,6 +758,18 @@ void KartModel::update(float rotation_dt, float steer, const float suspension[4]
|
||||
// If animations are disabled, stop here
|
||||
if (m_animated_node == NULL) return;
|
||||
|
||||
// Update the speed-weighted objects' animations
|
||||
for(size_t i=0 ; i < m_speed_weighted_objects.size() ; i++)
|
||||
{
|
||||
SpeedWeightedObject& obj = m_speed_weighted_objects[i];
|
||||
float strength = speed * m_kart->getKartProperties()->getSpeedWeightedStrengthFactor();
|
||||
btClamp<float>(strength, 0.0f, 1.0f);
|
||||
obj.m_node->setAnimationStrength(strength);
|
||||
|
||||
float anim_speed = speed * m_kart->getKartProperties()->getSpeedWeightedSpeedFactor();
|
||||
obj.m_node->setAnimationSpeed(anim_speed);
|
||||
}
|
||||
|
||||
// Check if the end animation is being played, if so, don't
|
||||
// play steering animation.
|
||||
if(m_current_animation!=AF_DEFAULT) return;
|
||||
@ -710,4 +825,3 @@ void KartModel::attachHat(){
|
||||
} // if bone
|
||||
} // if(m_hat_name)
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
#define HEADER_KART_MODEL_HPP
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <IAnimatedMeshSceneNode.h>
|
||||
namespace irr
|
||||
@ -36,6 +37,23 @@ class AbstractKart;
|
||||
class KartProperties;
|
||||
class XMLNode;
|
||||
|
||||
struct SpeedWeightedObject
|
||||
{
|
||||
SpeedWeightedObject() : m_model(NULL), m_node(NULL), m_position(), m_name() {}
|
||||
/** Model */
|
||||
scene::IAnimatedMesh * m_model;
|
||||
|
||||
/** The scene node the speed weighted model is attached to */
|
||||
scene::IAnimatedMeshSceneNode * m_node;
|
||||
|
||||
/** The position of the "speed weighted" objects relative to the kart */
|
||||
Vec3 m_position;
|
||||
|
||||
/** Filename of the "speed weighted" object */
|
||||
std::string m_name;
|
||||
};
|
||||
typedef std::vector<SpeedWeightedObject> SpeedWeightedObjectList;
|
||||
|
||||
/**
|
||||
* \brief This class stores a 3D kart model.
|
||||
* It takes especially care of attaching
|
||||
@ -66,7 +84,9 @@ public:
|
||||
AF_WIN_START, // Begin of win animation
|
||||
AF_WIN_LOOP_START, // Begin of win loop animation
|
||||
AF_WIN_END, // End of win animation
|
||||
AF_END=AF_WIN_END, // Last animation frame
|
||||
AF_SPEED_WEIGHTED_START, // Start of speed-weighted animation
|
||||
AF_SPEED_WEIGHTED_END, // End of speed-weighted animation
|
||||
AF_END=AF_SPEED_WEIGHTED_END, // Last animation frame
|
||||
AF_COUNT}; // Number of entries here
|
||||
private:
|
||||
/** Which frame number starts/end which animation. */
|
||||
@ -123,6 +143,9 @@ private:
|
||||
/** True if kart has nitro emitters */
|
||||
bool m_has_nitro_emitter;
|
||||
|
||||
/** The speed weighted objects. */
|
||||
SpeedWeightedObjectList m_speed_weighted_objects;
|
||||
|
||||
/** Minimum suspension length. If the displayed suspension is
|
||||
* shorter than this, the wheel would look wrong. */
|
||||
float m_min_suspension[4];
|
||||
@ -154,6 +177,8 @@ private:
|
||||
void loadNitroEmitterInfo(const XMLNode &node,
|
||||
const std::string &emitter_name, int index);
|
||||
|
||||
void loadSpeedWeightedInfo(const XMLNode* speed_weighted_node);
|
||||
|
||||
void OnAnimationEnd(scene::IAnimatedMeshSceneNode *node);
|
||||
|
||||
/** Pointer to the kart object belonging to this kart model. */
|
||||
@ -167,7 +192,7 @@ public:
|
||||
void loadInfo(const XMLNode &node);
|
||||
bool loadModels(const KartProperties &kart_properties);
|
||||
void update(float rotation_dt, float steer,
|
||||
const float suspension[4]);
|
||||
const float suspension[4], float speed);
|
||||
void setDefaultPhysicsPosition(const Vec3 ¢er_shift,
|
||||
float wheel_radius);
|
||||
void finishedRace();
|
||||
@ -221,6 +246,15 @@ public:
|
||||
const bool hasNitroEmitters() const
|
||||
{return m_has_nitro_emitter;}
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns the number of speed weighted objects for this kart */
|
||||
size_t getSpeedWeightedObjectsCount() const
|
||||
{return m_speed_weighted_objects.size();}
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns the position of a speed weighted object relative to the kart.
|
||||
* \param i Index of the object */
|
||||
const SpeedWeightedObject& getSpeedWeightedObject(int i) const
|
||||
{return m_speed_weighted_objects[i];}
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns the length of the kart model. */
|
||||
float getLength () const {return m_kart_length; }
|
||||
// ------------------------------------------------------------------------
|
||||
|
@ -68,7 +68,8 @@ KartProperties::KartProperties(const std::string &filename)
|
||||
m_nitro_max_speed_increase = m_nitro_duration = m_nitro_fade_out_time =
|
||||
m_suspension_stiffness = m_wheel_damping_relaxation = m_wheel_base =
|
||||
m_wheel_damping_compression = m_friction_slip = m_roll_influence =
|
||||
m_wheel_radius = m_chassis_linear_damping = m_max_suspension_force =
|
||||
m_wheel_radius = m_speed_weighted_strength_factor = m_speed_weighted_speed_factor =
|
||||
m_chassis_linear_damping = m_max_suspension_force =
|
||||
m_chassis_angular_damping = m_suspension_rest =
|
||||
m_max_speed_reverse_ratio = m_rescue_vert_offset =
|
||||
m_upright_tolerance = m_collision_terrain_impulse =
|
||||
@ -426,6 +427,12 @@ void KartProperties::getAllData(const XMLNode * root)
|
||||
wheels_node->get("radius", &m_wheel_radius );
|
||||
}
|
||||
|
||||
if(const XMLNode *speed_weighted_node = root->getNode("speed-weighted"))
|
||||
{
|
||||
speed_weighted_node->get("strength-factor", &m_speed_weighted_strength_factor);
|
||||
speed_weighted_node->get("speed-factor", &m_speed_weighted_speed_factor);
|
||||
}
|
||||
|
||||
if(const XMLNode *friction_node = root->getNode("friction"))
|
||||
friction_node->get("slip", &m_friction_slip);
|
||||
|
||||
@ -626,6 +633,8 @@ void KartProperties::checkAllSet(const std::string &filename)
|
||||
CHECK_NEG(m_time_reset_steer, "turn time-reset-steer" );
|
||||
CHECK_NEG(m_wheel_damping_relaxation, "wheels damping-relaxation" );
|
||||
CHECK_NEG(m_wheel_damping_compression, "wheels damping-compression" );
|
||||
CHECK_NEG(m_speed_weighted_strength_factor, "speed-weighted strength-factor" );
|
||||
CHECK_NEG(m_speed_weighted_speed_factor, "speed-weighted speed-factor" );
|
||||
CHECK_NEG(m_wheel_radius, "wheels radius" );
|
||||
CHECK_NEG(m_friction_slip, "friction slip" );
|
||||
CHECK_NEG(m_roll_influence, "stability roll-influence" );
|
||||
|
@ -264,6 +264,10 @@ private:
|
||||
float m_roll_influence;
|
||||
float m_wheel_radius;
|
||||
|
||||
// Parameters for speed-weighted objects
|
||||
float m_speed_weighted_strength_factor;
|
||||
float m_speed_weighted_speed_factor;
|
||||
|
||||
/** An impulse pushing the kart down which is proportional to speed. So
|
||||
* the actual impulse is speed * m_downward_impulse_factor. Set it to
|
||||
* 0 to disable completely. Based on
|
||||
@ -528,6 +532,14 @@ public:
|
||||
/** Returns wheel radius. */
|
||||
float getWheelRadius () const {return m_wheel_radius; }
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns animation strength factor for speed-weighted objects */
|
||||
float getSpeedWeightedStrengthFactor() const {return m_speed_weighted_strength_factor;}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns animation speed factor for speed-weighted objects */
|
||||
float getSpeedWeightedSpeedFactor() const {return m_speed_weighted_speed_factor;}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns the wheel base (distance front to rear axis). */
|
||||
float getWheelBase () const {return m_wheel_base; }
|
||||
|
@ -330,7 +330,7 @@ void FeatureUnlockedCutScene::init()
|
||||
m_unlocked_stuff[n].m_root_gift_node = kart_model->attachModel(true);
|
||||
kart_model->setAnimation(KartModel::AF_DEFAULT);
|
||||
float susp[4]={0,0,0,0};
|
||||
kart_model->update(0.0f, 0.0f, susp);
|
||||
kart_model->update(0.0f, 0.0f, susp, 0.0f);
|
||||
|
||||
#ifdef DEBUG
|
||||
m_unlocked_stuff[n].m_root_gift_node->setName("unlocked kart");
|
||||
|
@ -340,7 +340,7 @@ void GrandPrixLose::setKarts(std::vector<std::string> ident_arg)
|
||||
kart_main_node->updateAbsolutePosition();
|
||||
kart_main_node->setRotation(vector3df(0, 90, 0));
|
||||
float susp[4]={0,0,0,0};
|
||||
kart_model->update(0.0f, 0.0f, susp);
|
||||
kart_model->update(0.0f, 0.0f, susp, 0.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -451,7 +451,7 @@ void GrandPrixWin::setKarts(const std::string idents_arg[3])
|
||||
m_kart_z[n]) );
|
||||
kart_main_node->setScale( core::vector3df(0.4f, 0.4f, 0.4f) );
|
||||
float susp[4]={0,0,0,0};
|
||||
kart_model->update(0.0f, 0.0f, susp);
|
||||
kart_model->update(0.0f, 0.0f, susp, 0.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -392,6 +392,11 @@ public:
|
||||
kart_model.getWheelGraphicsPosition(2) );
|
||||
m_model_view->addModel( kart_model.getWheelModel(3),
|
||||
kart_model.getWheelGraphicsPosition(3) );
|
||||
for(size_t i=0 ; i < kart_model.getSpeedWeightedObjectsCount() ; i++)
|
||||
{
|
||||
const SpeedWeightedObject& obj = kart_model.getSpeedWeightedObject(i);
|
||||
m_model_view->addModel(obj.m_model, obj.m_position);
|
||||
}
|
||||
m_model_view->setRotateContinuously( 35.0f );
|
||||
|
||||
// ---- Kart name label
|
||||
@ -954,6 +959,11 @@ public:
|
||||
kart_model.getWheelGraphicsPosition(2) );
|
||||
w3->addModel( kart_model.getWheelModel(3),
|
||||
kart_model.getWheelGraphicsPosition(3) );
|
||||
for(size_t i=0 ; i < kart_model.getSpeedWeightedObjectsCount() ; i++)
|
||||
{
|
||||
const SpeedWeightedObject& obj = kart_model.getSpeedWeightedObject(i);
|
||||
w3->addModel(obj.m_model, obj.m_position);
|
||||
}
|
||||
w3->update(0);
|
||||
|
||||
m_parent->m_kart_widgets[playerID].m_kart_name
|
||||
|
Loading…
Reference in New Issue
Block a user