Changeset View
Changeset View
Standalone View
Standalone View
effects/magiclamp/magiclamp.cpp
Show First 20 Lines • Show All 192 Lines • ▼ Show 20 Line(s) | 190 | #define SET_QUADS(_SET_A_, _A_, _DA_, _SET_B_, _B_, _O0_, _O1_, _O2_, _O3_) quad[0]._SET_A_((icon._A_() + icon._DA_()*(quad[0]._A_() / geo._DA_()) - (quad[0]._A_() + geo._A_()))*p_progress[_O0_] + quad[0]._A_());\ | |||
---|---|---|---|---|---|
193 | quad[3]._SET_A_((icon._A_() + icon._DA_()*(quad[3]._A_() / geo._DA_()) - (quad[3]._A_() + geo._A_()))*p_progress[_O3_] + quad[3]._A_());\ | 193 | quad[3]._SET_A_((icon._A_() + icon._DA_()*(quad[3]._A_() / geo._DA_()) - (quad[3]._A_() + geo._A_()))*p_progress[_O3_] + quad[3]._A_());\ | ||
194 | \ | 194 | \ | ||
195 | quad[0]._SET_B_(quad[0]._B_() + offset[_O0_]);\ | 195 | quad[0]._SET_B_(quad[0]._B_() + offset[_O0_]);\ | ||
196 | quad[1]._SET_B_(quad[1]._B_() + offset[_O1_]);\ | 196 | quad[1]._SET_B_(quad[1]._B_() + offset[_O1_]);\ | ||
197 | quad[2]._SET_B_(quad[2]._B_() + offset[_O2_]);\ | 197 | quad[2]._SET_B_(quad[2]._B_() + offset[_O2_]);\ | ||
198 | quad[3]._SET_B_(quad[3]._B_() + offset[_O3_]) | 198 | quad[3]._SET_B_(quad[3]._B_() + offset[_O3_]) | ||
199 | 199 | | |||
200 | WindowQuadList newQuads; | 200 | WindowQuadList newQuads; | ||
201 | newQuads.reserve(data.quads.count()); | ||||
201 | float quadFactor; // defines how fast a quad is vertically moved: y coordinates near to window top are slowed down | 202 | float quadFactor; // defines how fast a quad is vertically moved: y coordinates near to window top are slowed down | ||
202 | // it is used as quadFactor^3/windowHeight^3 | 203 | // it is used as quadFactor^3/windowHeight^3 | ||
203 | // quadFactor is the y position of the quad but is changed towards becomming the window height | 204 | // quadFactor is the y position of the quad but is changed towards becomming the window height | ||
204 | // by that the factor becomes 1 and has no influence any more | 205 | // by that the factor becomes 1 and has no influence any more | ||
205 | float offset[2] = {0,0}; // how far has a quad to be moved? Distance between icon and window multiplied by the progress and by the quadFactor | 206 | float offset[2] = {0,0}; // how far has a quad to be moved? Distance between icon and window multiplied by the progress and by the quadFactor | ||
206 | float p_progress[2] = {0,0}; // the factor which defines how far the x values have to be changed | 207 | float p_progress[2] = {0,0}; // the factor which defines how far the x values have to be changed | ||
207 | // factor is the current moved y value diveded by the distance between icon and window | 208 | // factor is the current moved y value diveded by the distance between icon and window | ||
208 | WindowQuad lastQuad(WindowQuadError); | 209 | WindowQuad lastQuad(WindowQuadError); | ||
▲ Show 20 Lines • Show All 165 Lines • Show Last 20 Lines |