- Timestamp:
- Jan 19, 2016, 10:49:57 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/shaders_merge/src/orxonox/graphics/LensFlare.h
r11075 r11078 67 67 { 68 68 public: 69 std::string *material_;//!< Which material should the Lens use, current choices include burst, bursthalo, halo1, halo2, halo369 std::string material_;//!< Which material should the Lens use, current choices include burst, bursthalo, halo1, halo2, halo3 70 70 float alpha_;//!< Which base alpha value should the Lens use 71 71 float scale_;//!< Which base scale should the Lens Flare have 72 72 float position_;//!< This defines how far along the view direction the flare should be positioned, e.g. 0.5 would position the flare halfway between the viewer and the base burst, 0 at the camera, 1 at the burst 73 Lens (std::string*material, float alpha, float scale, float position)73 Lens (const std::string& material, float alpha, float scale, float position) 74 74 { 75 this->material_ =material;76 this->alpha_ =alpha;77 this->scale_ =scale;78 this->position_ =position;75 this->material_ = material; 76 this->alpha_ = alpha; 77 this->scale_ = scale; 78 this->position_ = position; 79 79 } 80 80 }; … … 85 85 86 86 inline void setScale(float scale) 87 { this->scale_ =scale; }87 { this->scale_ = scale; } 88 88 inline float getScale() const 89 89 { return this->scale_; } … … 96 96 */ 97 97 inline void setColour(const ColourValue& colour) 98 { 99 this->colour_->r=colour.r; 100 this->colour_->g=colour.g; 101 this->colour_->b=colour.b; 102 } 98 { this->colour_ = colour; } 103 99 /** 104 100 @brief … … 107 103 */ 108 104 inline const ColourValue& getColour() const 109 { return *(new ColourValue(this->colour_->r,this->colour_->g,this->colour_->b)); }105 { return this->colour_; } 110 106 111 107 /** … … 121 117 */ 122 118 inline void setFadeResolution(unsigned int fadeResolution) 123 { this->fadeResolution_ =fadeResolution>0?fadeResolution:1; }119 { this->fadeResolution_ = fadeResolution > 0 ? fadeResolution : 1; } 124 120 /** 125 121 @brief … … 137 133 */ 138 134 inline void setFadeExponent(float exponent) 139 { this->fadeExponent_ =exponent; }135 { this->fadeExponent_ = exponent; } 140 136 /** 141 137 @brief … … 153 149 */ 154 150 inline void setFadeOnViewBorder(bool fadeOnViewBorder) 155 { this->fadeOnViewBorder_ =fadeOnViewBorder; }151 { this->fadeOnViewBorder_ = fadeOnViewBorder; } 156 152 /** 157 153 @brief … … 174 170 void createBillboards(); 175 171 176 void updateBillboardStates( Vector3& viewDirection, float dimension, bool isLightVisible);172 void updateBillboardStates(const Vector3& viewDirection, float dimension, bool isLightVisible); 177 173 178 174 void updateBillboardAlphas(float alpha); … … 180 176 unsigned int getPointCount(float dimension) const; 181 177 182 std::vector<Lens *>*lensConfiguration_;//!< this stores the lensConfiguration178 std::vector<Lens> lensConfiguration_;//!< this stores the lensConfiguration 183 179 Billboard* occlusionBillboard_;//!< this is a transparent billboard used solely for the Hardware Occlusion Query 184 float cameraDistance_;//!< current distance of the lensflare center from the camera185 180 float scale_;//!< this factor is used to scale the billboard to the desired size 186 181 bool fadeOnViewBorder_;//!< should the effect fade out on the border of the view? 187 182 unsigned int fadeResolution_;//!< how many points should be sampled per axis for the screen border fade. High number => smooth fade, but uses more processing power 188 183 float fadeExponent_;//!< this determines how fast the flare fades away as it gets obstructed 189 ColourValue *colour_;//!< this stores the base colour of the light184 ColourValue colour_;//!< this stores the base colour of the light 190 185 }; 191 186 }
Note: See TracChangeset
for help on using the changeset viewer.