Add updateGraphics for track object presentation

This commit is contained in:
Benau 2018-10-11 16:23:20 +08:00
parent 19e2baed74
commit 510d221fbc
3 changed files with 8 additions and 6 deletions

View File

@ -528,6 +528,7 @@ void TrackObject::resetEnabled()
*/ */
void TrackObject::updateGraphics(float dt) void TrackObject::updateGraphics(float dt)
{ {
if (m_presentation) m_presentation->updateGraphics(dt);
if (m_physical_object) m_physical_object->updateGraphics(dt); if (m_physical_object) m_physical_object->updateGraphics(dt);
} // update } // update

View File

@ -719,7 +719,7 @@ TrackObjectPresentationSound::TrackObjectPresentationSound(
} // TrackObjectPresentationSound } // TrackObjectPresentationSound
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void TrackObjectPresentationSound::update(float dt) void TrackObjectPresentationSound::updateGraphics(float dt)
{ {
if (m_sound != NULL && m_enabled) if (m_sound != NULL && m_enabled)
{ {
@ -820,7 +820,7 @@ TrackObjectPresentationBillboard::TrackObjectPresentationBillboard(
} // TrackObjectPresentationBillboard } // TrackObjectPresentationBillboard
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void TrackObjectPresentationBillboard::update(float dt) void TrackObjectPresentationBillboard::updateGraphics(float dt)
{ {
if (ProfileWorld::isNoGraphics()) return; if (ProfileWorld::isNoGraphics()) return;
#ifndef SERVER_ONLY #ifndef SERVER_ONLY
@ -934,7 +934,7 @@ TrackObjectPresentationParticles::~TrackObjectPresentationParticles()
} // ~TrackObjectPresentationParticles } // ~TrackObjectPresentationParticles
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void TrackObjectPresentationParticles::update(float dt) void TrackObjectPresentationParticles::updateGraphics(float dt)
{ {
if (m_emitter != NULL) if (m_emitter != NULL)
{ {

View File

@ -87,6 +87,7 @@ public:
{ {
Log::warn("TrackObjectPresentation", "setEnable unimplemented for this presentation type"); Log::warn("TrackObjectPresentation", "setEnable unimplemented for this presentation type");
} }
virtual void updateGraphics(float dt) {}
virtual void update(float dt) {} virtual void update(float dt) {}
virtual void move(const core::vector3df& xyz, const core::vector3df& hpr, virtual void move(const core::vector3df& xyz, const core::vector3df& hpr,
const core::vector3df& scale, bool isAbsoluteCoord) {} const core::vector3df& scale, bool isAbsoluteCoord) {}
@ -290,7 +291,7 @@ public:
bool disable_for_multiplayer); bool disable_for_multiplayer);
virtual ~TrackObjectPresentationSound(); virtual ~TrackObjectPresentationSound();
virtual void onTriggerItemApproached() OVERRIDE; virtual void onTriggerItemApproached() OVERRIDE;
virtual void update(float dt) OVERRIDE; virtual void updateGraphics(float dt) OVERRIDE;
virtual void move(const core::vector3df& xyz, const core::vector3df& hpr, virtual void move(const core::vector3df& xyz, const core::vector3df& hpr,
const core::vector3df& scale, bool isAbsoluteCoord) OVERRIDE; const core::vector3df& scale, bool isAbsoluteCoord) OVERRIDE;
void triggerSound(bool loop); void triggerSound(bool loop);
@ -320,7 +321,7 @@ public:
TrackObjectPresentationBillboard(const XMLNode& xml_node, TrackObjectPresentationBillboard(const XMLNode& xml_node,
scene::ISceneNode* parent); scene::ISceneNode* parent);
virtual ~TrackObjectPresentationBillboard(); virtual ~TrackObjectPresentationBillboard();
virtual void update(float dt) OVERRIDE; virtual void updateGraphics(float dt) OVERRIDE;
}; // TrackObjectPresentationBillboard }; // TrackObjectPresentationBillboard
@ -342,7 +343,7 @@ public:
scene::ISceneNode* parent); scene::ISceneNode* parent);
virtual ~TrackObjectPresentationParticles(); virtual ~TrackObjectPresentationParticles();
virtual void update(float dt) OVERRIDE; virtual void updateGraphics(float dt) OVERRIDE;
void triggerParticles(); void triggerParticles();
void stop(); void stop();
void stopIn(double delay); void stopIn(double delay);