Refacotring: instead of Moveable::update calling updateGraphics,
this is now called separately once per rendered frame from the main loop. Started to split other objects to have separate updateGraphics functions (e.g. to fix skid marks issues caused by previously updating skidmarks even in rewind).
This commit is contained in:
parent
b17b45d8c5
commit
95bba525c5
@ -371,6 +371,16 @@ void Flyable::setAnimation(AbstractKartAnimation *animation)
|
||||
m_animation = animation;
|
||||
} // addAnimation
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** Called once per rendered frame. It is used to only update any graphical
|
||||
* effects.
|
||||
* \param dt Time step size (since last call).
|
||||
*/
|
||||
void Flyable::updateGraphics(float dt)
|
||||
{
|
||||
Moveable::updateGraphics(dt, Vec3(0, 0, 0), btQuaternion(0, 0, 0, 1));
|
||||
} // updateGraphics
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** Updates this flyable. It calls Moveable::update. If this function returns
|
||||
* true, the flyable will be deleted by the projectile manager.
|
||||
|
@ -22,17 +22,18 @@
|
||||
#ifndef HEADER_FLYABLE_HPP
|
||||
#define HEADER_FLYABLE_HPP
|
||||
|
||||
#include "items/powerup_manager.hpp"
|
||||
#include "karts/moveable.hpp"
|
||||
#include "tracks/terrain_info.hpp"
|
||||
#include "utils/cpp2011.hpp"
|
||||
|
||||
#include <irrString.h>
|
||||
namespace irr
|
||||
{
|
||||
namespace scene { class IMesh; }
|
||||
}
|
||||
#include <irrString.h>
|
||||
using namespace irr;
|
||||
|
||||
#include "items/powerup_manager.hpp"
|
||||
#include "karts/moveable.hpp"
|
||||
#include "tracks/terrain_info.hpp"
|
||||
|
||||
class AbstractKart;
|
||||
class AbstractKartAnimation;
|
||||
class HitEffect;
|
||||
@ -167,6 +168,7 @@ public:
|
||||
virtual ~Flyable ();
|
||||
static void init (const XMLNode &node, scene::IMesh *model,
|
||||
PowerupManager::PowerupType type);
|
||||
void updateGraphics(float dt) OVERRIDE;
|
||||
virtual bool updateAndDelete(int ticks);
|
||||
virtual void setAnimation(AbstractKartAnimation *animation);
|
||||
virtual HitEffect* getHitEffect() const;
|
||||
|
@ -61,6 +61,21 @@ void ProjectileManager::cleanup()
|
||||
m_active_hit_effects.clear();
|
||||
} // cleanup
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
/** Called once per rendered frame. It is used to only update any graphical
|
||||
* effects, and calls updateGraphics in any flyable objects.
|
||||
* \param dt Time step size (since last call).
|
||||
*/
|
||||
void ProjectileManager::updateGraphics(float dt)
|
||||
{
|
||||
for (auto p = m_active_projectiles.begin();
|
||||
p != m_active_projectiles.end(); ++p)
|
||||
{
|
||||
(*p)->updateGraphics(dt);
|
||||
}
|
||||
|
||||
} // updateGraphics
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
/** General projectile update call. */
|
||||
void ProjectileManager::update(int ticks)
|
||||
|
@ -59,6 +59,7 @@ public:
|
||||
void loadData ();
|
||||
void cleanup ();
|
||||
void update (int ticks);
|
||||
void updateGraphics (float dt);
|
||||
Flyable* newProjectile (AbstractKart *kart,
|
||||
PowerupManager::PowerupType type);
|
||||
void Deactivate (Flyable *p) {}
|
||||
|
@ -68,6 +68,21 @@ void GhostKart::addReplayEvent(float time,
|
||||
|
||||
} // addReplayEvent
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Called once per rendered frame. It is used to only update any graphical
|
||||
* effects.
|
||||
* \param dt Time step size (since last call).
|
||||
*/
|
||||
void GhostKart::updateGraphics(float dt)
|
||||
{
|
||||
Vec3 center_shift(0, m_graphical_y_offset, 0);
|
||||
center_shift = getTrans().getBasis() * center_shift;
|
||||
|
||||
// Don't call Kart's updateGraphics, since it assumes physics. Instead
|
||||
// immediately call Moveable's updateGraphics.
|
||||
Moveable::updateGraphics(dt, center_shift, btQuaternion(0, 0, 0, 1));
|
||||
} // updateGraphics
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Updates the current event of the ghost kart using interpolation
|
||||
* \param dt Time step size.
|
||||
@ -109,11 +124,6 @@ void GhostKart::update(int ticks)
|
||||
.slerp(m_all_transform[idx + 1].getRotation(), rd);
|
||||
setRotation(q);
|
||||
|
||||
Vec3 center_shift(0, 0, 0);
|
||||
center_shift.setY(m_graphical_y_offset);
|
||||
center_shift = getTrans().getBasis() * center_shift;
|
||||
|
||||
Moveable::updateGraphics(ticks, center_shift, btQuaternion(0, 0, 0, 1));
|
||||
Moveable::updatePosition();
|
||||
float dt = stk_config->ticks2Time(ticks);
|
||||
getKartModel()->update(dt, dt*(m_all_physic_info[idx].m_speed),
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "karts/kart.hpp"
|
||||
#include "replay/replay_base.hpp"
|
||||
#include "utils/cpp2011.hpp"
|
||||
|
||||
#include "LinearMath/btTransform.h"
|
||||
|
||||
@ -46,7 +47,8 @@ private:
|
||||
public:
|
||||
GhostKart(const std::string& ident,
|
||||
unsigned int world_kart_id, int position);
|
||||
virtual void update(int ticks);
|
||||
virtual void update(int ticks) OVERRIDE;
|
||||
virtual void updateGraphics(float dt) OVERRIDE;
|
||||
virtual void reset();
|
||||
// ------------------------------------------------------------------------
|
||||
/** No physics body for ghost kart, so nothing to adjust. */
|
||||
|
@ -1550,23 +1550,6 @@ void Kart::update(int ticks)
|
||||
NetworkConfig::get()->isServer() )
|
||||
ItemManager::get()->checkItemHit(this);
|
||||
|
||||
static video::SColor pink(255, 255, 133, 253);
|
||||
static video::SColor green(255, 61, 87, 23);
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
// draw skidmarks if relevant (we force pink skidmarks on when hitting
|
||||
// a bubblegum)
|
||||
if(m_kart_properties->getSkidEnabled() && m_skidmarks)
|
||||
{
|
||||
m_skidmarks->update(dt,
|
||||
m_bubblegum_ticks > 0,
|
||||
(m_bubblegum_ticks > 0
|
||||
? (m_has_caught_nolok_bubblegum ? &green
|
||||
: &pink)
|
||||
: NULL ) );
|
||||
}
|
||||
#endif
|
||||
|
||||
const bool emergency = getKartAnimation()!=NULL;
|
||||
|
||||
if (emergency)
|
||||
@ -1785,7 +1768,7 @@ void Kart::handleMaterialSFX(const Material *material)
|
||||
|
||||
// terrain sound is not necessarily a looping sound so check its status before
|
||||
// setting its speed, to avoid 'ressuscitating' sounds that had already stopped
|
||||
if(m_terrain_sound && main_loop->isLstSubstep() &&
|
||||
if(m_terrain_sound && main_loop->isLastSubstep() &&
|
||||
(m_terrain_sound->getStatus()==SFXBase::SFX_PLAYING ||
|
||||
m_terrain_sound->getStatus()==SFXBase::SFX_PAUSED))
|
||||
{
|
||||
@ -2423,7 +2406,7 @@ void Kart::updateEngineSFX(float dt)
|
||||
// Only update SFX during the last substep (otherwise too many SFX commands
|
||||
// in one frame), and if sfx are enabled
|
||||
if(!m_engine_sound || !SFXManager::get()->sfxAllowed() ||
|
||||
!main_loop->isLstSubstep() )
|
||||
!main_loop->isLastSubstep() )
|
||||
return;
|
||||
|
||||
// when going faster, use higher pitch for engine
|
||||
@ -2860,9 +2843,25 @@ SFXBase* Kart::getNextEmitter()
|
||||
* \param offset_xyz Offset to be added to the position.
|
||||
* \param rotation Additional rotation.
|
||||
*/
|
||||
void Kart::updateGraphics(int ticks, const Vec3& offset_xyz,
|
||||
const btQuaternion& rotation)
|
||||
void Kart::updateGraphics(float dt)
|
||||
{
|
||||
static video::SColor pink(255, 255, 133, 253);
|
||||
static video::SColor green(255, 61, 87, 23);
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
// draw skidmarks if relevant (we force pink skidmarks on when hitting
|
||||
// a bubblegum)
|
||||
if (m_kart_properties->getSkidEnabled() && m_skidmarks)
|
||||
{
|
||||
m_skidmarks->update(dt,
|
||||
m_bubblegum_ticks > 0,
|
||||
(m_bubblegum_ticks > 0
|
||||
? (m_has_caught_nolok_bubblegum ? &green
|
||||
: &pink)
|
||||
: NULL));
|
||||
}
|
||||
#endif
|
||||
|
||||
// Upate particle effects (creation rate, and emitter size
|
||||
// depending on speed)
|
||||
// --------------------------------------------------------
|
||||
@ -2896,7 +2895,6 @@ void Kart::updateGraphics(int ticks, const Vec3& offset_xyz,
|
||||
|
||||
const float roll_speed = m_kart_properties->getLeanSpeed() * DEGREE_TO_RAD;
|
||||
|
||||
float dt = stk_config->ticks2Time(ticks);
|
||||
if(speed_frac > 0.8f && fabsf(steer_frac)>0.5f)
|
||||
{
|
||||
// Use steering ^ 7, which means less effect at lower
|
||||
@ -2949,7 +2947,7 @@ void Kart::updateGraphics(int ticks, const Vec3& offset_xyz,
|
||||
center_shift = getTrans().getBasis() * center_shift;
|
||||
|
||||
float heading = m_skidding->getVisualSkidRotation();
|
||||
Moveable::updateGraphics(ticks, center_shift,
|
||||
Moveable::updateGraphics(dt, center_shift,
|
||||
btQuaternion(heading, 0, -m_current_lean));
|
||||
|
||||
// m_speed*dt is the distance the kart has moved, which determines
|
||||
|
@ -246,8 +246,7 @@ public:
|
||||
virtual ~Kart();
|
||||
virtual void init(RaceManager::KartType type);
|
||||
virtual void kartIsInRestNow();
|
||||
virtual void updateGraphics(int ticks, const Vec3& off_xyz,
|
||||
const btQuaternion& off_rotation);
|
||||
virtual void updateGraphics(float dt) OVERRIDE;
|
||||
virtual void createPhysics ();
|
||||
virtual void updateWeight ();
|
||||
virtual float getSpeedForTurnRadius(float radius) const;
|
||||
|
@ -88,7 +88,7 @@ void Moveable::addError(const Vec3& pos_error,
|
||||
* \param offset_xyz Offset to be added to the position.
|
||||
* \param rotation Additional rotation.
|
||||
*/
|
||||
void Moveable::updateGraphics(int ticks, const Vec3& offset_xyz,
|
||||
void Moveable::updateGraphics(float dt, const Vec3& offset_xyz,
|
||||
const btQuaternion& rotation)
|
||||
{
|
||||
// If this is a client, don't smooth error during rewinds
|
||||
@ -173,8 +173,6 @@ void Moveable::update(int ticks)
|
||||
m_motion_state->getWorldTransform(m_transform);
|
||||
m_velocityLC = getVelocity()*m_transform.getBasis();
|
||||
updatePosition();
|
||||
|
||||
updateGraphics(ticks, Vec3(0,0,0), btQuaternion(0, 0, 0, 1));
|
||||
} // update
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -65,6 +65,9 @@ protected:
|
||||
btRigidBody *m_body;
|
||||
KartMotionState *m_motion_state;
|
||||
|
||||
virtual void updateGraphics(float dt, const Vec3& off_xyz,
|
||||
const btQuaternion& off_rotation);
|
||||
|
||||
public:
|
||||
Moveable();
|
||||
virtual ~Moveable();
|
||||
@ -116,8 +119,6 @@ public:
|
||||
m_motion_state->setWorldTransform(m_transform);
|
||||
} // setRotation(btQuaternion)
|
||||
// ------------------------------------------------------------------------
|
||||
virtual void updateGraphics(int ticks, const Vec3& off_xyz,
|
||||
const btQuaternion& off_rotation);
|
||||
virtual void reset();
|
||||
virtual void update(int ticks) ;
|
||||
btRigidBody *getBody() const {return m_body; }
|
||||
@ -130,6 +131,12 @@ public:
|
||||
void updatePosition();
|
||||
void addError(const Vec3& pos_error,
|
||||
const btQuaternion &rot_error);
|
||||
// ------------------------------------------------------------------------
|
||||
/** Called once per rendered frame. It is used to only update any graphical
|
||||
* effects.
|
||||
* \param dt Time step size (since last call).
|
||||
*/
|
||||
virtual void updateGraphics(float dt) = 0;
|
||||
}; // class Moveable
|
||||
|
||||
#endif
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns if this is the last substep. Used to reduce the amount
|
||||
* of updates (e.g. to sfx position) to once per rendered frame. */
|
||||
bool isLstSubstep() const { return m_is_last_substep; }
|
||||
bool isLastSubstep() const { return m_is_last_substep; }
|
||||
}; // MainLoop
|
||||
|
||||
extern MainLoop* main_loop;
|
||||
|
@ -240,6 +240,7 @@ void LinearWorld::update(int ticks)
|
||||
*/
|
||||
void LinearWorld::updateGraphics(float dt)
|
||||
{
|
||||
WorldWithRank::updateGraphics(dt);
|
||||
if (m_last_lap_sfx_playing &&
|
||||
m_last_lap_sfx->getStatus() != SFXBase::SFX_PLAYING)
|
||||
{
|
||||
|
@ -968,6 +968,18 @@ void World::updateGraphics(float dt)
|
||||
Weather::getInstance()->update(dt);
|
||||
}
|
||||
PROFILER_POP_CPU_MARKER();
|
||||
|
||||
// Update graphics of karts, e.g. visual suspension, skid marks
|
||||
const int kart_amount = (int)m_karts.size();
|
||||
for (int i = 0; i < kart_amount; ++i)
|
||||
{
|
||||
// Update all karts that are not eliminated
|
||||
if (!m_karts[i]->isEliminated() )
|
||||
m_karts[i]->updateGraphics(dt);
|
||||
}
|
||||
|
||||
projectile_manager->updateGraphics(dt);
|
||||
Track::getCurrentTrack()->updateGraphics(dt);
|
||||
} // updateGraphics
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -596,31 +596,46 @@ void PhysicalObject::init(const PhysicalObject::Settings& settings)
|
||||
} // init
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** This updates all only graphical elements. It is only called once per
|
||||
* rendered frame, not once per time step.
|
||||
* float dt Time since last rame.
|
||||
*/
|
||||
|
||||
void PhysicalObject::updateGraphics(float dt)
|
||||
{
|
||||
Vec3 xyz = m_current_transform.getOrigin();
|
||||
|
||||
// Offset the graphical position correctly:
|
||||
xyz += m_current_transform.getBasis()*m_graphical_offset;
|
||||
|
||||
Vec3 hpr;
|
||||
hpr.setHPR(m_current_transform.getRotation());
|
||||
|
||||
// This will only update the visual position, so it can be
|
||||
// called in updateGraphics()
|
||||
m_object->move(xyz.toIrrVector(), hpr.toIrrVector()*RAD_TO_DEGREE,
|
||||
m_init_scale, /*updateRigidBody*/false,
|
||||
/* isAbsoluteCoord */true);
|
||||
} // updateGraphics
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Update, called once per physics time step.
|
||||
* \param dt Timestep.
|
||||
*/
|
||||
void PhysicalObject::update(float dt)
|
||||
{
|
||||
if (!m_is_dynamic) return;
|
||||
|
||||
btTransform t;
|
||||
m_motion_state->getWorldTransform(t);
|
||||
m_motion_state->getWorldTransform(m_current_transform);
|
||||
|
||||
Vec3 xyz = t.getOrigin();
|
||||
const Vec3 &xyz = m_current_transform.getOrigin();
|
||||
if(m_reset_when_too_low && xyz.getY()<m_reset_height)
|
||||
{
|
||||
m_body->setCenterOfMassTransform(m_init_pos);
|
||||
m_body->setLinearVelocity (btVector3(0,0,0));
|
||||
m_body->setAngularVelocity(btVector3(0,0,0));
|
||||
xyz = Vec3(m_init_pos.getOrigin());
|
||||
}
|
||||
// Offset the graphical position correctly:
|
||||
xyz += t.getBasis()*m_graphical_offset;
|
||||
|
||||
//m_node->setPosition(xyz.toIrrVector());
|
||||
Vec3 hpr;
|
||||
hpr.setHPR(t.getRotation());
|
||||
//m_node->setRotation(hpr.toIrrHPR());
|
||||
|
||||
m_object->move(xyz.toIrrVector(), hpr.toIrrVector()*RAD_TO_DEGREE,
|
||||
m_init_scale, false, true /* isAbsoluteCoord */);
|
||||
} // update
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -673,9 +688,8 @@ void PhysicalObject::handleExplosion(const Vec3& pos, bool direct_hit)
|
||||
}
|
||||
else // only affected by a distant explosion
|
||||
{
|
||||
btTransform t;
|
||||
m_motion_state->getWorldTransform(t);
|
||||
btVector3 diff=t.getOrigin()-pos;
|
||||
|
||||
btVector3 diff=m_current_transform.getOrigin()-pos;
|
||||
|
||||
float len2=diff.length2();
|
||||
|
||||
|
@ -137,6 +137,10 @@ private:
|
||||
/** This is the initial position of the object for the physics. */
|
||||
btTransform m_init_pos;
|
||||
|
||||
/** Save current transform to avoid frequent lookup from
|
||||
* world transform. */
|
||||
btTransform m_current_transform;
|
||||
|
||||
/** The mesh might not have the same center as bullet does. This
|
||||
* offset is used to offset the location of the graphical mesh
|
||||
* so that the graphics are aligned with the bullet collision shape. */
|
||||
@ -192,6 +196,7 @@ public:
|
||||
virtual void reset ();
|
||||
virtual void handleExplosion(const Vec3& pos, bool directHit);
|
||||
void update (float dt);
|
||||
void updateGraphics (float dt);
|
||||
void init (const Settings &settings);
|
||||
void move (const Vec3& xyz, const core::vector3df& hpr);
|
||||
void hit (const Material *m, const Vec3 &normal);
|
||||
|
@ -1521,7 +1521,22 @@ void Track::handleAnimatedTextures(scene::ISceneNode *node, const XMLNode &xml)
|
||||
} // handleAnimatedTextures
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Update, called once per frame.
|
||||
/** This updates all only graphical elements. It is only called once per
|
||||
* rendered frame, not once per time step.
|
||||
* float dt Time since last rame.
|
||||
*/
|
||||
void Track::updateGraphics(float dt)
|
||||
{
|
||||
m_track_object_manager->updateGraphics(dt);
|
||||
|
||||
for (unsigned int i = 0; i<m_animated_textures.size(); i++)
|
||||
{
|
||||
m_animated_textures[i]->update(dt);
|
||||
}
|
||||
} // updateGraphics
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Update, called once per physics time step.
|
||||
* \param dt Timestep.
|
||||
*/
|
||||
void Track::update(int ticks)
|
||||
@ -1533,11 +1548,6 @@ void Track::update(int ticks)
|
||||
}
|
||||
float dt = stk_config->ticks2Time(ticks);
|
||||
m_track_object_manager->update(dt);
|
||||
|
||||
for(unsigned int i=0; i<m_animated_textures.size(); i++)
|
||||
{
|
||||
m_animated_textures[i]->update(dt);
|
||||
}
|
||||
CheckManager::get()->update(dt);
|
||||
ItemManager::get()->update(ticks);
|
||||
|
||||
|
@ -421,6 +421,7 @@ public:
|
||||
void startMusic () const;
|
||||
|
||||
void createPhysicsModel(unsigned int main_track_count);
|
||||
void updateGraphics(float dt);
|
||||
void update(int ticks);
|
||||
void reset();
|
||||
void itemCommand(const XMLNode *node);
|
||||
|
@ -521,10 +521,28 @@ void TrackObject::resetEnabled()
|
||||
{
|
||||
m_movable_children[i]->resetEnabled();
|
||||
}
|
||||
}
|
||||
} // resetEnabled
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** This updates all only graphical elements. It is only called once per
|
||||
* rendered frame, not once per time step.
|
||||
* float dt Time since last rame.
|
||||
*/
|
||||
void TrackObject::updateGraphics(float dt)
|
||||
{
|
||||
|
||||
// FIXME: At this stage neither m_presentation nor m_animator
|
||||
// have been converted to use separate updateGraphics() calls.
|
||||
|
||||
if (m_physical_object) m_physical_object->updateGraphics(dt);
|
||||
|
||||
} // update
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** This updates all only graphical elements. It is only called once per
|
||||
* rendered frame, not once per time step.
|
||||
* float dt Time since last rame.
|
||||
*/
|
||||
void TrackObject::update(float dt)
|
||||
{
|
||||
if (m_presentation) m_presentation->update(dt);
|
||||
@ -534,7 +552,6 @@ void TrackObject::update(float dt)
|
||||
if (m_animator) m_animator->update(dt);
|
||||
} // update
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Does a raycast against the track object. The object must have a physical
|
||||
* object.
|
||||
@ -580,7 +597,8 @@ void TrackObject::move(const core::vector3df& xyz, const core::vector3df& hpr,
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void TrackObject::movePhysicalBodyToGraphicalNode(const core::vector3df& xyz, const core::vector3df& hpr)
|
||||
void TrackObject::movePhysicalBodyToGraphicalNode(const core::vector3df& xyz,
|
||||
const core::vector3df& hpr)
|
||||
{
|
||||
// If we set a bullet position from an irrlicht position, we need to
|
||||
// get the absolute transform from the presentation object (as set in
|
||||
@ -598,7 +616,7 @@ void TrackObject::movePhysicalBodyToGraphicalNode(const core::vector3df& xyz, co
|
||||
{
|
||||
m_physical_object->move(xyz, hpr);
|
||||
}
|
||||
}
|
||||
} // movePhysicalBodyToGraphicalNode
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
const core::vector3df& TrackObject::getPosition() const
|
||||
@ -619,7 +637,6 @@ const core::vector3df TrackObject::getAbsoluteCenterPosition() const
|
||||
return m_init_xyz;
|
||||
} // getAbsolutePosition
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
const core::vector3df TrackObject::getAbsolutePosition() const
|
||||
|
@ -119,6 +119,7 @@ public:
|
||||
const PhysicalObject::Settings* physicsSettings);
|
||||
virtual ~TrackObject();
|
||||
virtual void update(float dt);
|
||||
virtual void updateGraphics(float dt);
|
||||
void move(const core::vector3df& xyz, const core::vector3df& hpr,
|
||||
const core::vector3df& scale, bool updateRigidBody,
|
||||
bool isAbsoluteCoord);
|
||||
|
@ -137,6 +137,19 @@ void TrackObjectManager::handleExplosion(const Vec3 &pos, const PhysicalObject *
|
||||
}
|
||||
} // handleExplosion
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Updates all track objects.
|
||||
* \param dt Time step size.
|
||||
*/
|
||||
void TrackObjectManager::updateGraphics(float dt)
|
||||
{
|
||||
TrackObject* curr;
|
||||
for_in(curr, m_all_objects)
|
||||
{
|
||||
curr->updateGraphics(dt);
|
||||
}
|
||||
} // updateGraphics
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Updates all track objects.
|
||||
* \param dt Time step size.
|
||||
|
@ -59,6 +59,7 @@ public:
|
||||
void add(const XMLNode &xml_node, scene::ISceneNode* parent,
|
||||
ModelDefinitionLoader& model_def_loader,
|
||||
TrackObject* parent_library);
|
||||
void updateGraphics(float dt);
|
||||
void update(float dt);
|
||||
void handleExplosion(const Vec3 &pos, const PhysicalObject *mp,
|
||||
bool secondary_hits=true);
|
||||
|
Loading…
Reference in New Issue
Block a user