20#ifndef HEADER_TRACK_OBJECT_PRESENTATION_HPP
21#define HEADER_TRACK_OBJECT_PRESENTATION_HPP
23#include "graphics/lod_node.hpp"
24#include "utils/cpp2011.hpp"
25#include "utils/no_copy.hpp"
26#include "utils/log.hpp"
27#include "utils/leak_check.hpp"
28#include "utils/time.hpp"
29#include "utils/vec3.hpp"
42namespace GE {
class GERenderInfo; }
43class STKInstancedSceneNode;
49 namespace scene {
class IAnimatedMesh;
class IMesh;
class IMeshSceneNode;
class ISceneNode; }
74 const core::vector3df& hpr = core::vector3df(0,0,0),
75 const core::vector3df& scale = core::vector3df(0,0,0))
86 virtual void reset() {}
87 virtual void setEnable(
bool enabled)
89 Log::warn(
"TrackObjectPresentation",
"setEnable unimplemented for this presentation type");
91 virtual void updateGraphics(
float dt) {}
92 virtual void update(
float dt) {}
93 virtual void move(
const core::vector3df& xyz,
const core::vector3df& hpr,
94 const core::vector3df& scale,
bool isAbsoluteCoord) {}
107 virtual const core::vector3df getAbsoluteCenterPosition()
const
132 bool m_force_always_hidden;
140 m_force_always_hidden =
false;
145 const core::vector3df& hpr,
146 const core::vector3df& scale,
147 scene::ISceneNode* node = NULL) :
151 m_force_always_hidden =
false;
155 virtual const core::vector3df&
getPosition() const OVERRIDE;
157 virtual const core::vector3df getAbsoluteCenterPosition() const OVERRIDE;
158 virtual const core::vector3df&
getRotation() const OVERRIDE;
159 virtual const core::vector3df&
getScale() const OVERRIDE;
160 virtual
void move(const core::vector3df& xyz, const core::vector3df& hpr,
161 const core::vector3df& scale,
bool isAbsoluteCoord) OVERRIDE;
162 virtual
void setEnable(
bool enabled) OVERRIDE;
163 virtual
void reset() OVERRIDE;
172 bool isAlwaysHidden()
const {
return m_force_always_hidden; }
194 using TrackObjectPresentationSceneNode::move;
196 bool m_start_executed, m_reset_executed;
202 virtual void update(
float dt) OVERRIDE;
203 virtual void reset() OVERRIDE
205 m_reset_executed =
false;
206 TrackObjectPresentationSceneNode::reset();
208 virtual void move(
const core::vector3df& xyz,
const core::vector3df& hpr,
209 const core::vector3df& scale,
bool isAbsoluteCoord) OVERRIDE;
221 scene::ISceneNode* parent,
223 std::shared_ptr<GE::GERenderInfo> ri);
225 virtual void reset() OVERRIDE;
245 std::string m_model_file;
247 std::shared_ptr<GE::GERenderInfo> m_render_info;
249 void init(
const XMLNode* xml_node, scene::ISceneNode* parent,
bool enabled);
253 scene::ISceneNode* parent,
254 std::shared_ptr<GE::GERenderInfo> render_info);
257 const core::vector3df& xyz,
258 const core::vector3df& hpr,
259 const core::vector3df& scale);
261 const core::vector3df& xyz,
262 const core::vector3df& hpr,
263 const core::vector3df& scale);
265 virtual void reset() OVERRIDE;
286 core::vector3df m_xyz;
293 scene::ISceneNode* parent,
294 bool disable_for_multiplayer);
296 void onTriggerItemApproached(
int kart_id);
297 virtual void updateGraphics(
float dt) OVERRIDE;
298 virtual void move(
const core::vector3df& xyz,
const core::vector3df& hpr,
299 const core::vector3df& scale,
bool isAbsoluteCoord) OVERRIDE;
300 void triggerSound(
bool loop);
303 virtual void setEnable(
bool enabled) OVERRIDE;
321 float m_fade_out_start;
322 float m_fade_out_end;
325 scene::ISceneNode* parent);
327 virtual void updateGraphics(
float dt) OVERRIDE;
340 std::string m_trigger_condition;
342 double m_delayed_stop_time;
346 scene::ISceneNode* parent);
349 virtual void updateGraphics(
float dt) OVERRIDE;
350 void triggerParticles();
352 void stopIn(
double delay);
353 void setRate(
float rate);
366 video::SColor m_color;
371 scene::ISceneNode* parent);
373 float getEnergy()
const {
return m_energy; }
374 virtual void setEnable(
bool enabled) OVERRIDE;
375 void setEnergy(
float energy);
380enum ActionTriggerType
382 TRIGGER_TYPE_POINT = 0,
383 TRIGGER_TYPE_CYLINDER = 1
393 std::string
m_action, m_library_id, m_triggered_object, m_library_name;
395 float m_xml_reenable_timeout;
397 uint64_t m_reenable_timeout;
399 ActionTriggerType m_type;
405 const std::string& scriptname,
410 void onTriggerItemApproached(
int kart_id);
421 std::numeric_limits<uint64_t>::max();
424 void setReenableTimeout(
float time)
manages level-of-detail
Definition: lod_node.hpp:50
Utility class to load level-of-detail nodes and library nodes.
Definition: model_definition_loader.hpp:81
manages smoke particle effects
Definition: particle_emitter.hpp:42
Definition: physical_object.hpp:40
The base class for sound effects.
Definition: sfx_base.hpp:43
static uint64_t getMonoTimeMs()
Returns a time based since the starting of stk (monotonic clock).
Definition: time.hpp:106
A virtual base class for all animations.
Definition: three_d_animation.hpp:45
A track object representation that consists of an action trigger.
Definition: track_object_presentation.hpp:390
virtual void setEnable(bool status) OVERRIDE
Sets the trigger to be enabled or disabled.
Definition: track_object_presentation.hpp:418
virtual void reset() OVERRIDE
Reset the trigger (i.e.
Definition: track_object_presentation.hpp:413
std::string m_action
For action trigger objects.
Definition: track_object_presentation.hpp:393
A track object representation that consists of a billboard scene node.
Definition: track_object_presentation.hpp:315
bool m_fade_out_when_close
To make the billboard disappear when close to the camera.
Definition: track_object_presentation.hpp:320
A track object representation that is invisible and only consists of a location, rotation and scale.
Definition: track_object_presentation.hpp:181
A track object representation that consists of a level-of-detail scene node.
Definition: track_object_presentation.hpp:217
A track object representation that is a library node.
Definition: track_object_presentation.hpp:192
A track object representation that consists of a light emitter.
Definition: track_object_presentation.hpp:364
A track object representation that consists of a mesh scene node.
Definition: track_object_presentation.hpp:233
bool m_is_in_skybox
True if the object is in the skybox.
Definition: track_object_presentation.hpp:243
const std::string & getModelFile() const
Returns the mode file name.
Definition: track_object_presentation.hpp:268
scene::IMesh * m_mesh
The mesh used here.
Definition: track_object_presentation.hpp:237
bool m_is_looped
True if it is a looped animation.
Definition: track_object_presentation.hpp:240
A track object representation that consists of a particle emitter.
Definition: track_object_presentation.hpp:336
std::string & getTriggerCondition()
Returns the trigger condition for this object.
Definition: track_object_presentation.hpp:356
Base class for all track object presentation classes using a scene node as presentation.
Definition: track_object_presentation.hpp:127
virtual const core::vector3df getAbsolutePosition() const OVERRIDE
Returns a copy of the initial position.
Definition: track_object_presentation.cpp:87
scene::ISceneNode * getNode()
Returns a pointer to the scene node.
Definition: track_object_presentation.hpp:167
virtual const core::vector3df & getScale() const OVERRIDE
Returns the initial scale.
Definition: track_object_presentation.cpp:112
TrackObjectPresentationSceneNode(const XMLNode &xml_node)
Constructor based on data from xml.
Definition: track_object_presentation.hpp:136
virtual const core::vector3df & getRotation() const OVERRIDE
Returns the initial rotation.
Definition: track_object_presentation.cpp:105
const scene::ISceneNode * getNode() const
Returns a pointer to the scene node, const version.
Definition: track_object_presentation.hpp:170
virtual const core::vector3df & getPosition() const OVERRIDE
Returns the position of this TrackObjectPresentation.
Definition: track_object_presentation.cpp:80
TrackObjectPresentationSceneNode(const core::vector3df &xyz, const core::vector3df &hpr, const core::vector3df &scale, scene::ISceneNode *node=NULL)
Constructor based on a transform.
Definition: track_object_presentation.hpp:144
scene::ISceneNode * m_node
A pointer to the scene node of this object.
Definition: track_object_presentation.hpp:130
A track object representation that consists of a sound emitter.
Definition: track_object_presentation.hpp:276
const std::string & getTriggerCondition() const
Currently used for sound effects only, in cutscenes only atm.
Definition: track_object_presentation.hpp:307
SFXBase * m_sound
If a sound is attached to this object and/or this is a sound emitter object.
Definition: track_object_presentation.hpp:281
std::string m_trigger_condition
Currently used for sound effects only, in cutscenes only atm.
Definition: track_object_presentation.hpp:284
Base class for all track object presentation classes.
Definition: track_object_presentation.hpp:57
core::vector3df m_init_xyz
The initial XYZ position of the object.
Definition: track_object_presentation.hpp:60
core::vector3df m_init_hpr
The initial hpr of the object.
Definition: track_object_presentation.hpp:63
core::vector3df m_init_scale
The initial scale of the object.
Definition: track_object_presentation.hpp:66
virtual const core::vector3df & getPosition() const
Returns the position of this TrackObjectPresentation.
Definition: track_object_presentation.hpp:98
virtual const core::vector3df getAbsolutePosition() const
Returns a copy of the initial position.
Definition: track_object_presentation.hpp:102
virtual const core::vector3df & getRotation() const
Returns the initial rotation.
Definition: track_object_presentation.hpp:113
virtual const core::vector3df & getScale() const
Returns the initial scale.
Definition: track_object_presentation.hpp:116
This is a base object for any separate object on the track, which might also have a skeletal animatio...
Definition: track_object.hpp:56
utility class used to parse XML files
Definition: xml_node.hpp:48