From f030154fe727e25a2afe1f78b3998c2d2dba95e4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 18 Aug 2009 09:24:15 +0000 Subject: astyle cleanup, corrects not loading of material textures --- src/model/parts.h | 226 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 129 insertions(+), 97 deletions(-) (limited to 'src/model/parts.h') diff --git a/src/model/parts.h b/src/model/parts.h index 210a225..4df4672 100644 --- a/src/model/parts.h +++ b/src/model/parts.h @@ -24,7 +24,7 @@ namespace model * Culling is a paremeter used by flares and particles to indicate * with side of the polygons should be culled during rendering */ -enum Cull { CullNone=0, CullBack=1, CullFront=2 }; +enum Cull { CullNone = 0, CullBack = 1, CullFront = 2 }; /* ---- class Part ------------------------------------------------- */ @@ -37,23 +37,20 @@ public: /** * @brief default constructor */ - inline Part() : part_location() - { + inline Part() : part_location() { } /** * @brief copy constructor */ - inline Part(const Part& other) : part_location(other.location()) - { + inline Part(const Part& other) : part_location(other.location()) { } /** * @brief constructor with location * @param location location of this part within the parent model */ - inline Part(const math::Vector3f& location) : part_location(location) - { + inline Part(const math::Vector3f& location) : part_location(location) { } /* ---- inspectors ----------------------------------------- */ @@ -61,8 +58,7 @@ public: /** * @brief location of this part within the parent model */ - inline const math::Vector3f& location() const - { + inline const math::Vector3f& location() const { return part_location; } @@ -70,22 +66,25 @@ public: /** * @brief set the location within the parent model */ - inline void set_location(const math::Vector3f& location) { part_location.assign(location); } + inline void set_location(const math::Vector3f& location) { + part_location.assign(location); + } /** * @brief set the location within the parent model */ - inline void set_location(const float x, const float y, const float z) { part_location.assign(x, y, z); } + inline void set_location(const float x, const float y, const float z) { + part_location.assign(x, y, z); + } /* ---- actors --------------------------------------------- */ /** * @brief mutable reference to the location of this part within the parent model */ - inline math::Vector3f& get_location() - { + inline math::Vector3f& get_location() { return part_location; - } + } private: math::Vector3f part_location; @@ -111,66 +110,56 @@ public: * @brief destructor */ ~Light(); - + /* ---- inspectors ----------------------------------------- */ /// light color - inline const math::Color& color() const - { + inline const math::Color& color() const { return light_color; }; - + /// true if this is a strobe light - inline bool strobe() const - { + inline bool strobe() const { return light_strobe; } - + /// true if this light has entity color - inline bool entity() const - { + inline bool entity() const { return light_entity; } /// true if this light has engine activation - inline bool engine() const - { + inline bool engine() const { return light_engine; } - + /// size of the light, default is 1.0f - inline float radius() const - { + inline float radius() const { return light_radius; } - + /// strobe time offset, in seconds - inline float offset() const - { + inline float offset() const { return light_offset; } - + /// strobe frequency in strobes per second, default is 1.0f - inline float frequency() const - { + inline float frequency() const { return light_frequency; } - + /// fraction a strobe light will be on, default is 0.5f - inline float time() const - { + inline float time() const { return light_time; } - + /// flare texture number - inline unsigned int flare() const - { + inline unsigned int flare() const { return light_flare; } - + /// render texture id - inline size_t texture() const - { + inline size_t texture() const { return light_texture; } /* ---- mutators ------------------------------------------- */ @@ -178,53 +167,73 @@ public: /** * @brief set strobe color on or off */ - inline void set_strobe(const bool strobe) { light_strobe = strobe; } + inline void set_strobe(const bool strobe) { + light_strobe = strobe; + } /** * @brief set entity color on or off */ - inline void set_entity(const 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(const 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; } + inline void set_radius(const float radius) { + light_radius = radius; + } /** * @brief set the light strobe frequency, in strobes per second */ - inline void set_frequency(const float frequency) { light_frequency = frequency; } + inline void set_frequency(const float frequency) { + light_frequency = frequency; + } /** * @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; } + inline void set_time(const float time) { + light_radius = time; + } /** * @brief set the light strobe time offset, in seconds */ - inline void set_offset(const float offset) { light_offset = offset; } + 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; } + 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; } + inline void set_texture(size_t texture) { + light_texture = texture; + } /** * @brief mutable reference to the color */ - inline math::Color& get_color() { return light_color; } - + inline math::Color& get_color() { + return light_color; + } + private: bool light_strobe; bool light_engine; @@ -256,29 +265,31 @@ public: Flare(const Flare& other); ~Flare(); - + /* ---- inspectors ----------------------------------------- */ - inline const math::Axis &axis() const - { + inline const math::Axis &axis() const { return flare_axis; } - - inline Cull cull() const - { + + inline Cull cull() const { return flare_cull; } /* ---- mutators ------------------------------------------- */ - - inline void set_cull(const Cull cull) { flare_cull = cull; } + + inline void set_cull(const Cull cull) { + flare_cull = cull; + } /* ---- actors --------------------------------------------- */ /** * @brief mutable reference to the axis */ - inline math::Axis& get_axis() { return flare_axis; } + inline math::Axis& get_axis() { + return flare_axis; + } private: Cull flare_cull; @@ -296,34 +307,28 @@ public: Particles(const math::Vector3f & location); ~Particles(); - - inline const math::Axis &axis() const - { + + inline const math::Axis &axis() const { return particles_axis; } - - inline const std::string& script() const - { + + inline const std::string& script() const { return particles_script; } - inline bool entity() const - { + inline bool entity() const { return particles_entity; } - inline bool engine() const - { + inline bool engine() const { return particles_engine; } - - inline float radius() const - { + + inline float radius() const { return particles_radius; } - inline Cull cull() const - { + inline Cull cull() const { return particles_cull; } @@ -332,25 +337,37 @@ public: /** * @brief set entity color on or off */ - inline void set_entity(const bool entity) { particles_entity = entity; } + inline void set_entity(const bool entity) { + particles_entity = entity; + } /** * @brief set engine activation on or off */ - inline void set_engine(const bool engine) { particles_engine = engine; } + inline void set_engine(const bool engine) { + particles_engine = engine; + } - inline void set_radius(const float radius) { particles_radius = radius; } + inline void set_radius(const float radius) { + particles_radius = radius; + } - inline void set_cull(const Cull cull) { particles_cull = cull; } + inline void set_cull(const Cull cull) { + particles_cull = cull; + } - inline void set_script(const std::string& script) { particles_script.assign(script); } + inline void set_script(const std::string& script) { + particles_script.assign(script); + } /* ---- actors --------------------------------------------- */ /** * @brief mutable reference to the axis */ - inline math::Axis& get_axis() { return particles_axis; } + inline math::Axis& get_axis() { + return particles_axis; + } private: bool particles_entity; @@ -360,7 +377,7 @@ private: float particles_radius; - math::Axis particles_axis; + math::Axis particles_axis; std::string particles_script; }; @@ -378,15 +395,16 @@ public: Dock(const Dock& other); ~Dock(); - + /// dock radius, default is 0.01f - inline float radius() const - { + inline float radius() const { return dock_radius; } - /// set dock radius - inline void set_radius(const float radius) { dock_radius = radius; } + /// set dock radius + inline void set_radius(const float radius) { + dock_radius = radius; + } private: float dock_radius; @@ -404,25 +422,39 @@ public: ~SubModel(); - inline const std::string& name() const { return submodel_name; } + inline const std::string& name() const { + return submodel_name; + } - inline const math::Axis& axis() const { return submodel_axis; } + inline const math::Axis& axis() const { + return submodel_axis; + } - inline float scale() const { return submodel_scale; } + inline float scale() const { + return submodel_scale; + } - inline void set_scale(const float scale) { submodel_scale = scale; } + inline void set_scale(const float scale) { + submodel_scale = scale; + } - inline void set_name(const std::string& name) { submodel_name.assign(name); } + inline void set_name(const std::string& name) { + submodel_name.assign(name); + } - inline void set_axis(const math::Axis& axis) { submodel_axis.assign(axis); } + inline void set_axis(const math::Axis& axis) { + submodel_axis.assign(axis); + } /* ---- actors --------------------------------------------- */ /** * @brief mutable reference to the axis */ - inline math::Axis& get_axis() { return submodel_axis; } + inline math::Axis& get_axis() { + return submodel_axis; + } private: float submodel_scale; -- cgit v1.2.3