Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/parts.h')
-rw-r--r--src/model/parts.h103
1 files changed, 70 insertions, 33 deletions
diff --git a/src/model/parts.h b/src/model/parts.h
index 78ad5e4..c3a0401 100644
--- a/src/model/parts.h
+++ b/src/model/parts.h
@@ -120,7 +120,7 @@ public:
}
/// true if this light has engine activation
- inline const bool engine() const
+ inline bool engine() const
{
return light_engine;
}
@@ -137,7 +137,7 @@ public:
return light_offset;
}
- /// frequency in strobes per second
+ /// strobe frequency in strobes per second, default is 1.0f
inline float frequency() const
{
return light_frequency;
@@ -155,41 +155,78 @@ public:
return light_flare;
}
- /// render texture number
+ /// render texture id
inline size_t texture() const
{
- return render_texture;
+ return light_texture;
}
/* ---- mutators ------------------------------------------- */
- /// set strobe on or off
- inline void set_strobe(bool strobe) { light_strobe = strobe; }
+ /**
+ * @brief set strobe color on or off
+ */
+ inline void set_strobe(const bool strobe) { light_strobe = strobe; }
/**
* @brief set entity color on or off
*/
- inline void set_entity(bool entity) { light_entity = entity; }
+ inline void set_entity(const bool entity) { light_entity = entity; }
/**
* @brief set engine activation on or off
*/
- inline void set_engine(bool engine) { light_engine = engine; }
+ inline void set_engine(const bool engine) { light_engine = engine; }
+ /**
+ * @brief set the light radius
+ */
+ inline void set_radius(const float radius) { light_radius = radius; }
- math::Color light_color;
- float light_radius;
- float light_frequency;
- float light_offset;
- float light_time;
+ /**
+ * @brief set the light strobe frequency, in strobes per second
+ */
+ inline void set_frequency(const float frequency) { light_frequency = frequency; }
- unsigned int light_flare;
+ /**
+ * @brief set the light on time, from 0.0 (always off) to 1.0 (always on)
+ */
+ inline void set_time(const float time) { light_radius = time; }
- size_t render_texture;
+ /**
+ * @brief set the light strobe time offset, in seconds
+ */
+ inline void set_offset(const float offset) { light_offset = offset; }
+
+ /**
+ * @brief set the flare texture number
+ */
+ inline void set_flare(unsigned int flare) { light_flare = flare; }
+
+ /**
+ * @brief set the render texture id
+ */
+ inline void set_texture(size_t texture) { light_texture = texture; }
+ /**
+ * @brief mutable reference to the color
+ */
+ inline math::Color& get_color() { return light_color; }
+
private:
bool light_strobe;
bool light_engine;
bool light_entity;
+
+ unsigned int light_flare;
+
+ float light_radius;
+ float light_frequency;
+ float light_offset;
+ float light_time;
+
+ math::Color light_color;
+
+ size_t light_texture;
};
/* ---- class Flare ------------------------------------------------ */
@@ -223,11 +260,11 @@ public:
/**
* @brief mutable reference to the axis
*/
- inline math::Axis &get_axis() { return flare_axis; }
+ inline math::Axis& get_axis() { return flare_axis; }
private:
- math::Axis flare_axis;
Cull flare_cull;
+ math::Axis flare_axis;
};
/* ---- class Particles -------------------------------------------- */
@@ -285,7 +322,9 @@ public:
inline void set_radius(const float radius) { particles_radius = radius; }
inline void set_cull(const Cull cull) { particles_cull = cull; }
-
+
+ inline void set_script(const std::string &script) { particles_script.assign(script); }
+
/* ---- actors --------------------------------------------- */
/**
@@ -293,39 +332,37 @@ public:
*/
inline math::Axis &get_axis() { return particles_axis; }
- std::string particles_script;
-
private:
- math::Axis particles_axis;
- float particles_radius;
bool particles_entity;
bool particles_engine;
+
Cull particles_cull;
+
+ float particles_radius;
+
+ math::Axis particles_axis;
+ std::string particles_script;
};
/* ---- class Dock ------------------------------------------------- */
/// a docking location
-class Dock
+class Dock : public Part
{
public:
Dock();
~Dock();
- /// location of the dock
- inline const math::Vector3f & location() const
- {
- return dock_location;
- }
-
- /// trigger distance default is 0.01f
+ /// dock radius, default is 0.01f
inline float radius() const
{
return dock_radius;
}
-
-
- math::Vector3f dock_location;
+
+ /// set dock radius
+ inline void set_radius(const float radius) { dock_radius = radius; }
+
+private:
float dock_radius;
};